-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
85 lines (75 loc) · 2.44 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
84
85
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: agiguair <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/02/07 13:57:55 by agiguair #+# #+# #
# Updated: 2023/05/08 16:03:52 by agiguair ### ########.fr #
# #
# **************************************************************************** #
NAME = minishell
CC = cc
FLAG = -Wall -Wextra -Werror -g3
LIBFT_PATH = ./sources/libft/
LIBFT_FILE = libft.a
LIBFT_LIB = $(addprefix $(LIBFT_PATH), $(LIBFT_FILE))
SRC_DIR = ./sources/
INC_DIR = ./includes/
SRC = $(addprefix $(SRC_DIR),$(C_FILE))
OBJ = $(SRC:.c=.o)
C_FILE = minishell.c\
minishell2.c\
builtins/builtins.c\
builtins/env.c\
builtins/pwd.c\
builtins/echo.c\
builtins/cd.c\
builtins/export.c\
builtins/export2.c\
builtins/export3.c\
builtins/exportsansopt.c\
builtins/exportsansotp2.c\
builtins/unset.c\
builtins/unset2.c\
builtins/exit.c\
parsing/lex_parsing.c\
parsing/parsing.c\
parsing/utils.c\
parsing/quote.c\
parsing/expand.c\
parsing/expand_2.c\
parsing/syntax.c\
parsing/free.c\
exec/exec.c\
exec/check_fd.c\
exec/check_fdin.c\
exec/check_fdout.c\
exec/exec2.c\
exec/exec3.c\
signals/signals.c\
heredoc/heredoc.c\
heredoc/expand_heredoc.c\
heredoc/expand2_heredoc.c\
.c.o:
$(CC) $(FLAG) -c $< -o $@
all: $(NAME)
lib:
@make -C $(LIBFT_PATH)
$(NAME): lib $(OBJ)
@$(CC) $(FLAG) $(OBJ) $(LIBFT_LIB) -lreadline -o $(NAME)
leak :
valgrind --suppressions=ignore_readline \
--leak-check=full --show-leak-kinds=all --track-origins=yes --track-fds=yes \
./minishell
bonus: lib $(OBJ_B)
@$(CC) $(FLAG) $(OBJ_B) $(LIBFT_LIB) -o $(NAME_BONUS)
clean:
@make clean -C $(LIBFT_PATH)
@rm -f $(OBJ) $(OBJ_B)
fclean: clean
@rm -f $(NAME) $(NAME_BONUS)
@make fclean -C $(LIBFT_PATH)
re: fclean all
.PHONY: all clean fclean re