-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·142 lines (123 loc) · 4.42 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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: bbellavi <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/04/12 19:27:05 by bbellavi #+# #+# #
# Updated: 2022/06/20 18:06:50 by bbellavi ### ########.fr #
# #
# **************************************************************************** #
CXX = c++
CXXFLAGS = -Wall -Werror -Wextra -std=c++98
SRC_DIR = srcs
INC_DIR = include
SRCS = main.cpp \
srcs/Utils.cpp \
srcs/App.cpp \
srcs/network/Selector.cpp \
srcs/network/File.cpp \
srcs/network/Socket.cpp \
srcs/network/Network.cpp \
srcs/network/IFileObj.cpp \
srcs/network/SignalFD.cpp \
srcs/irc/ICmdFactory.cpp \
srcs/irc/CmdFactory.cpp \
srcs/irc/CmdCtx.cpp \
srcs/irc/ACmd.cpp \
srcs/irc/Action.cpp \
srcs/irc/Actions.cpp \
srcs/irc/Replies.cpp \
srcs/irc/IRCApi.cpp \
srcs/irc/Config.cpp \
srcs/irc/Parse.cpp \
srcs/irc/Masks.cpp \
srcs/irc/CmdParser.cpp \
srcs/irc/Mode.cpp \
srcs/irc/cmd/CmdPASS.cpp \
srcs/irc/cmd/CmdUSER.cpp \
srcs/irc/cmd/CmdNICK.cpp \
srcs/irc/cmd/CmdJOIN.cpp \
srcs/irc/cmd/CmdINVITE.cpp \
srcs/irc/cmd/CmdLIST.cpp \
srcs/irc/cmd/CmdKICK.cpp \
srcs/irc/cmd/CmdWHO.cpp \
srcs/irc/cmd/CmdWHOIS.cpp \
srcs/irc/cmd/CmdOPER.cpp \
srcs/irc/cmd/CmdQUIT.cpp \
srcs/irc/cmd/CmdPING.cpp \
srcs/irc/cmd/CmdPONG.cpp \
srcs/irc/cmd/CmdMODE.cpp \
srcs/irc/cmd/CmdPRIVMSG.cpp \
srcs/irc/cmd/CmdPART.cpp \
srcs/irc/cmd/CmdTOPIC.cpp \
srcs/irc/cmd/CmdNAMES.cpp \
srcs/irc/cmd/CmdKILL.cpp \
srcs/irc/ISubscriber.cpp \
srcs/irc/User.cpp \
srcs/irc/Users.cpp \
srcs/irc/Channels.cpp \
srcs/irc/Channel.cpp \
srcs/irc/MasterUsers.cpp \
srcs/irc/Server.cpp
HEADERS = include/irc/Server.hpp \
include/irc/User.hpp \
include/irc/Users.hpp \
include/irc/Channel.hpp \
include/irc/Channels.hpp \
include/irc/MasterUsers.hpp \
include/irc/IRCApi.hpp \
include/irc/Config.hpp \
include/irc/Action.hpp \
include/irc/Actions.hpp \
include/irc/Replies.hpp \
include/irc/Role.hpp \
include/irc/Parse.hpp \
include/irc/Masks.hpp \
include/irc/CmdParser.hpp \
include/irc/CmdFactory.hpp \
include/irc/CmdCtx.hpp \
include/irc/cmd/CmdPASS.hpp \
include/irc/cmd/CmdNICK.hpp \
include/irc/cmd/CmdUSER.hpp \
include/irc/cmd/CmdOPER.hpp \
include/irc/cmd/CmdJOIN.hpp \
include/irc/cmd/CmdWHO.hpp \
include/irc/cmd/CmdWHOIS.hpp \
include/irc/cmd/CmdPONG.hpp \
include/irc/cmd/CmdQUIT.hpp \
include/irc/cmd/CmdPRIVMSG.hpp \
include/irc/cmd/CmdPART.hpp \
include/irc/cmd/CmdTOPIC.hpp \
include/irc/cmd/CmdNAMES.hpp \
srcs/irc/cmd/CmdMODE.hpp \
include/network/Network.hpp \
include/network/Selector.hpp \
include/network/File.hpp \
include/network/Socket.hpp \
include/Utils.hpp \
include/App.hpp
SUBDIRS = ${shell find ${SRC_DIR} -type d}
INCLUDE_DIRS = $(shell find ${INC_DIR} -type d)
SRCDIRS = $(SRC_DIR) $(addprefix $(SRC_DIR)/,${SUBDIRS})
BUILD_DIR = build
OBJS = $(addprefix $(BUILD_DIR)/,$(notdir $(SRCS:.cpp=.o)))
vpath %.cpp ${foreach dir, ${SUBDIRS}, ${dir}:}
.PHONY: re clean fclean
NAME = ircserv
all: $(NAME)
$(NAME): $(OBJS)
@echo "Compiling: $(NAME)"
@$(CXX) $(CXXFLAGS) $^ -o $@ $(addprefix -I ,$(INCLUDE_DIRS))
$(OBJS): | mkdir_build
mkdir_build:
@mkdir -p $(BUILD_DIR)
$(BUILD_DIR)/%.o: %.cpp
@printf "Build: %s\n" $<
@$(CXX) $(CXXFLAGS) -c $< -o $@ $(addprefix -I ,$(INCLUDE_DIRS))
re: fclean all
clean:
rm -rf $(BUILD_DIR)
fclean: clean
rm -f $(NAME)