-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
78 lines (66 loc) · 2.17 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: dselmy <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/08/27 21:46:39 by dselmy #+# #+# #
# Updated: 2022/02/06 15:33:26 by dselmy ### ########.fr #
# #
# **************************************************************************** #
NAME = minishell
INC_DIR = ./includes/
BUILDINS_DIR = ./buildins/
LIBFT_DIR = ./libft/
RL_DIR = ./readline/8.1.1/lib/
SRCS = engine.c \
exec.c \
expand_env_var.c \
init_struct.c \
main.c \
manage_redirect.c \
parse_token.c \
parser.c \
redirect_fds.c \
shutdown.c \
signals.c \
utils_exec.c \
utils_new_token.c \
utils_open_files.c \
utils_parse_token.c \
utils_parser.c \
utils_parser_checks.c \
utils_shutdown_close.c \
utils_shutdown_free.c \
utils_shutdown_message.c \
$(BUILDINS_DIR)cd.c \
$(BUILDINS_DIR)echo.c \
$(BUILDINS_DIR)env.c \
$(BUILDINS_DIR)env_proc.c \
$(BUILDINS_DIR)env_proc_utils.c \
$(BUILDINS_DIR)exit.c \
$(BUILDINS_DIR)exit_utils.c \
$(BUILDINS_DIR)export.c \
$(BUILDINS_DIR)export_utils.c \
$(BUILDINS_DIR)pwd.c \
$(BUILDINS_DIR)unset.c
OBJ = $(SRCS:.c=.o)
DEP = $(SRCS:.c=.d)
CFLAGS = -Wall -Werror -Wextra
all: $(NAME)
$(NAME): $(OBJ)
@make -C $(LIBFT_DIR)
gcc -o $(NAME) $(CFLAGS) -I$(BUILDINS_DIR) -I$(INC_DIR) $(OBJ) \
$(LIBFT_DIR)libft.a -L$(RL_DIR) -lreadline
%.o: %.c
gcc -c $(CFLAGS) -I$(BUILDINS_DIR) -I$(INC_DIR) $< -o $@ -MD
clean:
@make clean -C $(LIBFT_DIR)
rm -f $(OBJ) $(DEP)
fclean: clean
@make fclean -C $(LIBFT_DIR)
rm -f $(NAME)
re: fclean all
include $(wildcard $(DEP))
.PHONY: all clean fclean re