-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile.example
More file actions
97 lines (72 loc) · 2.56 KB
/
Copy pathMakefile.example
File metadata and controls
97 lines (72 loc) · 2.56 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile.example :+: :+: :+: #
# +:+ +:+ +:+ #
# By: tmitsuya <tmitsuya@student.codam.nl> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2025/10/27 11:02:13 by dlippelt #+# #+# #
# Updated: 2026/01/15 19:35:20 by tmitsuya ### ########.fr #
# #
# **************************************************************************** #
NAME = ircserv
CXX = c++
RM = rm -rf
MKDIR = mkdir -p
VALG = valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes
CXXSTD = -std=c++17
CXXFLAGS = -Wall -Werror -Wextra -g3
IFLAGS = -I$(INCDIR)
DEPFLAGS = -MMD -MP
COMPILE = -c
OUTPUT = -o
SRCDIR = ./src
INCDIR = ./inc
OBJDIR = ./obj
MAIN = main.cpp
MAIN_OBJ = $(addprefix $(OBJDIR)/, $(MAIN:.cpp=.o))
SRCS = server/Server.cpp \
server/User.cpp \
server/Channel.cpp \
server/NumericReply.cpp \
operations/Message.cpp \
operations/AOperation.cpp \
operations/Pass.cpp \
operations/Nick.cpp \
operations/UserHost.cpp \
operations/Join.cpp \
operations/Topic.cpp \
operations/Mode.cpp \
operations/Invite.cpp \
operations/Kick.cpp \
operations/Privmsg.cpp \
TEST_OUT = test_ircserv
TEST_MAIN = test_Server.cpp
TEST_MAIN_OBJ = $(addprefix $(OBJDIR)/, $(TEST_MAIN:.cpp=.o))
OBJS = $(addprefix $(OBJDIR)/, $(SRCS:.cpp=.o))
DEPS = $(OBJS:.o=.d)
OBJDIRS = $(sort $(dir $(OBJS)))
all: $(NAME)
$(OBJDIRS):
$(MKDIR) $@
$(NAME): $(OBJDIRS) $(MAIN_OBJ) $(OBJS)
$(CXX) $(CXXFLAGS) $(MAIN_OBJ) $(OBJS) $(OUTPUT) $@
test: $(TEST_OUT)
clear
./$(TEST_OUT)
$(TEST_OUT): $(OBJDIRS) $(TEST_MAIN_OBJ) $(OBJS)
$(CXX) $(CXXFLAGS) $(TEST_MAIN_OBJ) $(OBJS) $(OUTPUT) $@
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
$(CXX) $(CXXSTD) $(CXXFLAGS) $(DEPFLAGS) $(IFLAGS) $(COMPILE) $< $(OUTPUT) $@
clean:
$(RM) $(OBJDIR)
$(RM) *.xml
fclean: clean
$(RM) $(NAME) $(TEST_OUT)
re: fclean all
valg: $(NAME)
$(VALG) ./$(NAME) $(ARGS)
memory: CXXFLAGS += -fsanitize=address
memory: re
-include $(DEPS)
.PHONY: all clean fclean re valg memory test