-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
124 lines (107 loc) · 3.32 KB
/
Makefile
File metadata and controls
124 lines (107 loc) · 3.32 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: abassibe <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2017/02/01 12:45:46 by abassibe #+# #+# #
# Updated: 2017/05/02 12:42:44 by abassibe ### ########.fr #
# #
# **************************************************************************** #
NAME = libftprintf.a
FLAGS = -Wall -Wextra -Werror
PRINTFSRC = ft_printf.c \
core.c \
verif_format.c \
recup_format.c \
convert_int.c \
convert_int_next.c \
preci_int.c \
field_int.c \
field_int_next.c \
field_string.c \
conv_string.c \
preci_string.c \
conv_char.c \
conv_hexa.c \
conv_octal.c \
conv_octal_next.c \
conv_hexa_x.c \
recup_args_hexa.c \
concaten_result.c \
conv_uint.c \
conv_percent.c \
conv_bin.c \
conv_n.c \
conv_empty.c \
spc_flags.c \
chk_color.c \
set_lst.c
LFTSRC = ft_atoi.c \
ft_itoa.c \
ft_itoa_long.c \
ft_itoa_ulong.c \
ft_itoa_base.c \
ft_itoa_base_maj.c \
ft_itoa_base_unsigned.c \
ft_itoa_base_maj_unsigned.c \
ft_itoa_base_unicode.c \
ft_putnstr.c \
ft_strdup.c \
ft_strndup.c \
ft_strjoin.c \
ft_strnjoin.c \
ft_strjoinn.c \
ft_strjoinf.c \
ft_strjoinfn.c \
ft_strjoinff.c \
ft_strlen.c \
ft_strnew.c \
ft_strsub.c \
ft_memalloc.c \
ft_putchar.c \
ft_memset.c \
ft_strchr.c \
ft_strdel.c \
ft_memdel.c \
ft_power.c \
ft_btoi.c \
ft_strcmp.c
OBJS1 = $(LFTSRC:.c=.o)
OBJS2 = $(PRINTFSRC:.c=.o)
OBJS = $(OBJS2) $(OBJS1)
all: $(NAME)
$(NAME): $(addprefix objs/, $(OBJS2)) $(addprefix objs/, $(OBJS1))
@printf "\033[0;35m> Compiling libftprintf.a\033[0m"
@ar rc $(NAME) $(addprefix objs/, $(OBJS))
@printf "\033[0;32m > OK\n\033[0m"
$(addprefix objs/, $(OBJS1)): $(addprefix libft/, $(LFTSRC))
@printf "\033[0;35m.\033[0m"
@gcc $(FLAGS) -c $(addprefix libft/, $(addsuffix .c, $(basename $(notdir $@)))) -o objs/$(notdir $@) -I includes/
$(addprefix objs/, $(OBJS2)): $(addprefix srcs/, $(PRINTFSRC))
@test -d objs || mkdir objs
@printf "\033[0;35m.\033[0m"
@gcc $(FLAGS) -c $(addprefix srcs/, $(addsuffix .c, $(basename $(notdir $@)))) -o objs/$(notdir $@) -I includes/
main: a.out
@printf "\033[0;31m- Executing a.out -\n\033[0m"
@./a.out
@printf "\033[0;31m-- End of a.out --\n\033[0m"
a.out: $(NAME) main.c
@gcc -Wall -Wextra main.c -L. -lftprintf -I includes/
test: test.out
@printf "\033[0;31m- Executing test.out -\n\033[0m"
@./test.out $(ARGS)
@printf "\033[0;31m-- End of test.out --\n\033[0m"
test.out: $(NAME) test.c
@gcc -Wall -Wextra test.c -L. -lftprintf -I includes/ -o test.out
clean:
@rm -rdf objs/
fclean: clean
@rm -f $(NAME)
mainclean:
@rm -f a.out
testclean:
@rm -f test.out
cleanall: mainclean testclean fclean
re: fclean all