-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
84 lines (73 loc) · 1.91 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
CC = gcc
CFLAGS = -g -Wall -Wextra -Werror
INCLUDE = -I./includes
LDFLAGS = -L./src/queue -L./src/libft
LIBS = -lq -lft -ltermcap
LIBQ = libqueue.a
LIBFT = libft.a
NAME = minishell
SRCS = \
src/lexer/lexer.c \
src/lexer/literal/literal.c \
src/lexer/literal/quoting.c \
src/lexer/metacharacter/metacharacter.c \
src/lexer/literal/wildcard.c \
src/parser/parser.c \
src/interpreter/interpreter.c \
src/interpreter/pipeline.c \
src/interpreter/simple_command.c \
src/interpreter/execute_cmds.c \
src/interpreter/execute_bltin.c \
src/interpreter/assign_variable.c \
src/interpreter/expansion.c \
src/interpreter/redirect.c \
src/interpreter/here_documents.c \
src/interpreter/signal.c \
src/shell_variable/get_shell_var.c \
src/shell_variable/set_shell_var.c \
src/shell_variable/new_shell_var.c \
src/shell_variable/get_param_elem.c \
src/shell_variable/get_next_line.c \
src/shell_variable/hash.c \
src/prompt/prompt.c \
src/prompt/prompt_utils.c \
src/prompt/copy_and_paste.c \
src/prompt/move.c \
src/prompt/history.c \
src/bltin/cd.c \
src/bltin/cd_path.c\
src/bltin/echo.c \
src/bltin/pwd.c \
src/bltin/unset.c \
src/bltin/export.c \
src/bltin/exit.c \
src/bltin/env.c \
src/error/error.c \
src/free/free.c \
src/util/set_environ.c \
src/minishell.c
OBJS=$(SRCS:.c=.o)
NAME_LEAKS := minishell_leaks
SRCS_LEAKS := $(SRCS) src/leaks.c
OBJS_LEAKS := $(SRCS_LEAKS:.c=.o)
all: $(NAME)
leaks: $(OBJS_LEAKS) $(LIBFT) $(LIBQ)
$(CC) $(CFLAGS) -o $(NAME_LEAKS) $(LDFLAGS) $(OBJS_LEAKS) $(LIBS)
clean:
$(MAKE) clean -C ./src/libft
$(MAKE) clean -C ./src/queue
rm -rf $(OBJS)
rm -rf $(OBJS_LEAKS)
fclean: clean
$(MAKE) fclean -C ./src/libft
$(MAKE) fclean -C ./src/queue
rm -rf $(NAME)
rm -rf $(NAME_LEAKS)
re: fclean all
$(NAME): $(OBJS) $(LIBFT) $(LIBQ)
$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
$(LIBFT):
$(MAKE) -C ./src/libft
$(LIBQ):
$(MAKE) -C ./src/queue
.PHONY: clear fclean re all