forked from levensta/IRC-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (47 loc) · 1.37 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
NAME= ircserv
SOURCEFILES= main.cpp \
Server.cpp \
User.cpp \
Message.cpp \
utils.cpp \
sendError.cpp \
sendReply.cpp \
Channel.cpp \
History.cpp \
Hash.cpp \
commands/channelCommands.cpp \
commands/otherCommands.cpp \
commands/registrationCommands.cpp \
commands/userCommands.cpp \
commands/ircOperatorCommands.cpp
LIBJSONFOLDER = json-parser
LIBJSONFLAGS = -ljson -L ./$(LIBJSONFOLDER) -I ./$(LIBJSONFOLDER)/src
BOTFOLDER = bot/
SOURCEFOLDER= srcs/
OSOURCEFOLDER= objects/
INCLUDEFOLDER= include/
SOURCE= $(addprefix $(SOURCEFOLDER), $(SOURCEFILES))
OSOURCE= $(addprefix $(OSOURCEFOLDER), $(SOURCEFILES:.cpp=.o))
all: libjson bot $(NAME)
$(OSOURCEFOLDER):
mkdir objects
mkdir objects/commands
$(OSOURCEFOLDER)%.o: $(SOURCEFOLDER)%.cpp
clang++ -Wall -Werror -Wextra -c $< -o $@ -std=c++98 -I $(INCLUDEFOLDER) -I ./$(LIBJSONFOLDER)/src
libjson:
@if ! [ "$(ls $(LIBJSONFOLDER))" ] ; then git submodule update --init; fi
$(MAKE) -C $(LIBJSONFOLDER) all
bot:
$(MAKE) -C $(BOTFOLDER) all
$(NAME): $(OSOURCEFOLDER) $(OSOURCE)
clang++ $(OSOURCE) -o $(NAME) $(LIBJSONFLAGS)
clean:
$(MAKE) -C $(LIBJSONFOLDER) clean
$(MAKE) -C $(BOTFOLDER) clean
rm -rf $(OSOURCEFOLDER)
fclean: clean
$(MAKE) -C $(LIBJSONFOLDER) fclean
$(MAKE) -C $(BOTFOLDER) fclean
rm -rf $(NAME)
re: fclean all
.PHONY: clean fclean re all bot libjson