-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
83 lines (68 loc) · 2.02 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
NAME = minishell
SRC_DIR = srcs
OBJ_DIR = objects
SOURCES = srcs/builtins/export.c \
srcs/builtins/builtins_utils.c \
srcs/builtins/cd.c \
srcs/builtins/builtins.c \
srcs/builtins/pwd.c \
srcs/builtins/exit.c \
srcs/builtins/unset.c \
srcs/builtins/echo.c \
srcs/environment/env_utils_2.c \
srcs/environment/env_utils_1.c \
srcs/environment/env.c \
srcs/executor/execution.c \
srcs/executor/exec_path_finding.c \
srcs/executor/exec_utils.c \
srcs/executor/exec_error_handling.c \
srcs/parser/parsing_utils.c \
srcs/parser/parsing.c \
srcs/tokenizer/token_utils_2.c \
srcs/tokenizer/tokenizer.c \
srcs/tokenizer/token_utils_3.c \
srcs/tokenizer/token_utils.c \
srcs/utils/utils.c \
srcs/utils/utils_2.c \
srcs/utils/free.c \
srcs/constructors.c \
srcs/debug.c \
srcs/main.c \
srcs/read.c \
srcs/signals.c \
LIBFT_DIR = ./libft
CC = gcc
CFLAGS = -Wall -Wextra -Werror
LDFLAGS = -L$(LIBFT_DIR) -lft -lreadline
OBJECTS = $(patsubst $(SRC_DIR)/%.c, $(OBJ_DIR)/%.o, $(SOURCES))
# --- COLORS ---
NONE=\033[0m
GRAY=\033[2;37m
RED=\033[31m
GREEN=\033[32m
# --- RULES ---
all: $(NAME)
$(NAME): $(OBJECTS) | libft
@echo "$(GRAY)----Compiling $(NAME)----$(NONE)"
$(CC) $(CFLAGS) -o $@ $(OBJECTS) $(LDFLAGS)
@echo "$(GREEN)$(NAME) Compiled! ᕦ(♥_♥)ᕤ$(NONE)\n"
objects/%.o: srcs/%.c | objects
$(CC) $(CFLAGS) -c $< -o $@
libft:
make -C $(LIBFT_DIR)
clean:
@echo "$(GREEN)Deleting objects! ( ͡° ͜ʖ ͡°) $(NONE)"
rm -f $(OBJECTS)
make -C $(LIBFT_DIR) clean
fclean: clean
@echo "$(RED)Deleting everything! ( ͡° ͜ʖ ͡°) $(NONE)"
rm -f $(NAME)
make -C $(LIBFT_DIR) fclean
restart: all
./minishell
readline.supp:
wget https://raw.githubusercontent.com/MrFacundo/42_Minishell/main/readline.supp
valgrind: $(NAME) readline.supp
valgrind --leak-check=full --show-leak-kinds=all --track-fds=yes --suppressions=readline.supp ./$(NAME)
re: fclean all
.PHONY: all libft clean fclean re valgrind