-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
108 lines (90 loc) · 2.63 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
_BOLD =\e[1m
_R =\e[0m
_RED =\e[91m
_GREEN =\e[92m
_YELLOW =\e[93m
_BLUE =\e[94m
_MAGENTA =\e[35m
_CYAN =\e[96m
_WHITE =\e[97m
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: alesanto <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/01/09 17:02:25 by alesanto #+# #+# #
# Updated: 2020/04/10 16:03:47 by alesanto ### ########.fr #
# #
# **************************************************************************** #
NAME = minishell
SRC = main.c \
ft_parsing.c \
ft_init.c \
ft_cd.c \
ft_echo.c \
ft_env.c \
ft_exit.c \
ft_pwd.c \
ft_export.c \
ft_unset.c \
ft_replace.c \
ft_pipe.c \
ft_pipeerror.c \
ft_redirection.c \
ft_splitslash.c \
ft_splitspace.c \
ft_exec.c \
ft_splitbuiltin.c \
ft_strtrimslash.c \
ft_utils_exec.c \
ft_utils_export.c \
ft_guillemet.c \
ft_utils_pipeerror.c \
ft_suprguy.c \
ft_parsing_next.c \
ft_redirection_next.c \
ft_redirection_bis.c \
ft_export_solo.c \
ft_utils.c \
ft_utils_replace.c \
### Librairies ###
HEADERS = ./include/
INC = minishell.h
vpath %.h $(HEADERS)
### Sources ###
PATHSRCS = ./srcs
SRCS = $(addprefix $(PATHSRCS)/,$(SRC))
### Objets ###
OBJ_DIR = obj
OBJ = $(addprefix $(OBJ_DIR)/,$(SRC:.c=.o))
vpath %.c $(PATHSRCS)
### Flags ###
FLAGS = -Wall -Wextra -Werror -g -fsanitize=address
### Libft ###
LIBS = ./libft/libft.a
all: $(NAME)
$(OBJ_DIR)/%.o: $(PATHSRCS)/%.c
@mkdir -p $(OBJ_DIR)
@gcc $(FLAGS) -I $(HEADERS) -c $< -o $@
@echo "$(_YELLOW)Compiling ➜$(_WHITE) $<$(_R)"
$(NAME): titre $(OBJ)
@echo "$(_YELLOW)Compilation completed.$(_R)"
@make -C libft/ > /dev/null
@(gcc $(FLAGS) -I $(HEADERS) $(OBJ) -o $(NAME) $(LIBS))
@(echo "$(_YELLOW)Executable $(NAME) created.$(_R)")
clean:
@echo "$(_BLUE)Clean$(_R)"
@make clean -C ./libft/ > /dev/null
@(rm -rf ./srcs/*.o)
@(rm -rf $(OBJ_DIR))
fclean: clean
@echo "$(_BLUE)Fclean$(_R)"
@make fclean -C ./libft/ > /dev/null
@(rm -rf $(NAME))
re: fclean all
titre:
@echo "\e[1;93mMinishell - 42 project -$(_R)"
@echo "\e[1;93m________________________$(_R)"
.PHONY: all clean fclean re titre