-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (42 loc) · 2.09 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: chlimous <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/01/20 00:05:37 by chlimous #+# #+# #
# Updated: 2024/09/07 21:19:34 by chlimous ### ########.fr #
# #
# **************************************************************************** #
NAME = libftprintf.a
SRCS += $(addprefix src/, ft_printf.c ft_printf2.c ft_printf3.c load_buffer.c utils.c utils2.c)
SRCS += $(addprefix src/buffer/, add_back.c add_node.c buffer_to_string.c clear_buffer.c flush.c new_node.c)
SRCS += $(addprefix src/parser/, parse_elem.c parse_flags.c set_flags.c parse_width.c parse_precision.c parse_length.c parse_formatid.c utils.c)
SRCS += $(addprefix src/exec/, formatid_c.c formatid_s.c formatid_p.c formatid_di.c formatid_u.c formatid_x.c formatid_percent.c formatid_fe.c formatid_n.c formatid_o.c formatid_k.c utils.c handle_unsigned.c handle_unsigned2.c handle_signed.c handle_signed2.c handle_float.c handle_float2.c handle_float3.c handle_float4.c handle_float5.c)
OBJS = $(SRCS:.c=.o)
INCLUDE = include
CC = cc
CFLAGS = -Wall -Wextra -Werror
C_GREEN=\e[32m
C_END=\e[0m
%.o: %.c $(INCLUDE)
$(CC) $(CFLAGS) -I $(INCLUDE) -c $< -o $(<:.c=.o)
all: $(NAME)
$(NAME): $(OBJS)
ar rcs $(NAME) $(OBJS)
bonus: all
deb: $(NAME)
@$(CC) main.c -I include -L. -lftprintf
@echo "\n"
@./a.out
debv: $(NAME)
@$(CC) main.c -I include -L. -lftprintf
@echo "\n"
@valgrind --leak-check=full ./a.out
clean:
rm -f $(OBJS)
fclean: clean
rm -f $(NAME)
re: fclean all
.PHONY: all clean fclean re