-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
84 lines (66 loc) · 1.44 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
NAME := ircserv
CC := c++
RM := rm -f
FLAGS := -Wall -Werror -Wextra -std=c++98 -g
HEADDIR := includes/
HEADLIST := Channel.hpp \
Client.hpp \
Server.hpp \
utils.hpp \
numericsMarcros.hpp \
irc.hpp
HEADERS := $(addprefix ${HEADDIR}, ${HEADLIST})
SRCSDIR := srcs/
SRCSLIST := mode.cpp \
main.cpp \
join.cpp \
nick.cpp \
notice.cpp \
topic.cpp \
user.cpp \
Channel.cpp \
utils.cpp \
ping.cpp \
Client.cpp \
commands.cpp \
invite.cpp \
pass.cpp \
kick.cpp \
Server.cpp \
privmsg.cpp \
part.cpp \
quit.cpp
SRCS := $(addprefix ${SRCSDIR}, ${SRCSLIST})
OBJSDIR := obj/
OBJSLIST := ${SRCSLIST:.cpp=.o}
OBJS := $(addprefix ${OBJSDIR}, ${OBJSLIST})
DEPFILES := $(OBJS:.o=.d)
CYAN := \033[0;36m
RESET := \033[0m
all: ${NAME}
${NAME}: ${OBJS}
@echo "${CYAN}Compiling ${NAME} ...${RESET}"
${CC} ${FLAGS} ${OBJS} -o ${NAME}
@echo "${CYAN}${NAME} Created${RESET}"
-include ${DEPFILES}
${OBJSDIR}%.o: ${SRCSDIR}%.cpp | ${OBJSDIR}
${CC} ${FLAGS} -MMD -c $< -o $@
${OBJSDIR}:
mkdir -p ${OBJSDIR}
.PHONY: all clean fclean re
val: all
make -C ./ clean
valgrind --leak-check=full \
--show-leak-kinds=all \
--track-origins=yes \
--verbose \
--log-file=valgrind-out.txt \
#--track-fds=yes \
./$(NAME) 6667 pass123
clean:
@echo "${CYAN}Deleting ${NAME} Objects ...${RESET}"
${RM} -r ${OBJSDIR}
fclean: clean
@echo "${CYAN}Deleting ${NAME} Executable ...${RESET}"
${RM} ${NAME}
re: fclean all