-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
76 lines (64 loc) · 2.07 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
NAME = minishell
CC = gcc
RM = rm -f
FLAGS = -Wall -Wextra -Werror #-g -fsanitize=address
LIBFTDIR = includes/libft
LIBFT_OBJ = includes/libft/includes/obj
OBJ_DIR = obj/
READLINE_PATH = /Home/.local/Homebrew/opt/readline
CFLAGS = -I$(READLINE_PATH)/include
LDFLAGS = -L$(READLINE_PATH)/lib -lreadline
SRC_1 = srcs/minishell.c \
SRC_2 = srcs/builtins/built_external.c \
srcs/builtins/export_unset_built.c \
srcs/builtins/out_cd_built.c \
srcs/builtins/out_cd_built_bis.c \
srcs/builtins/builtins_utils.c \
srcs/builtins/export_unset_bis.c \
srcs/builtins/builtins_base.c \
srcs/errors/errors_operators.c \
srcs/errors/errors.c \
srcs/parsing/verify_operators.c \
srcs/parsing/token_value.c \
srcs/parsing/redirect_quote.c \
srcs/parsing/quote.c \
srcs/parsing/delete_quote.c \
srcs/parsing/var_env.c \
srcs/parsing/var_env_bis.c \
srcs/signals/signals.c \
srcs/signals/signals_handle.c \
srcs/signals/signals_heredoc.c \
srcs/utils/free_utils.c srcs/utils/init_list.c srcs/utils/list_utils.c \
srcs/utils/function_utils.c srcs/utils/execution_utils2.c \
srcs/utils/execution_utils.c srcs/execution/execution.c \
srcs/execution/sub_exec.c srcs/execution/single_execution.c \
srcs/redirections/redirection.c srcs/redirections/here_doc.c \
srcs/utils/execution_utils3.c srcs/errors/free.c \
srcs/utils/builtins_utils.c srcs/redirections/here_doc_bis.c \
srcs/redirections/redirection_utils.c \
srcs/utils/single_exec_utils.c
OBJ_1 = $(patsubst %.c,$(OBJ_DIR)%.o,$(SRC_1))
OBJ_2 = $(patsubst %.c,$(OBJ_DIR)%.o,$(SRC_2))
$(OBJ_DIR)%.o: %.c
mkdir -p $(@D)
$(CC) $(FLAGS) $(CFLAGS) -c $< -o $@
INCLUDE = -L $(LIBFTDIR) -lft -lreadline
.c.o:
$(CC) $(FLAGS) $(CFLAGS) -c $< -o $@
${NAME}: ${OBJ_1} ${OBJ_2}
make -C $(LIBFTDIR)
@${CC} ${FLAGS} ${CFLAGS} ${LDFLAGS} ${OBJ_1} ${OBJ_2} -o ${NAME} ${INCLUDE}
all: ${NAME}
clean:
${RM} ${OBJ_1} ${OBJ_2}
make -C $(LIBFTDIR) clean
rm -rf ${LIBFT_OBJ}
rm -rf ${OBJ_DIR}
rm -rf ${OBJ_1} ${OBJ_2}
fclean: clean
make -C $(LIBFTDIR) fclean
${RM} ${NAME}
rm -rf ${OBJ_DIR}
rm -rf ${LIBFT_OBJ}
re: fclean all
.PHONY: all clean fclean re