-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (35 loc) · 876 Bytes
/
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
NAME = minishell
SRCS = $(wildcard srcs/*.c) \
$(wildcard srcs/builtins/*.c) \
$(wildcard srcs/parse/*.c) \
$(wildcard srcs/env/*.c) \
$(wildcard srcs/heredoc/*.c) \
$(wildcard utils/*.c)
OBJS = ${SRCS:.c=.o}
CC = gcc
CFLAGS = -Wall -Wextra -Werror
Include = -lreadline
RM = rm -rf
all: ${NAME}
${NAME}:${OBJS}
@echo "\n"
@echo "\033[0;32mCompiling minishell..."
@${MAKE} -C ./libft/
@${CC} ${CFLAGS} ${OBJS} ${Include} ./libft/libft.a -o ${NAME}
@echo "\n\033[0;32mDone !"
clean:
@echo "\033[0;31mCleaning libft..."
@${MAKE} clean -C ./libft/
@echo "\nRemoving binaries..."
@${RM} ${OBJS}
@echo "\033[0m"
fclean:
@echo "\033[0;31mCleaning libft..."
@make fclean -C ./libft/
@echo "\nDeleting objects..."
@${RM} ${OBJS}
@echo "\nDeleting executable..."
@${RM} ${NAME}
@echo "\033[0m"
re: fclean all
.PHONY: all clean fclean re