forked from tamagoyakii/minishell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
83 lines (69 loc) · 1.68 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
NAME = minishell
EXECUTE_DIR = ./srcs/execute
PARSE_DIR = ./srcs/parse
UTILS_DIR = ./srcs/utils
INCLUDES = ./includes
# RD_INCLUDE = -I/usr/local/opt/readline/include
RD_INCLUDE = -I/opt/homebrew/Cellar/readline/8.1.2/include
# RD_LIB = -L/usr/local/opt/readline/lib
RD_LIB = -L/opt/homebrew/Cellar/readline/8.1.2/lib
EXECUTE_SRCS = builtin.c \
builtin_cd.c \
builtin_echo.c \
builtin_env.c \
builtin_exit.c \
builtin_export.c \
builtin_pwd.c \
builtin_unset.c \
path.c \
pipe.c \
redir.c \
execute.c \
hdoc.c \
run_fork.c \
init_execute.c \
open.c
PARSE_SRCS = parse.c \
create_dummies.c \
create_tokens.c \
create_tokens_2.c \
create_argvs.c \
create_argvs_2.c \
replace_env.c \
replace_env_2.c
UTILS_SRCS = alloc.c \
check.c \
env1.c \
env2.c \
error.c \
signal.c \
t_argv.c \
t_list.c \
t_redir.c
SRCS := ${addprefix ${EXECUTE_DIR}/, ${EXECUTE_SRCS}} \
${addprefix ${PARSE_DIR}/, ${PARSE_SRCS}} \
${addprefix ${UTILS_DIR}/, ${UTILS_SRCS}} \
./srcs/main.c
libft = ./libs/libft/libft.a
OBJS = $(SRCS:.c=.o)
CFLAGS = -Wall -Wextra -Werror
all : $(NAME)
%.o : %.c
@cc $(CFLAGS) -c -o $@ $< -I $(INCLUDES) $(RD_INCLUDE)
$(NAME) : $(OBJS)
@make -C ./libs/libft
@cc $(CFLAGS) $(RD_INCLUDE) $(RD_LIB) -o $@ $^ $(libft) -lreadline
@echo "🙋♀️🙋♂️ make"
# @echo "💧⛽️🧼 make"
clean :
@make -C ./libs/libft clean
@rm -f $(OBJS)
@echo "🙋♀️🙋♂️ clean"
# @echo "💧⛽️🧼 clean"
fclean : clean
@make -C ./libs/libft fclean
@rm -f $(NAME)
@echo "🙋♀️🙋♂️ fclean"
# @echo "💧⛽️🧼 fclean"
re : fclean all
.PHONY : clean fclean re all