-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (47 loc) · 1.19 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
SERVER=ircserv
MAKEFLAGS += -j
RED="\033[0;31m Warining: "
GREEN="\033[3;32m"
ANCI_INIT="\033[0m"
CXX=c++
CXXFLAGS=-Wall -Wextra -Werror
CXXFLAGS+=-std=c++98
# CXXFLAGS+=-g3 -fsanitize=address
RM=rm -rf
SRCS_SERVER= main.cpp \
src/Channel.cpp \
src/Client.cpp \
src/Command.cpp \
src/Error.cpp \
src/Msg.cpp \
src/Server.cpp \
src/Util.cpp \
Command/Invite.cpp \
Command/Join.cpp \
Command/Kick.cpp \
Command/Mode.cpp \
Command/Nick.cpp \
Command/Part.cpp \
Command/Pass.cpp \
Command/Privmsg.cpp \
Command/Quit.cpp \
Command/Topic.cpp \
Command/User.cpp
OBJS_SERVER = $(SRCS_SERVER:.cpp=.o)
all: $(SERVER)
$(SERVER): $(OBJS_SERVER)
@$(CXX) $(CXXFLAGS) $(OBJS_SERVER) $(LIBFT) -o $(SERVER) \
%.o: %.cpp
@$(CXX) $(CXXFLAGS) -c $< -o $@ \
&& echo $(GREEN)"Compiled successful!" $<$(ANCI_INIT) \
|| echo $(RED)"Failed to compile $<"$(ANCI_INIT);
clean:
@$(RM) $(OBJS_SERVER) \
&& echo $(GREEN)"Clean successful!"$(ANCI_INIT) \
|| echo $(RED)"Clean failed!"$(ANCI_INIT);
fclean: clean
@$(RM) $(SERVER) \
&& echo $(GREEN)"fclean successful!"$(ANCI_INIT) \
|| echo $(RED)"fclean failed!"$(ANCI_INIT);
re: fclean all
.PHONY: all clean fclean re