-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
118 lines (103 loc) · 3.91 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: jjesberg <[email protected]. +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/09/08 15:37:00 by rmazurit #+# #+# #
# Updated: 2022/10/15 21:50:43 by jjesberg ### ########.fr #
# #
# **************************************************************************** #
NAME = minishell
CC = cc
RM = rm -f
FLAGS = -Wall -Wextra -Werror
SRC = src/main.c \
src/initializer/main_init.c \
src/initializer/envp_init.c \
src/initializer/builtins_init.c \
src/initializer/fd_init.c \
src/initializer/data_containers_init.c \
src/destructor.c \
src/builtins/env.c \
src/builtins/cd.c \
src/builtins/cd_utils.c \
src/builtins/change_pwd_utils.c \
src/builtins/echo.c \
src/builtins/mini_exit.c \
src/builtins/export.c \
src/builtins/export_utils.c \
src/builtins/pwd.c \
src/builtins/unset.c \
src/history_tracker.c \
src/lexer/lexer.c \
src/lexer/tokenizer.c \
src/lexer/single_quotes_handler.c \
src/lexer/redirections_handler.c \
src/lexer/double_quotes_handler.c \
src/message_printer.c \
src/lexer/words_handler.c \
src/lexer/expander/expansion_handler.c \
src/lexer/expander/expansion_rules.c \
src/parser/token_merger.c \
src/parser/parser.c \
src/parser/parsing_checker.c \
src/parser/redirecter/redirecter.c \
src/parser/redirecter/fd_closer.c \
src/parser/redirecter/heredoc_creater.c \
src/parser/redirecter/fd_opener.c \
src/executer/executer.c \
src/executer/raw_cmd_extractor.c \
src/executer/rel_abs_path_cmd_extractor.c \
src/pipex/pipe_processor.c \
src/pipex/cmd_exec_redirecter.c \
src/pipex/fd_dupper.c \
src/signals/signals.c \
TOOLS_SRC = src/tools/ft_calloc.c \
src/tools/ft_bzero.c \
src/tools/ft_new_envp.c \
src/tools/ft_new_token.c \
src/tools/ft_add_envp_back.c \
src/tools/ft_lstclear.c \
src/tools/ft_lstsize.c \
src/tools/ft_strdup.c \
src/tools/ft_strlen.c \
src/tools/ft_strcmp.c \
src/tools/ft_join_char.c \
src/tools/ft_strtrim.c \
src/tools/ft_add_token_back.c \
src/tools/ft_itoa.c \
src/tools/ft_atoi.c \
src/tools/ft_split.c \
src/tools/ft_strjoin.c \
src/tools/ft_haschar.c \
src/tools/ft_get_builtin.c \
src/tools/ft_cleansplit.c \
src/tools/ft_print_list.c \
src/tools/ft_splitlen.c \
src/tools/ft_isnumber.c \
src/tools/ft_isdigit.c \
src/tools/ft_getenvp.c \
src/tools/ft_isprint.c \
src/tools/ft_del_first_token.c \
src/tools/ft_get_num_cmds.c \
src/tools/ft_isalpha.c \
src/tools/ft_check_plus.c \
src/tools/ft_join_tilde.c \
src/tools/ft_count_word_tokens.c \
OBJ = ${SRC:.c=.o}
TOOLS_OBJ = ${TOOLS_SRC:.c=.o}
INCREADH = -I /Users/$(USER)/.brew/opt/readline/include
INCREADL = -lreadline -L /Users/$(USER)/.brew/opt/readline/lib
.c.o:
${CC} ${FLAGS} ${INCREADH} -c $< -o ${<:.c=.o}
$(NAME): $(OBJ) $(TOOLS_OBJ)
${CC} ${FLAGS} ${OBJ} ${TOOLS_OBJ} ${INCREADL} -o ${NAME}
all: $(NAME)
clean:
rm -f ${OBJ} ${TOOLS_OBJ}
fclean:
rm -f ${OBJ} ${TOOLS_OBJ} ${NAME}
re: fclean all
.PHONY: all clean fclean re