-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (60 loc) · 2.07 KB
/
Makefile
File metadata and controls
77 lines (60 loc) · 2.07 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
# Color variables
RESET = \033[0m
BOLD = \033[1m
GREEN = \033[1;32m
CYAN = \033[1;36m
YELLOW = \033[33m
BLUE = \033[94m
NAME = ircserv
INCLUDE_DIR := ./include
SRC = main.cpp \
\
src/server/server.cpp \
src/channel/Channel.cpp \
src/client/Client.cpp \
\
src/commands/ICommands.cpp \
src/commands/JoinCommand.cpp \
src/commands/NickCommand.cpp \
src/commands/UserCommand.cpp \
src/commands/WhoisCommand.cpp \
src/commands/ModeCommand.cpp \
src/commands/PassCommand.cpp \
src/commands/PingCommand.cpp \
src/commands/CapCommand.cpp \
src/commands/QuitCommand.cpp \
OBJ = $(SRC:.cpp=.o)
CXX = c++
CXXFLAGS = -Wall -Werror -Wextra -g3 -std=c++98 -I$(INCLUDE_DIR)
RM = rm -rf
all: $(NAME) irssi
$(NAME): $(OBJ)
@$(CXX) $(CXXFLAGS) $(OBJ) -o $(NAME)
clean:
@$(RM) $(OBJ)
fclean: clean
@$(RM) $(NAME)
re: fclean all
leaks:
valgrind --log-file=valgrind_output.txt ./ircserv 1212 1
# Target rules
.PHONY: all clean fclean re leaks
# Help message
help:
@echo ""
@echo "$(BOLD)Available rules:$(RESET)"
@echo " $(CYAN)all$(RESET)\t\t: Compile and build IRC server"
@echo " $(CYAN)clean$(RESET)\t\t: Remove object files"
@echo " $(CYAN)fclean$(RESET)\t: Remove object files and executable"
@echo " $(CYAN)re$(RESET)\t\t: Clean and rebuild the executable"
@echo " $(CYAN)leaks$(RESET)\t\t: Run valgrind to check for leaks"
@echo ""
@echo "$(YELLOW)Note:$(RESET)"
@echo "$(BLUE)\tThe 'make leaks' rule will create a valgrind_output.txt file and"
@echo "\trun the server on port 1212 with the password 1."
@echo "\tIf you want to run the server on another port or with another password,"
@echo "\tyou will need to modify the Makefile."
@echo ""
# Default rule
.DEFAULT_GOAL := help
#❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄❄︎❄