-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (37 loc) · 844 Bytes
/
Makefile
File metadata and controls
48 lines (37 loc) · 844 Bytes
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
NAME = STL
## ANSI escape code
CYAN := \033[1;36;40m
RESET := \033[0m
LOG := printf "[$(CYAN)INFO$(RESET)] %s\n"
INC_DIRS += Iterator Vector Util test
vpath %.hpp $(INC_DIRS)
## file
HEADERS = Etc_func.hpp Iterator_traits.hpp Reverse_iterator.hpp Vector.hpp vector_test.hpp Number.hpp
SRCS = main.cpp
OBJS = $(SRCS:.cpp=.o)
## compile
CXX= c++ -fsanitize=address -g
CXXFLAGS = -Wall -Wextra -Werror -std=c++98 $(addprefix -I,$(INC_DIRS))
#
.PHONY: clean, fclean, re, all
all: $(NAME)
$(NAME): $(OBJS)
@$(LOG) "Link"
$(CXX) $(CXXFLAGS) -o $@ $(OBJS)
$(OBJS): %.o: %.cpp $(HEADERS)
@$(LOG) "Compile"
@$(CXX) $(CXXFLAGS) -o $@ -c $<
clean:
@$(LOG) "clean"
@rm -f std_out
@rm -f ft_out
@rm -f $(OBJS)
fclean: clean
@$(LOG) "fclean"
@rm -f std_out
@rm -f ft_out
@rm -f $(NAME)
re:
@$(LOG) "re"
@make fclean
@make all