-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
67 lines (47 loc) · 2.12 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: jariza-o <jariza-o@student.42malaga.com +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/05/14 11:54:06 by jariza-o #+# #+# #
# Updated: 2024/05/28 13:01:19 by jariza-o ### ########.fr #
# #
# **************************************************************************** #
CFLAGS = -Wall -Werror -Wextra -std=c++98 -I./include
SRC = src/main.cpp src/channel.cpp src/command.cpp src/server.cpp \
src/socket_manager.cpp src/user.cpp src/commands/nick.cpp \
src/replies.cpp src/commands/join.cpp src/commands/mode.cpp \
src/commands/pass.cpp src/commands/user.cpp src/validation.cpp \
src/tracer.cpp src/commands/quit.cpp src/commands/privmsg.cpp \
src/commands/part.cpp src/commands/kick.cpp \
src/commands/invite.cpp src/commands/topic.cpp
SRC_BONUS = src_bonus/bot.cpp src_bonus/main.cpp
OBJ = $(addprefix obj/, $(SRC:.cpp=.o))
OBJ_BONUS = $(addprefix obj/, $(SRC_BONUS:.cpp=.o))
NAME = ircserv
NAME_BONUS = bot
COMPILER = g++
all: $(NAME)
$(NAME): ${OBJ}
@${COMPILER} ${CFLAGS} ${OBJ} -o ${NAME}
obj/%.o: %.cpp
@mkdir -p $(dir $@)
@${COMPILER} ${CFLAGS} -c $< -o $@
clean:
@rm -rf ${OBJ} ${OBJ_bonus} obj/
fclean: clean
@rm -f ${NAME} ${NAME_BONUS}
fclean_bonus: clean
@rm -f ${NAME_BONUS}
re: fclean all
r: fclean all
@./ircserv 12345 1111
bonus: $(NAME_BONUS)
$(NAME_BONUS): ${OBJ_BONUS}
@${COMPILER} ${CFLAGS} ${OBJ_BONUS} -o ${NAME_BONUS}
re_bonus: fclean_bonus bonus
valgrind: all
@valgrind --leak-check=full ./ircserv 12345 1111
.PHONY: all clean fclean fclean_bonus re r valgrind bonus re_bonus