-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
88 lines (69 loc) · 2.45 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
# --------------------------- Terminal Color Codes --------------------------- #
NNN := \033[1;0m
RED := \033[1;31m
GRN := \033[1;32m
BLU := \033[1;34m
GRA := \033[1;37m
# ----------------------------- Project Title ------------------------------- #
define TITLE
${GRN}
:::::::::: ::::::::::: ::::::::::: ::::::::: ::::::::
:+: :+: :+: :+: :+: :+: :+:
+:+ +:+ +:+ +:+ +:+ +:+
:#::+::# +#+ +#+ +#++:++#: +#+
+#+ +#+ +#+ +#+ +#+ +#+
#+# #+# #+# #+# #+# #+# #+#
### ### ########## ########### ### ### ########
${NNN}${GRA}
- Created By : ${RED}Mohamed Amine ${BLU}/\\ \
${RED}Hssain ${BLU}/\\ ${RED}Abdellah${NNN}\n
endef
export TITLE
# ---------------------------------- Variables ------------------------------- #
CC := c++
CC_FLAGS := -Wall -Wextra -Werror -std=c++98 -fsanitize=address -static-libsan -g
NAME := ircserv
MAIN := requirements/ircserv.main.cpp
HEADER := requirements/ircserv.head.hpp
SRCS_DIR := requirements/srcs/
SRCS_LST := Server.class.cpp \
Clients.class.cpp \
Channels.class.cpp \
handdle_JOIN.cpp \
Bot.cpp \
Misc.functions.cpp \
PRIVMSG_NOTICE_utils.cpp \
handdle_PRIVMSG.cpp \
handdle_NOTICE.cpp \
handdle_PART.cpp \
handdle_KICK.cpp \
handdle_TOPIC.cpp \
Quit.cpp \
Nick.cpp \
handle_MODE.cpp \
handle_INVITE.cpp
SRCS := ${addprefix ${SRCS_DIR}, ${SRCS_LST}}
OBJS_DIR := requirements/objs/
OBJS_LST := ${patsubst %.cpp, %.obj, ${SRCS_LST}}
OBJS := ${addprefix ${OBJS_DIR}, ${OBJS_LST}}
# ---------------------------------- Rules ----------------------------------- #
all: title ${NAME}
${NAME}: ${OBJS_DIR} ${OBJS} ${HEADER} ${MAIN}
@${CC} ${CC_FLAGS} ${MAIN} ${OBJS} -o ${NAME}
@echo "${GRN}Compiled [${NAME}] Successfully!${NNN}"
${OBJS_DIR}%.obj: ${SRCS_DIR}%.cpp ${HEADER}
@${CC} ${CC_FLAGS} -c $< -o $@
@echo "${BLU}Compiled $< Successfully!${NNN}"
${OBJS_DIR}:
@mkdir ${OBJS_DIR}
clean:
@rm -rf ${OBJS_DIR}
@echo "${RED}Removed [${OBJS_DIR}] Successfully!${NNN}"
fclean: clean
@rm -f ${NAME}
@echo "${RED}Removed [${NAME}] Successfully!${NNN}"
re: fclean all
.PHONY: all clean fclean re title
title:
@clear
@echo "$$TITLE"