-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (36 loc) · 1006 Bytes
/
Makefile
File metadata and controls
51 lines (36 loc) · 1006 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
49
50
51
NAME = ircserv
SRCS_DIR = ./srcs
HEADER_DIR = ./includes/
OBJS_DIR = ./objs
vpath %.cpp $(SRCS_DIR)
SRC = main.cpp \
utils/Db.cpp utils/Command.cpp utils/Parsing.cpp \
server/Server.cpp server/Handler.cpp \
SRCS = $(addprefix $(SRCS_DIR)/, $(SRC))
OBJ = $(SRC:.cpp=.o)
DEPS = $(SRC:.cpp=.d)
OBJS = $(addprefix $(OBJS_DIR)/, $(OBJ))
CXX = c++
CXXFLAGS = -std=c++98 -Wall -Wextra -Werror -MMD
RM = rm -f
RMDIR = rm -rf
all : $(NAME)
$(NAME) : $(OBJS)
@echo "\033[0;34m====Compiling :\033[0;33m" $@ "\033[0;34m===="
@$(CXX) $(CXXFLAGS) -I $(HEADER_DIR) $(OBJS) -o $@
@echo "\033[0;33m" $@ "HAS BEEN CREATED"
$(OBJS_DIR)/%.o : $(SRCS_DIR)/%.cpp
@mkdir -p $(dir $@)
@$(CXX) $(CXXFLAGS) -I $(HEADER_DIR) -c $< -o $@
help :
@echo "make re"
@echo "./ircserv <port_number> <password>"
clean :
@echo "\033[0;31mREMOVE OBJECTIVE FILES"
@$(RMDIR) $(OBJS_DIR)
fclean : clean
@echo "\033[0;31mREMOVE $(NAME)"
@$(RM) $(NAME)
re : fclean all
.PHONY : all help clean fclean re
-include $(DEPS)