-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (43 loc) · 1.69 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
# **************************************************************************** #
# #
# ::: :::::::: #
# make_speed :+: :+: :+: #
# +:+ +:+ +:+ #
# By: mkaruvan <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/12/18 10:07:54 by mkaruvan #+# #+# #
# Updated: 2022/12/18 10:09:55 by mkaruvan ### ########.fr #
# #
# **************************************************************************** #
SRC = map_speed_test.cpp vector_speed_test.cpp stack_speed_test.cpp \
set_speed_test.cpp
SRC_DIR = tests/speed_tests/
EXE = $(SRC:.cpp=)
DXE1 = exe_ft
DXE2 = exe_std
INC = includes
OBJ_DIR = objs
FT = ft_
STD = std_
CC = c++
RM = rm -rf
CFLAGS = -Wall -Wextra -Werror -std=c++98 -g
all: $(FT) $(STD)
$(FT):
mkdir -p objs exe_ft
for d in $(EXE); do \
$(CC) $(CFLAGS) -I$(INC) -D CT=ft -c $(SRC_DIR)$$d.cpp -o $(OBJ_DIR)/$(@)$$d.o; \
$(CC) $(CFLAGS) $(OBJ_DIR)/$(FT)$$d.o -o $(DXE1)/$(@)$$d; \
done
$(STD):
mkdir -p objs exe_std
for d in $(EXE); do \
$(CC) $(CFLAGS) -I$(INC) -D CT=std -c $(SRC_DIR)$$d.cpp -o $(OBJ_DIR)/$@$$d.o; \
$(CC) $(CFLAGS) $(OBJ_DIR)/$(STD)$$d.o -o $(DXE2)/$(@)$$d; \
done
clean:
@$(RM) $(OBJ_DIR)
fclean: clean
@$(RM) $(DXE1) $(DXE2)
re: fclean all
.PHONY: all clean fclean re