forked from Benj0t/minishell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
110 lines (95 loc) · 3.05 KB
/
Makefile
File metadata and controls
110 lines (95 loc) · 3.05 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
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: bemoreau <bemoreau@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/08/13 19:04:13 by bemoreau #+# #+# #
# Updated: 2021/03/01 00:39:15 by bemoreau ### ########.fr #
# #
# **************************************************************************** #
NAME = minishell
INCLUDE = minishell.h\
INC_PATH = ./includes/
vpath %.c sources/builtins
vpath %.c sources/
FILES = ./sources/main\
./sources/pipe\
./sources/path\
./sources/builtins/cd\
./sources/builtins/cd_utils\
./sources/builtins/pwd\
./sources/builtins/env\
./sources/builtins/export\
./sources/builtins/unset\
./sources/builtins/echo\
./sources/builtins/exit\
./sources/builtins/exit_utils\
./sources/enter\
./sources/parser\
./sources/token\
./sources/environment\
./sources/expander\
./sources/multi_pipe\
./sources/redir\
./sources/first_command\
./sources/single_pipe\
./sources/pipe_utils\
./sources/init_pipe\
./sources/redir_utils\
./sources/gnl_prompt\
./sources/builtins\
./sources/middle_command\
./sources/parser_utils\
./sources/token_utils\
./sources/expander_utils\
./sources/lst_sort\
./sources/prompt_malloc\
./sources/backslash_quote\
./sources/environment_utils\
./sources/environment_manag\
./sources/free\
./sources/parser_save\
./sources/environment_expander\
./sources/lst_change\
SRCS = $(addsuffix .c, $(FILES))
OBJ = $(SRCS:.c=.o)
CC = gcc
L_CC = clang
LIB = ./libft/libft.a
FLAGS = -Wall -Wextra -Werror
### COLORS ###
NOC = \033[0m
BOLD = \033[1m
UNDERLINE = \033[4m
BLACK = \033[1;30m
RED = \033[1;31m
GREEN = \033[1;32m
YELLOW = \033[1;33m
BLUE = \033[1;34m
VIOLET = \033[1;35m
CYAN = \033[1;36m
WHITE = \033[1;37m
all: LIBFT $(NAME)
LIBFT:
@echo "$(CYAN)Building libft:$(NOC) $@"
cd ./libft/ && make && cd ..
$(NAME): $(OBJ)
@echo "$(CYAN)Constructing executable:$(NOC) $@"
@$(L_CC) -g3 $(FLAGS) -o $(NAME) $(OBJ) $(LIB)
.c.o: ${SRCS}
@echo " $(VIOLET)[$(L_CC)] $(GREEN)[$(FLAGS)]$(NOC) $(YELLOW)in progress ...:$(NOC) $< $(RED)->$(NOC) $@"
@$(L_CC) -g3 $(FLAGS) -c -I$(INC_PATH) $< -o ${<:.c=.o}
clean:
@echo "$(CYAN)Clean libft:$(NOC) $@"
@cd libft && make clean && cd ..
@echo "\n$(RED)Removing '.o' objects: $(NOC) $@"
@rm -f $(OBJ)
fclean: clean
@echo "$(CYAN)Fclean libft:$(NOC) $@"
@cd libft && make fclean && cd ..
@echo "\n$(RED)Removing executable: $(NOC) $@"
@rm -f $(NAME)
re: fclean all
.PHONY: all clean re fclean MLX LIBFT