-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
97 lines (79 loc) · 2.54 KB
/
Makefile
File metadata and controls
97 lines (79 loc) · 2.54 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: JFikents <Jfikents@student.42Heilbronn.de> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/09/12 17:19:16 by apeposhi #+# #+# #
# Updated: 2024/11/13 19:27:55 by JFikents ### ########.fr #
# #
# **************************************************************************** #
# Metadata
AUTHORS = apeposhi & jfikents & ajakob
NAME = ircserv
# Files
_INCLUDE_FLAGS = includes
INCLUDE_FLAGS = $(addprefix -I, $(_INCLUDE_FLAGS))
_CHANNEL_SRC = Channel.cpp\
getChannel.cpp\
invite.cpp\
join.cpp\
kick.cpp\
mode.cpp\
part.cpp\
privMsg.cpp\
topic.cpp\
whoReply.cpp
CHANNEL_SRC = $(addprefix channel/, $(_CHANNEL_SRC))
_CLIENT_SRC = Client.cpp\
bufferMethods.cpp\
clientOpMethods.cpp\
Operator.cpp\
registrationMethods.cpp\
timeoutMethods.cpp
CLIENT_SRC = $(addprefix client/, $(_CLIENT_SRC))
_SERVER_CMDS = handleInvite.cpp\
handleJoin.cpp\
handleKick.cpp\
handleMode.cpp\
handlePart.cpp\
handlePrivMsg.cpp\
handleTopic.cpp\
handleWho.cpp
SERVER_CMDS = $(addprefix commands/, $(_SERVER_CMDS))
_SERVER_SRC = IO_Loop.cpp\
receiveMessage.cpp\
registrationMethods.cpp\
sendMessage.cpp\
Server.cpp\
servOpMethods.cpp\
timeoutMethods.cpp\
utils.cpp\
$(SERVER_CMDS)
SERVER_SRC = $(addprefix server/, $(_SERVER_SRC))
_SRC = main.cpp $(CLIENT_SRC) $(SERVER_SRC) $(CHANNEL_SRC)
SRC = $(addprefix src/, $(_SRC))
OBJ = $(SRC:src/%.cpp=bin/%.o)
# Compiler and Flags
CXX := c++
CXXFLAGS := -Wall -Wextra -Werror -std=c++17 -MMD -MP
ifdef DEBUG
CXXFLAGS += -g3
endif
# Targets
all: $(NAME)
bin:
@mkdir -p bin/client bin/server/commands bin/utils bin/channel
bin/%.o: src/%.cpp | bin
$(CXX) $(CXXFLAGS) $(INCLUDE_FLAGS) -c $< -o $@
$(NAME): $(OBJ)
$(CXX) $(CXXFLAGS) $(OBJ) -o $(NAME)
clean:
@rm -rf $(OBJ)
fclean: clean
@rm -rf $(NAME)
re: fclean $(NAME)
# Phony Targets
.PHONY: all clean fclean re
-include $(OBJ:.o=.d)