-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (47 loc) · 2.03 KB
/
Makefile
File metadata and controls
57 lines (47 loc) · 2.03 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
NAME = minishell
CC = cc
ifneq ($(CI),)
CFLAGS = -Wall -Wextra -Werror -g
else
CFLAGS = -Wall -Wextra -Werror -fsanitize=address -g
endif
ifneq ($(CI),)
LDFLAGS = -lreadline
else
LDFLAGS = -lreadline -fsanitize=address
endif
SRCDIR = .
OBJDIR = .objs
SRCS = main.c Utils/checker.c Utils/libft_utils1.c Utils/libft_utils2.c Utils/ft_split.c Utils/libft_utils3.c \
Utils/libft_utils4.c Utils/libft_utils5.c Utils/libft_utils6.c Utils/libft_utils7.c \
Lexer/creating_word1.c Lexer/creating_word2.c Lexer/syntax_check.c \
Lexer/init.c Lexer/number_of_words1.c Lexer/number_of_words2.c Lexer/number_of_words3.c \
Errors_Frees/error.c Errors_Frees/error2.c Errors_Frees/free.c Errors_Frees/failure1.c \
Errors_Frees/failure2.c Errors_Frees/free2.c Errors_Frees/free3.c \
Parser/parser.c Parser/creating_cmd_table1.c Parser/creating_cmd_table2.c Parser/quotes_removal.c \
Parser/pipes.c Parser/pipes2.c Parser/infile.c Parser/outfile.c Parser/append_out.c Parser/parser2.c \
Parser/heredoc.c Parser/heredoc2.c Parser/heredoc3.c Parser/heredoc4.c Parser/parser3.c Parser/parser4.c \
Parser/heredoc5.c Parser/new_lexer.c Parser/creating_cmd_table3.c Parser/heredoc6.c \
Sig/sig.c Sig/sig2.c \
Env/init_env.c \
Executor/executor.c Executor/executor2.c \
Builtins/cd.c Builtins/echo.c Builtins/exit.c Builtins/cd_export.c Builtins/export2.c Builtins/unset.c \
Builtins/pwd.c Builtins/env.c Builtins/export3.c Builtins/unset2.c Builtins/exit_error_m.c \
Expander/expander.c Expander/expander2.c Expander/expander3.c Expander/init_node.c Expander/init_node2.c \
Expander/init_node3.c Expander/expander4.c \
Lexer/syntax_check2.c Builtins/cd2.c Builtins/cd3.c \
OBJS = $(SRCS:%.c=$(OBJDIR)/%.o)
all : $(NAME)
$(NAME): $(OBJS)
@$(CC) $(FLAGS) $(OBJS) -o $(NAME) $(LDFLAGS)
$(OBJDIR)/%.o: %.c | $(OBJDIR)
@mkdir -p $(dir $@)
@$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR):
@mkdir -p $(OBJDIR)
clean :
@rm -f $(OBJS)
@rm -rf $(OBJDIR)
fclean: clean
@rm -f $(NAME)
re: fclean all