-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
97 lines (77 loc) · 2.42 KB
/
Makefile
File metadata and controls
97 lines (77 loc) · 2.42 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: hyunjcho <hyunjcho@student.42seoul.> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/06/14 12:10:20 by hyunjcho #+# #+# #
# Updated: 2022/06/14 12:10:21 by hyunjcho ### ########.fr #
# #
# **************************************************************************** #
NAME = minishell
INCLUDE_DIR = ./includes/
RM = rm -rf
LIBFT = ./libft/libft.a
FLAG = -Wall -Wextra -Werror -I $(INCLUDE_DIR)
COMPILE_FLAG = -I/goinfre/hyunjcho/homebrew/opt/readline/include
LINK_FLAG = -lreadline -L/goinfre/hyunjcho/homebrew/opt/readline/lib
SRCS_DIR = ./srcs/
SRCS = main.c \
init/init_env.c \
init/init.c \
signal/signal.c \
parse/tokenize.c \
parse/tokenlist.c \
parse/make_token.c \
parse/ast.c \
parse/astnode.c \
parse/env_substitution.c \
parse/quote.c \
parse/syntaxcheck.c \
parse/ast_merge.c \
parse/pipelinelist.c \
redirect/redirect_process.c \
redirect/here_doc.c \
redirect/dup_file.c \
builtins/mini_echo.c \
builtins/mini_cd.c \
builtins/mini_pwd.c \
builtins/mini_export.c \
builtins/mini_unset.c \
builtins/mini_env.c \
builtins/mini_exit.c \
execute/execute.c \
execute/builtin.c \
execute/execve.c \
execute/fork.c \
utils/setattr.c \
utils/env_utils.c \
utils/utils.c \
utils/free.c \
utils/all_free.c \
utils/art.c \
utils/get_next_line.c
MAN_SRCS = $(addprefix $(SRCS_DIR), $(SRCS))
MAN_OBJS = $(MAN_SRCS:.c=.o)
vpath %.c $(SRCS_DIR)
all: $(LIBFT) $(NAME)
%.o: %.c
$(CC) $(FLAG) $(COMPILE_FLAG) -c $< -o $@
$(NAME): $(MAN_OBJS)
@$(CC) $(FLAG) $(COMPILE_FLAG) $(LINK_FLAG) $(LIBFT) -o $@ $(MAN_OBJS)
@echo "making minishell"
$(LIBFT):
@make -C ./libft
clean:
@$(RM) $(MAN_OBJS)
@make clean -C ./libft
@echo "cleaning"
fclean: clean
@$(RM) $(NAME)
@make fclean -C ./libft
@echo "fcleaning"
re:
make fclean
make all
.PHONY: all re clean fclean