-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (45 loc) · 1.1 KB
/
Copy pathMakefile
File metadata and controls
64 lines (45 loc) · 1.1 KB
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
NAME = ft_containers
LIST = main\
vector_test\
map_tests\
stack_tests
HEADER = -I includes/
CFLAGS = -Wall -Wextra -Werror -MMD -std=c++98
CC = clang++
S_DIR = srcs/
I_DIR = includes/
O_DIR = objs/
D_DIR = deps/
C_SUFF = .cpp
O_SUFF = .o
D_SUFF = .d
DIR_O = @mkdir -p objs/
DIR_D = @mkdir -p deps/
RM_FILE = rm -f
RM_DIR = rm -rf
LIST_C = $(addprefix $(S_DIR), $(LIST))
LIST_O = $(addprefix $(O_DIR), $(LIST))
LIST_D = $(addprefix $(D_DIR), $(LIST))
SRCS = $(addsuffix $(C_SUFF), $(LIST_C))
OBJS = $(addsuffix $(O_SUFF), $(LIST_O))
DEPS = $(OBJS:.o=.d)
$(O_DIR)%.o : $(S_DIR)%.cpp
$(DIR_O)
$(CC) $(CFLAGS) $(HEADER) -c $< -o $@
$(NAME) : $(OBJS)
$(CC) $(CFLAGS) $(OBJS) -o $(NAME)
all : $(NAME)
test : $(NAME)
$(CC) $(CFLAGS) $(OBJS) -D LIB="std" -o std_containers
./$(NAME) > ft_out
./std_containers > std_out
diff ft_out std_out
clean :
$(RM_DIR) $(O_DIR) $(D_DIR)
fclean : clean
$(RM_FILE) $(NAME)
rm -rf std_containers
rm -rf std_out ft_out
re : fclean all
.PHONY : all fclean re
-include $(DEPS)