-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
68 lines (53 loc) · 2.08 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: mli <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/10/20 16:39:23 by mli #+# #+# #
# Updated: 2021/03/08 12:06:12 by mli ### ########.fr #
# #
# **************************************************************************** #
EOC = \033[0m
BOLD = \033[1m
RED = \033[91m
GREEN = \033[92m
YELLOW = \033[93m
DBLUE = \033[94m
PURPLE = \033[95m
CYAN = \033[96m
# ############################################################################ #
NAME = a.out
CC = clang++
CFLAGS = -Wall -Wextra -Werror -std=c++98
ifeq ($(f), f)
CFLAGS += -fsanitize=address -g3
endif
SRCS_FILES = main.cpp
CONTAINERS = RandomIte vector list map
CONTAINERS_FILES = base ${CONTAINERS} ${addsuffix _decl, ${CONTAINERS}} \
ReverseIte lstIte mapIte stack queue
HEADER_FILES = ${addsuffix .hpp, ${CONTAINERS_FILES}}
OBJS_PATH = ./obj/
OBJS = ${addprefix ${OBJS_PATH}, ${SRCS_FILES:.cpp=.o}}
all:
@printf "$(BOLD)Make $(RED)$(NAME)$(EOC)"
@echo " $(BOLD)with$(EOC) $(GREEN)$(CC)$(EOC) $(CYAN)$(CFLAGS)$(EOC): "
@make ${NAME}
$(NAME): ${OBJS_PATH} ${OBJS} ${HEADER_FILES}
@echo ""
@${CC} ${CFLAGS} -o ${NAME} ${OBJS}
${OBJS_PATH}:
@mkdir -p $@
${OBJS_PATH}%.o: %.cpp ${HEADER_FILES}
@${CC} ${CFLAGS} -c $< -o $@
@printf "$(YELLOW)▓$(EOC)"
clean:
@echo "$(BOLD)$(YELLOW)Remove objs.... |$(GREEN)| done$(EOC)"
@rm -rf ${OBJS_PATH}
fclean: clean
@echo "$(BOLD)$(YELLOW)Remove all..... |$(GREEN)| done$(EOC)"
@rm -rf $(NAME)
re: fclean all
.PHONY: all clean fclean re