-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (41 loc) · 1.12 KB
/
Copy pathMakefile
File metadata and controls
55 lines (41 loc) · 1.12 KB
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
CC = cc
CFLAGS = -Wall -Wextra -Werror
FT_DIR = ./libft
LFLAGS = -L$(FT_DIR) -lft -lreadline
CFILES = main.c minishell.c minishell_utils.c \
tokenizer.c tokenizer_utils.c \
syntax_checker.c \
token_parser.c token_parser_utils.c \
pre_expand.c pre_expand_utils.c \
exec_manager.c redir_manager.c \
pipex.c execution.c \
helper_functions.c \
builtins.c builtin_export.c \
signals_handling.c
OFILES = $(CFILES:.c=.o)
NAME = minishell
GREEN=\033[0;32m
YELLOW=\033[0;33m
BLUE=\033[0;34m
MAGENTA=\033[0;35m
NC=\033[0m
GNL=0
all: $(NAME)
$(NAME): $(OFILES)
@cd ./libft && make > /dev/null
@echo "$(GREEN)Compiled libft ✅ $(NC)"
@$(CC) $(OFILES) -o $(NAME) $(LFLAGS)
@echo "$(GREEN)Compiled $(NAME) ✅ $(NC)"
$(OFILES): %.o: %.c minishell.h
@$(CC) $(CFLAGS) -c $< -o $@ -D GNL=$(GNL)
clean:
@cd ./libft && make clean > /dev/null
@rm -f $(OFILES)
@echo "$(MAGENTA)Cleaned object files ✅ $(NC)"
fclean: clean
@cd ./libft && make fclean > /dev/null
@echo "$(MAGENTA)Cleaned libft ✅ $(NC)"
@rm -f $(NAME)
@echo "$(MAGENTA)Cleaned $(NAME) ✅ $(NC)"
re: fclean all
.PHONY : all clean fclean re