-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (30 loc) · 804 Bytes
/
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
NAME = ft_containers
SRCS = srcs/main.cpp
OBJS = $(SRCS:.cpp=.o)
DEPS = $(SRCS:.cpp=.d)
COMPILER = clang++
FLAGS = -Wall -Werror -Wextra -std=c++98
INCLUDES = -Iincludes -Iincludes/containers -Iincludes/iterators
%.o : %.cpp
$(COMPILER) $(FLAGS) $(INCLUDES) -MMD -c $< -o $@
$(NAME): $(OBJS)
$(COMPILER) $(FLAGS) $(OBJS) -o $(NAME)
all: $(NAME)
clean:
rm -f $(OBJS)
rm -f $(DEPS)
fclean:
$(MAKE) clean
rm -f $(NAME)
re:
$(MAKE) fclean
$(MAKE) all
leak_sanitizer_address:
$(MAKE) fclean
$(COMPILER) $(FLAGS) $(INCLUDES) -fsanitize=address -g3 $(SRCS) -o $(NAME)
ASAN_OPTIONS=detect_leaks=1 ASAN_OPTIONS=atexit=1 ./${NAME}
leak_valgrind:
$(MAKE) re
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose ./${NAME}
.PHONY: all clean fclean re
-include $(DEPS)