-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
116 lines (95 loc) · 2.8 KB
/
Makefile
File metadata and controls
116 lines (95 loc) · 2.8 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#--------------------------------#
# Name and file information #
#--------------------------------#
NAME := ircserv
CPP_FILES := main.cpp \
Channel.cpp \
Client.cpp \
Message.cpp \
Server.cpp \
commands/Nick.cpp \
commands/User.cpp \
commands/Quit.cpp \
commands/Join.cpp \
commands/Pass.cpp \
commands/Mode.cpp \
commands/Away.cpp \
commands/Privmsg.cpp \
commands/List.cpp \
commands/Topic.cpp \
commands/Ping.cpp \
commands/Pong.cpp \
commands/Part.cpp \
commands/Invite.cpp \
commands/Notice.cpp \
commands/Whois.cpp \
commands/Who.cpp \
commands/Kick.cpp \
commands/Names.cpp \
commands/Shutdown.cpp
INC_FILES := defines.h \
Channel.hpp \
Client.hpp \
Message.hpp \
Server.hpp \
replies.h \
commands/Nick.hpp \
commands/User.hpp \
commands/Quit.hpp \
commands/Pass.hpp \
commands/Join.hpp \
commands/Mode.hpp \
commands/Away.hpp \
commands/Privmsg.hpp \
commands/List.hpp \
commands/Topic.hpp \
commands/Ping.hpp \
commands/Pong.hpp \
commands/Part.hpp \
commands/Invite.hpp \
commands/Notice.hpp \
commands/Whois.hpp \
commands/Who.hpp \
commands/Kick.hpp \
commands/Names.hpp \
commands/Shutdown.hpp
#---------------------------------------------------------#
# Directory information and object directory building #
#---------------------------------------------------------#
BOTS_DIR := ./bots
INC_DIR := ./includes
INCS = $(addprefix $(INC_DIR)/, $(INC_FILES))
SRC_DIR = ./srcs
SRCS = $(addprefix $(SRC_DIR)/, $(CPP_FILES))
OBJ_DIR = ./obj
OBJS = $(addprefix $(OBJ_DIR)/, $(CPP_FILES:.cpp=.o))
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp $(INCS)
@mkdir -p $(@D)
@echo Compiling $@
@$(CC) $(CFLAGS) -o $@ -c $<
#--------------------------------#
# Compiler settings and flags #
#--------------------------------#
CC = c++
RM = rm -rf
CFLAGS = -Wall -Wextra -Werror -Wshadow -Wno-shadow -std=c++98 -I$(INC_DIR) -g
#--------------------------------#
# Makefile rules and targets #
#--------------------------------#
all: $(NAME)
@echo Compiled executable $(NAME).
bots:
@echo Launching Bots..
@make -s run -C $(BOTS_DIR)
$(NAME): $(OBJS)
@$(CC) $(CFLAGS) -o $(NAME) $(OBJS)
clean:
@$(RM) $(OBJ_DIR)
@echo Clean complete.
clean_bots:
@make -s fclean -C $(BOTS_DIR)
fclean: clean clean_bots
@$(RM) $(NAME)
@echo Full clean complete.
re: fclean $(NAME)
.PHONY: all bots clean clean_bots fclean re