-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
146 lines (130 loc) · 4.2 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
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
##
## EPITECH PROJECT, 2019
## my_printf
## File description:
## Makefile
##
CC = c99
SRC = $(addprefix $(SRC_D), $(SRC_F))
OBJ = $(SRC:.c=.o)
SRC_D = lib/my/
SRC_F = my_get_converter.c \
my_get_length_modifier.c \
my_get_width_field.c \
my_get_precision.c \
my_get_flag.c \
my_get_formatted_output.c \
my_intlen.c \
my_putchar.c \
my_puterr.c \
my_putstr.c \
my_revstr.c \
my_strcat.c \
my_strcmp.c \
my_strcpy.c \
my_strdup.c \
my_strlen.c \
my_strstr.c \
my_strnum_to_uint.c \
my_printf.c \
booleans/my_is_converter.c \
booleans/my_is_digit.c \
booleans/my_is_flag.c \
booleans/my_is_int_converter.c \
booleans/my_is_int_signed_converter.c \
booleans/my_is_int_unsigned_converter.c \
booleans/my_is_printable.c \
booleans/my_str_isnum_neg.c \
booleans/my_str_isnum_pos.c \
booleans/my_str_isnum.c \
converters/my_arg_to_str.c \
converters/my_char_to_octal.c \
converters/my_char_to_str.c \
converters/my_decimal_to_binary.c \
converters/my_decimal_to_hexa_lower.c \
converters/my_decimal_to_hexa_upper.c \
converters/my_decimal_to_octal.c \
converters/my_int_to_strnum.c \
converters/my_np_to_str.c \
converters/my_ptr_to_hexa_lower.c \
converters/my_ptr_to_hexa_upper.c \
converters/my_uint_to_strnum.c \
flags/my_hash_flag_convertion.c \
flags/my_minus_flag_convertion.c \
flags/my_plus_flag_convertion.c \
flags/my_space_flag_convertion.c \
flags/my_zero_flag_convertion.c \
length_modifiers/my_llint_to_strnum.c \
length_modifiers/my_lluint_to_strnum.c \
length_modifiers/my_lluint_to_octal.c \
length_modifiers/my_lluint_to_hexa_lower.c \
length_modifiers/my_lluint_to_hexa_upper.c \
SRC_UT = $(addprefix $(SRC_UT_D), $(SRC_UT_F))
OBJ_UT = $(SRC_UT:.c=.o)
SRC_UT_D = tests/
SRC_UT_F = test_my_intlen.c \
test_my_char_to_octal.c \
test_my_printf_special_cases.c \
test_my_strcat.c \
test_my_puterr.c \
test_my_get_flag.c \
test_my_strnum_to_uint.c \
booleans/test_my_is_printable.c \
booleans/test_my_is_converter.c \
booleans/test_my_is_flag.c \
booleans/test_my_is_int_converter.c \
booleans/test_my_is_int_signed_converter.c \
booleans/test_my_is_int_unsigned_converter.c \
booleans/test_my_str_isnum.c \
booleans/test_my_str_isnum_neg.c \
booleans/test_my_str_isnum_pos.c \
converters/test_my_arg_to_str.c \
converters/test_my_char_to_str.c \
converters/test_my_decimal_to_binary.c \
converters/test_my_decimal_to_hexa_lower.c \
converters/test_my_decimal_to_hexa_upper.c \
converters/test_my_decimal_to_octal.c \
converters/test_my_int_to_strnum.c \
converters/test_my_np_to_str.c \
converters/test_my_percentage_to_str.c \
converters/test_my_ptr_to_hexa_lower.c \
converters/test_my_ptr_to_hexa_upper.c \
converters/test_my_uint_to_strnum.c \
flags/test_my_hash_flag_convertion.c \
flags/test_my_plus_flag_convertion.c \
flags/test_my_space_flag_convertion.c \
flags/test_my_minus_flag_convertion.c \
length_modifiers/test_my_h_length_modifier.c \
length_modifiers/test_my_hh_length_modifier.c \
length_modifiers/test_my_l_length_modifier.c \
length_modifiers/test_my_ll_length_modifier.c \
INC = -I./include/
CFLAGS = -W -Wall -Wextra -Werror $(INC)
LDFLAGS_UT = -lcriterion -lgcov --coverage
DBFLAGS = -g -g3 -ggdb
NAME = libmy.a
NAME_UT = unit_tests
all: $(NAME)
$(NAME): $(OBJ)
@echo -e "\e[1;32mCompiling library $(NAME)... \e[0m"
ar rc $(NAME) $(OBJ)
cp $(NAME) ./lib
tests_run: clean $(OBJ) $(OBJ_UT)
@echo -e "\e[1;32mCompiling $(NAME_UT) binary... \e[0m"
$(CC) -o $(NAME_UT) $(SRC) $(SRC_UT) $(CFLAGS) $(LDFLAGS_UT)
@./$(NAME_UT)
@rm -f $(SRC_UT_F:.c=.gcda)
@rm -f $(SRC_UT_F:.c=.gcno)
clean:
@echo -e "\e[1;32mRemoving source object files...\e[0m"
rm -f $(OBJ)
@echo -e "\e[1;32mRemoving unit_tests object files... \e[0m"
rm -f $(OBJ_UT)
@echo -e "\e[1;32mRemoving coverage files...\e[0m"
rm -f *.gc*
fclean: clean
@echo -e "\e[1;32mRemoving $(NAME) binary...\e[0m"
rm -f $(NAME)
@echo -e "\e[1;32mRemoving $(NAME_UT) binary... \e[0m"
rm -f $(NAME_UT)
re: fclean all