-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
206 lines (182 loc) · 3.79 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
##
## EPITECH PROJECT, 2023
## make file
## File description:
## makes stuff
##
SRC = $(addprefix src/,\
main.c \
$(addprefix env_handler/,\
insert_in_env.c \
search_in_env.c \
get_env_array.c \
insert_int_in_env.c \
get_formated_value.c \
) \
$(addprefix error_handling/,\
check_arguments.c \
) \
$(addprefix free/,\
free_env.c \
free_array.c \
) \
$(addprefix parser/,\
checkers.c \
file_redirections.c \
ll_decoder.c \
ll_parser.c \
symbols_handling.c \
request_input.c \
) \
$(addprefix shell/,\
$(addprefix signal/,\
signal_handler.c \
handle_sigint.c \
handle_sigtstp.c \
) \
$(addprefix init/,\
$(addprefix own_env_init/,\
init_host.c \
init_own_env.c \
init_user.c \
init_shlvl.c \
init_vendor.c \
init_pwd.c \
init_prompt_colors.c \
) \
init_env.c \
) \
$(addprefix string_formating/,\
format_arguments.c \
clear_special.c \
array_concat.c \
replace_aliases.c \
star_formating.c \
) \
$(addprefix autocompletion/,\
auto_complete.c \
auto_complete_dir.c \
auto_complete_cmd.c \
completion_print.c \
completion_utils.c \
) \
$(addprefix termios/,\
$(addprefix lib_vector/,\
vector_add.c \
vector_delete.c \
vector_free.c \
vector_init.c \
vector_resize.c \
vector_set.c \
vector_total.c \
vector_push.c \
vector_normal.c \
check_free.c \
) \
exit_handle.c \
arrow_handle.c \
clear_terminal.c \
clear_line.c \
key_del.c \
key_down.c \
key_left.c \
key_right.c \
key_up.c \
key_tab.c \
termios.c \
print_input_line.c \
) \
$(addprefix execute/,\
$(addprefix built_in/,\
change_directory.c \
set_env.c \
set_variable.c \
unset_env.c \
display_env.c \
exit.c \
set_alias.c \
unset_alias.c \
append_to_variable.c \
camille_fetch.c \
$(addprefix fetch/,\
fetch_command.c \
fetch_hardware.c \
fetch_usr_info.c \
fetch_window_info.c \
fetch_memory.c \
) \
$(addprefix history/,\
create_history.c \
command_history.c \
display_history.c \
) \
) \
default.c \
execute_command.c \
find.c \
execute_file.c \
last_return.c \
try_execute.c \
execute_rc.c \
) \
start_shell.c \
) \
$(addprefix print/,\
print_prompt.c \
) \
$(addprefix side_functions/,\
int_to_str.c \
my_arraydup.c \
my_arraylen.c \
my_strcat.c \
is_string_in_array.c \
my_getchar.c \
) \
) \
SRC_TEST = $(addprefix tests/,\
env_testing.c \
redirect.c \
side_tests.c \
autocomplete_testing.c \
vector.c \
parser_testing.c \
built_in_tests.c \
possibility_testing.c \
string_formating.c \
) \
SRC_TO_TEST = $(filter-out src/main.c, $(SRC))
CPPFLAGS = -iquote./include
CFLAGS += -Wall -Wextra
TEST_FLAGS = --coverage
TEST_LIB = -lcriterion
CC ?= gcc
OBJ = $(SRC:.c=.o)
OBJ_TEST = $(SRC_TEST:.c=.o)
NAME = 42sh
TEST_NAME = unit_tests
all: $(NAME)
$(NAME): $(OBJ)
$(CC) -o $(NAME) $(OBJ) $(CFLAGS)
clean:
$(RM) $(OBJ)
fclean: clean tests_clean
$(RM) $(NAME)
re: fclean all
debug: CFLAGS += -ggdb3
debug: re
asan: CC = clang -fsanitize=address
asan: re
$(TEST_NAME): $(OBJ_TEST)
$(CC) -o $(TEST_NAME) $(CFLAGS) $(CPPFLAGS) \
$(OBJ_TEST) $(SRC_TO_TEST) \
$(TEST_FLAGS) $(TEST_LIB)
tests_run: $(TEST_NAME)
./$(TEST_NAME)
tests_clean:
$(RM) *.gcda
$(RM) *.gcno
$(RM) coverage*
$(RM) unit_tests
coverage:
gcovr --html-details coverage && firefox coverage
.PHONY: all clean fclean re debug tests_run coverage tests_clean asan