-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
100 lines (85 loc) · 2.76 KB
/
Copy pathMakefile
File metadata and controls
100 lines (85 loc) · 2.76 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
NAME = minishell
MINISHELL_DIR = ./srcs
MINISHELL_HEAD = ./include
MAIN_DIR = ./main
PARSER_DIR = ./parser
BUILTIN_DIR = ./builtin
SIGNAL_DIR = ./signal
EXECUTOR_DIR = ./executor
UTILS_DIR = ./utils
SRCS = $(MAIN_DIR)/main.c \
$(MAIN_DIR)/init_shell.c \
$(MAIN_DIR)/init_env.c \
$(MAIN_DIR)/init_env_utils_1.c \
$(MAIN_DIR)/init_env_utils_2.c \
$(MAIN_DIR)/history.c \
$(MAIN_DIR)/ft_getenv.c \
$(PARSER_DIR)/parser.c \
$(PARSER_DIR)/parser_utils_1.c \
$(PARSER_DIR)/parser_utils_2.c \
$(PARSER_DIR)/parser_list_utils.c \
$(PARSER_DIR)/parser_polish_list.c \
$(PARSER_DIR)/parser_polish_list_utils.c \
$(PARSER_DIR)/parser_env.c \
$(PARSER_DIR)/parser_env_utils.c \
$(PARSER_DIR)/parser_cmd.c \
$(PARSER_DIR)/parser_cmd_utils.c \
$(PARSER_DIR)/parser_cmd_redir.c \
$(PARSER_DIR)/parser_cmd_redir_utils.c \
$(PARSER_DIR)/parser_cmd_list.c \
$(PARSER_DIR)/parser_heredoc.c \
$(PARSER_DIR)/parser_heredoc_utils.c \
$(SIGNAL_DIR)/signal.c \
$(SIGNAL_DIR)/signal_executor.c \
$(SIGNAL_DIR)/signal_sigint_heredoc.c \
$(BUILTIN_DIR)/builtin.c \
$(BUILTIN_DIR)/builtin_export.c \
$(BUILTIN_DIR)/builtin_export_utils_1.c \
$(BUILTIN_DIR)/builtin_export_utils_2.c \
$(BUILTIN_DIR)/builtin_export_print.c \
$(BUILTIN_DIR)/builtin_export_print_utils.c \
$(BUILTIN_DIR)/builtin_env.c \
$(BUILTIN_DIR)/builtin_unset.c \
$(BUILTIN_DIR)/builtin_unset_utils.c \
$(BUILTIN_DIR)/builtin_echo.c \
$(BUILTIN_DIR)/builtin_pwd.c \
$(BUILTIN_DIR)/builtin_exit.c \
$(BUILTIN_DIR)/builtin_cd.c \
$(BUILTIN_DIR)/builtin_cd_utils.c \
$(EXECUTOR_DIR)/executor.c \
$(EXECUTOR_DIR)/executor_redir.c \
$(EXECUTOR_DIR)/executor_redir_utils.c \
$(EXECUTOR_DIR)/executor_process.c \
$(EXECUTOR_DIR)/executor_command.c \
$(EXECUTOR_DIR)/executor_command_utils.c \
$(UTILS_DIR)/main.c \
$(UTILS_DIR)/matrix.c \
$(UTILS_DIR)/arg.c \
$(UTILS_DIR)/cmd.c \
$(UTILS_DIR)/redir.c \
$(UTILS_DIR)/env.c \
OBJS = $(patsubst %.c, $(MINISHELL_DIR)/%.o, $(SRCS))
LIBFT_DIR = ./libft
LIBFT = libft.a
CC = gcc
CFLAGS = -Wall -Wextra -Werror
RM = rm -f
# Include directory for header files
INC = -I$(MINISHELL_HEAD) -I$(LIBFT_DIR)
# Compilation rule for the program
$(NAME): $(OBJS)
$(MAKE) -C $(LIBFT_DIR)
$(CC) $(CFLAGS) $(OBJS) -L$(LIBFT_DIR) -lft -lreadline -o $(NAME)
# Rule to compile object files
%.o: %.c
$(CC) -c $< $(CFLAGS) -o $@ $(INC)
all: $(NAME)
clean:
$(RM) $(OBJS)
$(MAKE) -C $(LIBFT_DIR) clean
fclean:
$(RM) $(OBJS)
$(RM) $(NAME)
$(MAKE) -C $(LIBFT_DIR) fclean
re: fclean all
.PHONY: all clean fclean re