-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
178 lines (145 loc) · 6.43 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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# LIB #
# NAME = ft_containers.a
# Exec #
LIST = list_test
MAP = map_test
QUEUE = queue_test
STACK = stack_test
VECTOR = vector_test
# Exec Path #
LIST_PATH = $(addprefix $(TEST_DIR)/,$(LIST))
MAP_PATH = $(addprefix $(TEST_DIR)/,$(MAP))
QUEUE_PATH = $(addprefix $(TEST_DIR)/,$(QUEUE))
STACK_PATH = $(addprefix $(TEST_DIR)/,$(STACK))
VECTOR_PATH = $(addprefix $(TEST_DIR)/,$(VECTOR))
# Test #
TEST = $(LIST) $(STACK) $(QUEUE) $(VECTOR) $(MAP)
# Path #
TEST_DIR = test
MAIN_DIR = main
SRCS_DIR = srcs
OBJS_DIR = objs
INCS_DIR = includes
VPATH = $(SRCS_DIR):$(OBJS_DIR):$(INCS_DIR):$(MAIN_DIR)
# File with Path #
SRCS_PATH = $(wildcard $(SRCS_DIR)/*.cpp)
OBJS_PATH = $(patsubst $(SRCS_DIR)%,$(OBJS_DIR)%,$(SRCS_PATH:%.cpp=%.o))
INCS_PATH = $(wildcard $(INCS_DIR)/*.hpp)
# File #
SRCS = $(notdir $(SRCS_PATH))
OBJS = $(notdir $(OBJS_PATH))
INCS = $(notdir $(INCS_PATH))
# Main #
TEST_INCS = $(addprefix $(MAIN_DIR),/Tester.hpp)
TEST_MAIN = $(addprefix $(MAIN_DIR),/mainglobal.cpp)
LIST_MAIN = $(addprefix $(MAIN_DIR),/mainlist.cpp)
MAP_MAIN = $(addprefix $(MAIN_DIR),/mainmap.cpp)
STACK_MAIN = $(addprefix $(MAIN_DIR),/mainstack.cpp)
QUEUE_MAIN = $(addprefix $(MAIN_DIR),/mainqueue.cpp)
VECTOR_MAIN = $(addprefix $(MAIN_DIR),/mainvector.cpp)
# Compile #
CC = clang++
CFLAGS = -Wall -Wextra -g3 -Werror -g3# -fsanitize=address
CVERSION = -std=c++98
LFLAGS = -I $(TEST_INCS) -I $(INCS_DIR)
CALLF = $(CC) $(CFLAGS) $(CVERSION)
CALLFLIB = $(CC) $(CFLAGS) $(CVERSION) $(LFLAGS)
# Verif if input is set #
ifdef INPUT
RESET = yes
endif
# Defauilt Make #
all : directories
# Start all tester #
all_test : ART list stack queue vector map
# set Restart #
lreset :
ifdef INPUT
$(eval RESET = $(LIST))
endif
vreset :
ifdef INPUT
$(eval RESET = $(VECTOR))
endif
mreset :
ifdef INPUT
$(eval RESET = $(MAP))
endif
sreset :
ifdef INPUT
$(eval RESET = $(STACK))
endif
qreset :
ifdef INPUT
$(eval RESET = $(QUEUE))
endif
# Restart exec #
reset :
ifdef RESET
@\rm -rf $(addprefix $(TEST_DIR),$(addsuffix $(RESET), /))
endif
# Containers test #
list : all lreset reset $(LIST_PATH)
./$(addprefix $(TEST_DIR)/,$(LIST))
$(LIST_PATH) : $(LIST_MAIN) $(TEST_MAIN) $(TEST_INCS) $(INCS_PATH)
$(CALLFLIB) ${INPUT} $(LIST_MAIN) $(TEST_MAIN) -o $(LIST_PATH)
stack : all sreset reset $(STACK_PATH)
./$(addprefix $(TEST_DIR)/,$(STACK))
$(STACK_PATH) : $(STACK_MAIN) $(TEST_MAIN) $(TEST_INCS) $(INCS_PATH)
$(CALLFLIB) ${INPUT} $(STACK_MAIN) $(TEST_MAIN) -o $(addprefix $(TEST_DIR)/,$(STACK))
queue : all qreset reset $(QUEUE_PATH)
./$(addprefix $(TEST_DIR)/,$(QUEUE))
$(QUEUE_PATH) : $(QUEUE_MAIN) $(TEST_MAIN) $(TEST_INCS) $(INCS_PATH)
$(CALLFLIB) ${INPUT} $(QUEUE_MAIN) $(TEST_MAIN) -o $(addprefix $(TEST_DIR)/,$(QUEUE))
map : all mreset reset $(MAP_PATH)
./$(addprefix $(TEST_DIR)/,$(MAP))
$(MAP_PATH) : $(MAP_MAIN) $(TEST_MAIN) $(TEST_INCS) $(INCS_PATH)
$(CALLFLIB) ${INPUT} $(MAP_MAIN) $(TEST_MAIN) -o $(addprefix $(TEST_DIR)/,$(MAP))
vector : all vreset reset $(VECTOR_PATH)
./$(addprefix $(TEST_DIR)/,$(VECTOR))
$(VECTOR_PATH) : $(VECTOR_MAIN) $(TEST_MAIN) $(TEST_INCS) $(INCS_PATH)
$(CALLFLIB) ${INPUT} $(VECTOR_MAIN) $(TEST_MAIN) -o $(addprefix $(TEST_DIR)/,$(VECTOR))
# Make the Directories #
directories :
@mkdir -p $(OBJS_DIR)
@mkdir -p $(TEST_DIR)
# Clean obj #
clean :
@rm -f $(OBJS_PATH)
$(info Build done! Cleaning object files...)
# Clean all #
fclean : clean
@rm -rf $(OBJS_DIR) $(addprefix $(TEST_DIR)/,$(TEST)) $(TEST_DIR)
@rm -f $(NAME)
$(info Build done! Cleaning exec...)
re : fclean all
ART:
@for i in {0..4} ; \
do \
sleep 0.2;\
clear;\
for y in {233..233} {52..52} {52..52} {88..88} {124..124} {124..124} {124..124} {124..124} {88..88} {52..52} {52..52} {233..233}; \
do \
printf "\033[48;5;$${y}m \033[0m" ;\
done ; echo ; \
((i = i*6*6 + 16)) ; \
echo ; \
echo " \033[38;5;$${i}m ▄████▄ ▒█████ ███▄ █ ▄▄▄█████▓ ▄▄▄ ██▓ ███▄ █ ▓█████ ██▀███ ██████ \033[0m";\
echo " \033[38;5;$${i}m▒██▀ ▀█ ▒██▒ ██▒ ██ ▀█ █ ▓ ██▒ ▓▒▒████▄ ▓██▒ ██ ▀█ █ ▓█ ▀ ▓██ ▒ ██▒▒██ ▒ \033[0m";\
echo " \033[38;5;$${i}m▒▓█ ▄ ▒██░ ██▒▓██ ▀█ ██▒▒ ▓██░ ▒░▒██ ▀█▄ ▒██▒▓██ ▀█ ██▒▒███ ▓██ ░▄█ ▒░ ▓██▄ \033[0m";\
echo " \033[38;5;$${i}m▒▓▓▄ ▄██▒▒██ ██░▓██▒ ▐▌██▒░ ▓██▓ ░ ░██▄▄▄▄██ ░██░▓██▒ ▐▌██▒▒▓█ ▄ ▒██▀▀█▄ ▒ ██▒\033[0m";\
echo " \033[38;5;$${i}m▒ ▓███▀ ░░ ████▓▒░▒██░ ▓██░ ▒██▒ ░ ▓█ ▓██▒░██░▒██░ ▓██░░▒████▒░██▓ ▒██▒▒██████▒▒\033[0m";\
((i = (i - 16)/6/6)) ; \
((i = i*2 + 232)) ; \
echo " \033[38;5;$${i}m░ ░▒ ▒ ░░ ▒░▒░▒░ ░ ▒░ ▒ ▒ ▒ ░░ ▒▒ ▓▒█░░▓ ░ ▒░ ▒ ▒ ░░ ▒░ ░░ ▒▓ ░▒▓░▒ ▒▓▒ ▒ ░\033[0m";\
echo " \033[38;5;$${i}m ░ ▒ ░ ▒ ▒░ ░ ░░ ░ ▒░ ░ ▒ ▒▒ ░ ▒ ░░ ░░ ░ ▒░ ░ ░ ░ ░▒ ░ ▒░░ ░▒ ░ ░\033[0m";\
echo " \033[38;5;$${i}m░ ░ ░ ░ ▒ ░ ░ ░ ░ ░ ▒ ▒ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ \033[0m";\
echo " \033[38;5;$${i}m░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ \033[0m";\
echo " \033[38;5;$${i}m░ \033[0m";\
echo ; \
for y in {233..233} {52..52} {52..52} {88..88} {124..124} {124..124} {124..124} {124..124} {88..88} {52..52} {52..52} {233..233}; \
do \
printf "\033[48;5;$${y}m \033[0m" ;\
done ; echo ; \
done
.PHONY : all fclean clean re directories ART list map vector queue stack lreset vreset mreset sreset qreset reset