-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
93 lines (73 loc) · 2.63 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
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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: fgalaup <fgalaup@student.42lyon.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/07/03 15:18:41 by fgalaup #+# #+# #
# Updated: 2022/01/17 13:32:46 by fgalaup ### ########lyon.fr #
# #
# **************************************************************************** #
NAME = ircserv
# Dirrectory
BINARY_DIR := Bin
SOURCES_DIR := Sources
INCLUDES_DIR := Includes
CC := clang++
RM := rm -f
CFLAGS := -Wall -Wextra -Werror -fsanitize=address -fsanitize=undefined
INCLUDES := -I $(INCLUDES_DIR) -g3
HEADERS_FILES := IRC.hpp \
Core/Core.hpp \
Core/Logging.hpp \
Core/ConnectionManager.hpp \
/Bot/Bot.hpp \
Resources/Chanel.hpp \
Resources/Client.hpp \
Resources/Message.hpp \
Resources/Request.hpp \
Resources/Responce.hpp \
Utilites/Networks/Socket.hpp \
Utilites/Networks/Connection.hpp
SOURCE_FILES := Core/Core.cpp \
Core/Logging.cpp \
Core/ConnectionManager.cpp \
Bot/Bot.cpp \
Resources/Commands.cpp \
Resources/Chanel.cpp \
Resources/Client.cpp \
Resources/Message.cpp \
Resources/Request.cpp \
Resources/Responce.cpp \
Utilities/Networks/Socket.cpp \
Utilities/Networks/Connection.cpp \
Commands/NICK.cpp \
Commands/OPER.cpp \
Commands/PING.cpp \
Commands/USER.cpp \
Commands/JOIN.cpp \
Commands/PART.cpp \
Commands/PRIVMSG.cpp \
Commands/NOTICE.cpp \
Commands/KICK.cpp \
Commands/PASS.cpp \
Commands/KILL.cpp \
Commands/QUIT.cpp \
Commands/SHUTDOWN.cpp
OBJS := $(addprefix $(BINARY_DIR)/, $(SOURCE_FILES:.cpp=.o))
HEADERS_FILES := $(addprefix $(INCLUDES_DIR)/, $(HEADERS_FILES))
LIBRARIES = -lpthread
all: $(NAME)
$(NAME): $(OBJS) $(HEADERS_FILES)
$(CC) $(CFLAGS) $(OBJS) -o $(NAME) $(LIBRARIES)
$(BINARY_DIR)/%.o: $(SOURCES_DIR)/%.cpp $(HEADERS_FILES)
@mkdir -p $(dir $@);
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ -O3
clean:
$(RM) $(OBJS)
find . -type d -empty -delete
fclean: clean
$(RM) $(NAME)
re: fclean all
.PHONY: all clean fclean re