-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
83 lines (62 loc) · 3.1 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: aweizman <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/10/09 15:34:56 by padam #+# #+# #
# Updated: 2024/11/11 15:11:08 by aweizman ### ########.fr #
# #
# **************************************************************************** #
NAME = ircserv
CC = c++
CFLAGS = $(INCLUDES) -g3 -std=c++17 -Wall -Wextra -Werror
INCLUDES = -I./include
LIBS =
SRC_PATH = src
OBJ_PATH = obj
OBJ_DIRS = commands server
SRCS_MAIN = main.cpp Client.cpp Channel.cpp
SRCS_SERV = Server.cpp ServerPoll.cpp ServerAdministrative.cpp
SRCS_CMD = KICK.cpp MODE.cpp INVITE.cpp JOIN.cpp PART.cpp TOPIC.cpp NICK.cpp PRIVMSG.cpp PASS.cpp USER.cpp QUIT.cpp CAP.cpp
SRC_NAME = $(SRCS_MAIN) \
$(addprefix commands/, $(SRCS_CMD)) \
$(addprefix server/, $(SRCS_SERV)) \
RED = \033[1;31m
GREEN = \033[1;32m
BLUE = \033[1;34m
YELLOW = \033[1;33m
RESET = \033[0m
OBJ_NAME = $(SRC_NAME:.cpp=.o)
OBJS = $(addprefix $(OBJ_PATH)/,$(OBJ_NAME))
all: $(NAME)
$(NAME): ascii_art $(OBJS)
@$(CC) -o $(NAME) $(CFLAGS) $(LIBS) $(OBJS)
@printf "$(GREEN)%-100s\n$(RESET)" "$(NAME) compiled"
$(OBJ_PATH) :
@mkdir -p $(OBJ_PATH)
ifneq ($(OBJ_DIRS),)
@mkdir -p $(addprefix $(OBJ_PATH)/,$(OBJ_DIRS))
endif
$(OBJ_PATH)/%.o: $(SRC_PATH)/%.cpp | $(OBJ_PATH)
@printf "%-100s\r" "$(CC) $(CFLAGS) -o $@"
@$(CC) $(CFLAGS) -o $@ -c $<
init_submodules:
git submodule update --init --recursive
update_submodules:
git submodule update --recursive --remote
clean:
@rm -rf $(OBJ_PATH)
fclean: clean
@rm -f $(NAME)
re: fclean all
ascii_art:
@clear
@printf "$(GREEN) \n\
\n\
\n\
\n\
$(BLUE)by: padam && aweizman$(RESET) \n\
\n"
.PHONY: all, $(NAME), $(LIBFT_DIR)/libft.a, $(OBJ_PATH), $(OBJ_PATH), clean, fclean, re