-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (53 loc) · 1.89 KB
/
Makefile
File metadata and controls
67 lines (53 loc) · 1.89 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
NAME = minishell
CC = gcc
CCFLAGS = -Wall -Wextra -Werror -g
CCFLAGS_G = -Wall -Wextra -Werror -g
SANITIZER = -fsanitize=address
IREADLINE = -I/usr/local/opt/readline/include
LREADLINE = -L/usr/local/opt/readline/lib
# IREADLINE = -I/Users/jeekim/.brew/opt/readline/include
# LREADLINE = -L/Users/jeekim/.brew/opt/readline/lib
RM = rm -f
SRC_DIR = ./srcs/
SRC = main.c \
init/env_handler.c init/signal_handler.c \
tokenize/tokenize.c tokenize/tokenize_utils.c tokenize/tokenize_case1.c tokenize/tokenize_case2.c \
tree_structure/make_tree.c tree_structure/make_tree_redir_node.c \
parser/tree_parser.c parser/tree_parser_heredoc.c parser/delquote_expand.c parser/delquote_utils.c \
execute/execute.c execute/cmd_action.c execute/child_pipe.c execute/open_redir_file.c execute/path.c execute/execute_builtin.c\
utils/utils1.c utils/utils2.c utils/utils_cleaners.c utils/utils_system.c utils/utils_list.c utils/utils_envir_error.c\
utils/utils_atoi.c utils/utils_itoa.c utils/utils_split.c utils/utils_strjoin.c utils/utils_isalnum.c
BUILTIN_DIR = ./builtin_srcs/
BUILTIN = builtin_pwd.c \
builtin_cd.c \
builtin_echo.c \
builtin_env.c \
builtin_exit.c \
builtin_export.c \
builtin_unset.c
SRCS = $(addprefix $(SRC_DIR), $(SRC)) \
$(addprefix $(BUILTIN_DIR), $(BUILTIN))
BUILTIN_SRCS= $(addprefix $(BUILTIN_DIR), $(BUILTIN))
OBJS = $(SRCS:.c=.o)
ifdef WITH_BONUS
OBJECTS = $(OBJS_B)
else
OBJECTS = $(OBJS)
endif
all : $(NAME)
bonus :
make WITH_BONUS=1 all
.c.o :
$(CC) $(CCFLAGS_G) $(IREADLINE) -c -o $@ $<
$(NAME) : $(OBJS)
$(CC) $(OBJS) $(CCFLAGS) $(LREADLINE) -lreadline -o $(NAME)
clean :
$(RM) $(OBJS)
fclean : clean
$(RM) $(NAME)
lldb: all
gcc $(OBJS) $(CCFLAGS_G) $(LREADLINE) -lreadline -o $(NAME)
sani: $(OBJS)
$(CC) $(OBJS) $(CCFLAGS) $(SANITIZER) $(LREADLINE) -lreadline -o $(NAME)
re : fclean all
.PHONY : all bonus clean fclean re