-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
119 lines (87 loc) · 4.31 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
109
110
111
112
113
114
115
116
117
118
119
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: nepage-l <nepage-l@student.42lyon.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/03/08 11:33:38 by nepage-l #+# #+# #
# Updated: 2021/03/29 16:12:47 by nepage-l ### ########lyon.fr #
# #
# **************************************************************************** #
# **************************************************************************** #
# VARIABLES #
# **************************************************************************** #
HEADER = push_swa/push_swap.h
HEADER = checke/checker.h
LIBS = libft/libft.a
SRC_PATH = push_swa
SRC_PATH2 = checke
SRCS_NAME = push_swap.c \
ft_operate.c \
ft_fct.c \
ft_papb.c \
ft_rarbrr.c \
ft_rrarrbrrr.c \
ft_sasbss.c \
../get_next_line/get_next_line_utils.c \
../get_next_line/get_next_line.c
SRCS_NAME2 = checker.c \
ft_read.c \
ft_papb.c \
ft_rarbrr.c \
ft_rrarrbrrr.c \
ft_sasbss.c \
../get_next_line/get_next_line_utils.c \
../get_next_line/get_next_line.c
OBJS = ${SRCS:.c=.o}
OBJS2 = ${SRCS2:.c=.o}
NAME = push_swap
NAME2 = checker
RM = rm -f
FLAGS = -Wall -Wextra -Werror -O3
SRCS = $(addprefix $(SRC_PATH)/,$(SRCS_NAME))
SRCS2 = $(addprefix $(SRC_PATH2)/,$(SRCS_NAME2))
# **************************************************************************** #
# REGLES #
# **************************************************************************** #
all: $(NAME) $(NAME2)
%.o: %.c $(HEADER)
@echo "\033[0;32m[OK] \033[0m \033[0;33m Compiling:\033[0m" $<
@gcc $(FLAGS) -I $(HEADER) -c $< -o $@
$(NAME): $(LIBS) $(OBJS) $(HEADER) | ART
@echo "\x1b[36m\n[OK] \033[0m \x1b[35m Compiling push_swap\n\033[0m"
gcc $(FLAGS) $(OBJS) $(LIBS) -o $(NAME)
$(NAME2): $(LIBS) $(OBJS2) $(HEADER2) | ART2
@echo "\x1b[36m\n[OK] \033[0m \x1b[35m Compiling checker\n\033[0m"
gcc $(FLAGS) $(OBJS2) $(LIBS) -o $(NAME2)
$(LIBS): FORCE
@$(MAKE) -C libft all
clean:
@$(MAKE) -C libft clean
@echo "\x1b[36m[OK] \033[0m \x1b[34m Removing ALL File object\033[0m"
@$(RM) $(OBJS) $(OBJS2)
fclean: clean
@$(MAKE) -C libft fclean
@echo "\x1b[36m[OK] \033[0m \x1b[32m All is Removing\033[0m"
@$(RM) $(NAME) $(NAME2)
re: fclean all
ART: FORCE
@echo " ____ __ "
@echo " / __ \__ _______/ /_ ______ ______ _____ "
@echo " / /_/ / / / / ___/ __ \ / ___/ | /| / / __ '/ __ \""
@echo " / ____/ /_/ (__ ) / / / (__ )| |/ |/ / /_/ / /_/ /"
@echo "/_/ \__,_/____/_/ /_/ /____/ |__/|__/\__,_/ .___/ "
@echo " /_/ "
@echo ""
ART2: FORCE
@echo " .d8888b. 888 888 8888888888 .d8888b. 888 d8P 8888888888 8888888b. "
@echo "d88P Y88b 888 888 888 d88P Y88b 888 d8P 888 888 Y88b "
@echo "888 888 888 888 888 888 888 888 d8P 888 888 888 "
@echo "888 8888888888 8888888 888 888d88K 8888888 888 d88P "
@echo "888 888 888 888 888 8888888b 888 8888888P" ""
@echo "888 888 888 888 888 888 888 888 Y88b 888 888 T88b "
@echo "Y88b d88P 888 888 888 Y88b d88P 888 Y88b 888 888 T88b "
@echo " "Y8888P" 888 888 8888888888 "Y8888P" 888 Y88b 8888888888 888 T88b "
.PHONY: ART ART2 clean fclean
FORCE: ;