-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (29 loc) · 1.12 KB
/
Makefile
File metadata and controls
39 lines (29 loc) · 1.12 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
NAME = ircserv
INCLUDE_FILES = src/common.hpp src/Server.hpp src/Message.hpp src/User.hpp src/Channel.hpp src/Reply.hpp
INCLUDE_DIRS = src
SRC_FILES = Server.cpp Message.cpp User.cpp Channel.cpp Reply.cpp\
common.cpp\
commands/pass.cpp commands/nick.cpp commands/user.cpp\
commands/join.cpp commands/part.cpp commands/topic.cpp commands/ping_pong.cpp commands/quit.cpp commands/who.cpp\
commands/list.cpp commands/names.cpp commands/msg.cpp commands/invite.cpp commands/away.cpp commands/kick.cpp commands/mode.cpp
OBJ_FILES = $(SRC_FILES:.cpp=.o)
SRC_DIR = src
OBJ_DIR = obj
CXX = c++
CXX_FLAGS = -Wall -Wextra -Werror -std=c++98 -I$(INCLUDE_DIRS) -pedantic
#CXX_FLAGS += -g3
DEPENDENCIES = $(INCLUDE_FILES) Makefile
all: $(NAME)
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(DEPENDENCIES)
@mkdir -p $(dir $@)
$(CXX) $(CXX_FLAGS) -c $< -o $@
$(NAME): obj/main.o $(addprefix $(OBJ_DIR)/,$(OBJ_FILES))
$(CXX) $^ -o $@
test_client: obj/test_client.o $(addprefix $(OBJ_DIR)/,$(OBJ_FILES))
$(CXX) $^ -o $@
clean:
$(RM) -r $(OBJ_DIR)
fclean: clean
$(RM) -r $(NAME)
re: clean all
.PHONY: all clean fclean re