-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
119 lines (105 loc) · 2.62 KB
/
Makefile
File metadata and controls
119 lines (105 loc) · 2.62 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
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
NAME = minishell
CC = cc -g -fsanitize=address
# CFLAGS = -g3 -fsanitize=address
# export LDFLAGS="-L/usr/local/opt/readline/lib" 실행파일 만들때
# export CPPFLAGS="-I/usr/local/opt/readline/include" 인클루드 목적파일 만들때
# -lreadline -I/usr/local/Cellar/readline/8.1.2/include -L/usr/local/Cellar/readline/8.1.2/lib
# RL_LINK = -L/usr/local/opt/readline/lib -lreadline
# RL_INCLUDE = -I/usr/local/opt/readline/include
RL_LINK = -L/opt/homebrew/opt/readline/lib -lreadline
RL_INCLUDE = -I/opt/homebrew/opt/readline/include
RM = rm -f
BUILTIN_FILE_DIR = ./built_in/
SRC_DIR = ./sources/
FILES = execute_builtin.c \
execute_command.c \
execute_connect.c\
execute_do_redirection.c \
execute_get_redir_fd.c \
execute_nonbuiltin.c \
execute_pipe.c\
execute_simple.c \
execute_subshell.c \
execute_utils.c \
exit.c \
expand_no_variable.c \
expand_nosplit.c \
expand_string.c \
expand_substitute.c \
expand_variable.c \
expansion_filename.c \
expansion_match.c \
expansion_one_node.c \
expansion_word_list.c \
expansion.c \
get_next_line_utils.c \
get_next_line.c \
goto_func1.c \
goto_func2.c \
goto_func3.c \
goto_state.c \
heredoc.c \
init_all.c \
lex_func1.c \
lex_func2.c \
lex_func3.c \
lex_func4.c \
list_envp.c \
list_envp2.c \
list_heredoc.c \
list_stack.c \
list_stack2.c \
list_token.c \
list_trans.c \
list.c \
list2.c \
main.c \
make_redir.c \
parser.c \
parsing.c \
process_line.c \
readline.c \
reduce_func1.c \
reduce_func2.c \
reduce_func3.c \
reduce_func4.c \
reduce_make.c \
reduce_utils.c \
run_lexer.c \
run_parser.c \
signal_hadler.c\
test.c \
utils_fd.c \
utils_itoa.c \
utils_split.c \
utils_string.c
BUILTIN_FILE = ft_cd_utils.c\
ft_cd_utils2.c\
ft_cd.c\
ft_echo.c \
ft_env.c \
ft_exit.c \
ft_export_envp.c \
ft_export_utils.c \
ft_export.c \
ft_unset.c \
ft_pwd.c \
ft_unset.c
SRCS = $(addprefix $(SRC_DIR), $(FILES)) \
$(addprefix $(BUILTIN_FILE_DIR), $(BUILTIN_FILE))
OBJS = $(SRCS:%.c=%.o)
.PHONY: all clean fclean re
all: $(NAME)
%.o: %.c
$(CC) $(CFLAGS) $(RL_INCLUDE) -c $< -o $@
$(NAME): $(OBJS)
$(CC) $(RL_LINK) -o $@ $^
debug: ${SRCS}
gcc -g3 -fsanitize=address ${SRCS} -o main
clean:
$(RM) $(OBJS)
fclean: clean
$(RM) $(NAME)
re:
make fclean
make all