forked from Lobbyra/minishell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
199 lines (182 loc) · 8.31 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: jecaudal <jecaudal@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/06/15 13:51:51 by jecaudal #+# #+# #
# Updated: 2020/07/27 16:39:15 by jecaudal ### ########.fr #
# #
# **************************************************************************** #
NAME = minishell
HEADER = headers/
CFLAGS += -Werror -Wall -Wextra -I ./headers/
CC = gcc
SRCS_L_PRINTF = ./srcs/lib/simplified_printf/srcs/l_printf.c \
./srcs/lib/simplified_printf/srcs/pnf_apply_field.c \
./srcs/lib/simplified_printf/srcs/pnf_apply_prec.c \
./srcs/lib/simplified_printf/srcs/pnf_get_flags.c \
./srcs/lib/simplified_printf/srcs/pnf_get_info.c \
./srcs/lib/simplified_printf/srcs/pnf_get_raw.c \
./srcs/lib/simplified_printf/srcs/pnf_get_type.c \
./srcs/lib/simplified_printf/srcs/pnf_pass.c \
./srcs/lib/simplified_printf/additionnal_functions/l_atoi.c \
./srcs/lib/simplified_printf/additionnal_functions/l_free.c \
./srcs/lib/simplified_printf/additionnal_functions/l_itoa.c \
./srcs/lib/simplified_printf/additionnal_functions/l_itox.c \
./srcs/lib/simplified_printf/additionnal_functions/l_ptox.c \
./srcs/lib/simplified_printf/additionnal_functions/l_isnum.c \
./srcs/lib/simplified_printf/additionnal_functions/l_ispos.c \
./srcs/lib/simplified_printf/additionnal_functions/l_ctostr.c \
./srcs/lib/simplified_printf/additionnal_functions/l_isspace.c \
./srcs/lib/simplified_printf/additionnal_functions/l_memcpy_n.c \
./srcs/lib/simplified_printf/additionnal_functions/l_numlen.c \
./srcs/lib/simplified_printf/additionnal_functions/l_strcmp.c \
./srcs/lib/simplified_printf/additionnal_functions/l_putstr.c \
./srcs/lib/simplified_printf/additionnal_functions/l_strdup.c \
./srcs/lib/simplified_printf/additionnal_functions/l_strdup_n.c \
./srcs/lib/simplified_printf/additionnal_functions/l_strgen.c \
./srcs/lib/simplified_printf/additionnal_functions/l_strinject.c \
./srcs/lib/simplified_printf/additionnal_functions/l_strjoindel.c \
./srcs/lib/simplified_printf/additionnal_functions/l_strlen.c \
./srcs/lib/simplified_printf/additionnal_functions/l_strlen_n.c \
./srcs/lib/simplified_printf/additionnal_functions/l_strrev.c \
./srcs/lib/simplified_printf/additionnal_functions/l_ultoa_base.c \
./srcs/lib/simplified_printf/additionnal_functions/l_utoa.c
OBJS_L_PRINTF = $(SRCS_L_PRINTF:.c=.o)
SRCS_LIB = ./srcs/print_jobs.c \
./srcs/lib/ft_skip.c \
./srcs/lib/ft_atoi.c \
./srcs/lib/ft_split.c \
./srcs/lib/ft_isnum.c \
./srcs/lib/ft_putnbr.c \
./srcs/lib/ft_ctostr.c \
./srcs/lib/ft_putstr.c \
./srcs/lib/ft_strcmp.c \
./srcs/lib/ft_strdup.c \
./srcs/lib/ft_strlen.c \
./srcs/lib/ft_strlcpy.c \
./srcs/lib/ft_isspace.c \
./srcs/lib/ft_isalnum.c \
./srcs/lib/ft_strjoin.c \
./srcs/lib/ft_putchar.c \
./srcs/lib/ft_strncmp.c \
./srcs/lib/ft_basename.c \
./srcs/lib/ft_c_finder.c \
./srcs/lib/ft_fdcaster.c \
./srcs/lib/ft_freestrs.c \
./srcs/lib/ft_memcpy_n.c \
./srcs/lib/ft_strdup_n.c \
./srcs/lib/ft_strlen_n.c \
./srcs/lib/ft_strlen_c.c \
./srcs/lib/ft_close_fds.c \
./srcs/lib/ft_putnbr_fd.c \
./srcs/lib/ft_strarrdup.c \
./srcs/lib/ft_strarrlen.c \
./srcs/lib/ft_strdupdel.c \
./srcs/lib/ft_putarrstr.c \
./srcs/lib/ft_putstr_fd.c \
./srcs/lib/ft_sort_strs.c \
./srcs/lib/ft_putchar_fd.c \
./srcs/lib/ft_strarrfree.c \
./srcs/lib/ft_strcleaner.c \
./srcs/lib/ft_skip_until.c \
./srcs/lib/ft_strjoindel.c \
./srcs/lib/get_next_line.c \
./srcs/lib/ft_strdupdel_n.c \
./srcs/lib/ft_word_cutter.c \
./srcs/lib/ft_putarrstr_fd.c \
./srcs/lib/ft_putnbrarr_fd.c \
./srcs/lib/ft_strarrnuller.c \
./srcs/lib/ft_putarrarrstrs.c \
./srcs/lib/ft_get_this_word.c \
./srcs/lib/ft_addstr_to_strs.c \
./srcs/lib/ft_full_len_arrstr.c \
./srcs/lib/get_next_line_utils.c \
./srcs/lib/ft_protected_putarrstr_fd.c
OBJS_LIB = $(SRCS_LIB:.c=.o)
SRCS = ./srcs/main.c \
./srcs/reset.c \
./srcs/cut_cmd.c \
./srcs/find_exec.c \
./srcs/skip_part.c \
./srcs/init_stock.c \
./srcs/free_t_stock.c \
./srcs/print_prompt.c \
./srcs/is_cmd_closed.c \
./srcs/error_manager.c \
./srcs/wait_instruction.c \
./srcs/check_user_input.c \
./srcs/check_user_input_utils.c \
./srcs/parsing/env_var.c \
./srcs/parsing/ft_itoa.c \
./srcs/parsing/parsing.c \
./srcs/parsing/get_path.c \
./srcs/parsing/check_pipe.c \
./srcs/parsing/verif_exec.c \
./srcs/parsing/check_quote.c \
./srcs/parsing/ft_intarradd.c \
./srcs/parsing/find_env_var.c \
./srcs/parsing/env_var_utils.c \
./srcs/parsing/command_to_jobs.c \
./srcs/parsing/verif_exec_utils.c \
./srcs/parsing/check_double_pipe.c \
./srcs/parsing/free_get_path_exec.c \
./srcs/parsing/verif_metacharacter.c \
./srcs/parsing/check_end_backslash.c \
./srcs/parsing/command_to_jobs_utils.c \
./srcs/parsing/check_redirection_null.c \
./srcs/parsing/remove_and_replace_utils.c \
./srcs/parsing/verif_redirection_env_var.c \
./srcs/parsing/spend_if_multiple_dollars.c \
./srcs/parsing/check_exec_after_redirection.c \
./srcs/parsing/split_cmd/pass_word.c \
./srcs/parsing/split_cmd/split_cmd.c \
./srcs/parsing/split_cmd/is_escaped.c \
./srcs/parsing/split_cmd/pass_quote.c \
./srcs/parsing/split_cmd/pass_dquote.c \
./srcs/parsing/split_cmd/pass_spaces.c \
./srcs/parsing/split_cmd/is_sep_char.c \
./srcs/execution/execution.c \
./srcs/execution/init_pipes.c \
./srcs/execution/terminator.c \
./srcs/execution/redirector.c \
./srcs/execution/is_builtin.c \
./srcs/execution/close_pipes.c \
./srcs/execution/jobs_caller.c \
./srcs/execution/builtin_caller.c \
./srcs/execution/save_child_pid.c \
./srcs/execution/instance_builder.c \
./srcs/execution/redirectors_utils.c \
./srcs/execution/redirector_file_out.c \
./srcs/execution/redirector_file_in.c \
./srcs/execution/instance_builder_utils.c \
./srcs/execution/builtins/cd.c \
./srcs/execution/builtins/env.c \
./srcs/execution/builtins/pwd.c \
./srcs/execution/builtins/echo.c \
./srcs/execution/builtins/unset.c \
./srcs/execution/builtins/export.c \
./srcs/execution/builtins/ft_exit.c \
./srcs/execution/builtins/export_utils.c \
./srcs/execution/job_cleaner/pass_part.c \
./srcs/execution/job_cleaner/arg_cleaner.c \
./srcs/execution/job_cleaner/job_cleaner.c \
./srcs/execution/job_cleaner/part_len_quote.c \
./srcs/execution/job_cleaner/escaper_dquote.c \
./srcs/execution/job_cleaner/escaper_nquote.c \
./srcs/execution/job_cleaner/part_len_dquote.c \
./srcs/execution/job_cleaner/part_len_nquote.c
OBJS = $(SRCS:.c=.o)
all : $(NAME)
$(NAME) : $(OBJS_LIB) $(OBJS)
$(CC) -o $(NAME) $(OBJS_L_PRINTF) $(OBJS_LIB) $(OBJS)
f : $(OBJS_LIB) $(OBJS)
$(CC) -o $(NAME) $(OBJS_L_PRINTF) -fsanitize=address $(OBJS_LIB) $(OBJS)
clean :
rm -f $(OBJS_LIB) $(OBJS_L_PRINTF) $(OBJS)
fclean : clean
rm -f $(NAME)
@make fclean -C $(PATH_L_PRINTF)
re : fclean $(NAME)