Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (53 loc) · 1.66 KB
/
Copy pathMakefile
File metadata and controls
69 lines (53 loc) · 1.66 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
65
66
67
68
69
############## COMPILER ##############
cxx = c++
################ FLAG ################
ifdef DEBUG
FLAGS := -Wall -Wextra -Werror -std=c++98 -g3 -fsanitize=address
else
FLAGS := -Wall -Wextra -Werror -std=c++98 -O2
endif
############### TARGET ###############
NAME = ircserv
################ FILE ################
HEADERS_DIR = includes/
HEADERS_FILES = Server.hpp User.hpp Channel.hpp Message.hpp Command.hpp FormatValidator.hpp CommonValue.hpp Bot.hpp
HEADERS = $(addprefix $(HEADERS_DIR), $(HEADERS_FILES))
SRCS_DIR = srcs/
SRCS_FILES = main.cpp Server.cpp User.cpp Channel.cpp Message.cpp Command.cpp FormatValidator.cpp Bot.cpp
SRCS = $(addprefix $(SRCS_DIR), $(SRCS_FILES))
################ OBJ #################
OBJS_DIR = objs/
OBJS = $(addprefix $(OBJS_DIR), $(SRCS_FILES:.cpp=.o))
############### Color ################
GREEN="\033[32m"
L_GREEN="\033[1;32m"
RED="\033[31m"
L_RED="\033[1;31m"
RESET="\033[0m"
BOLD="\033[1m"
L_PUPLE="\033[1;35m"
L_CYAN="\033[1;96m"
UP = "\033[A"
CUT = "\033[K"
################ RULE ################
all : $(NAME)
$(OBJS_DIR):
@mkdir $(OBJS_DIR)
$(OBJS): $(HEADER) | $(OBJS_DIR)
$(NAME) : $(OBJS)
@$(cxx) $(FLAGS) $^ -I$(HEADERS_DIR) -o $@
@echo current complie FLAGS : $(FLAGS)
@echo complete $(L_GREEN)COMPILE$(RESET) 🌸
$(addprefix $(OBJS_DIR), %.o): $(addprefix $(SRCS_DIR), %.cpp)
@$(cxx) $(FLAGS) -c -I$(HEADERS_DIR) $< -o $@
clean :
@rm -rf $(OBJS_DIR)
@echo $(L_RED)remove$(RESET) OBJ files 🌪
fclean : clean
@rm -f $(NAME)
@echo $(L_RED)remove$(RESET) $(NAME) a.k.a target file 🎯
re : fclean all
debug :
@make DEBUG=1
@echo start $(L_CYAN)DEBUG$(RESET) 😱 GOOD LUCK 🍀
.PHONY : all clean fclean re debug