-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (55 loc) · 2.15 KB
/
Makefile
File metadata and controls
71 lines (55 loc) · 2.15 KB
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
# **************************************************************************** #
# #
# :::::::: #
# Makefile :+: :+: #
# +:+ #
# By: ohengelm <ohengelm@student.42.fr> +#+ #
# +#+ #
# Created: 2023/10/19 20:26:08 by ohengelm #+# #+# #
# Updated: 2023/10/19 20:26:09 by ohengelm ######## odam.nl #
# #
# **************************************************************************** #
NAME = ircserv
CC = c++
CFLAGS += -Wall -Wextra -Werror
CFLAGS += -std=c++11
DEPFLAGS += -MMD -MF $(DEP_DIR)$*.d
INCL_HDR := $(shell find . -type f -name '*.hpp' -exec dirname "{}" \; | \
uniq | sed -e 's/^/-I/g')
SRC = $(SRC_MAIN:%.cpp= $(SRC_DIR)%.cpp)\
$(SRC_ACLASS:%.cpp= $(SRC_DIR)%.cpp)\
$(SRC_CLASS:%.cpp= $(SRC_DIR)%.cpp)\
$(SRC_FUNC:%.cpp= $(SRC_DIR)%.cpp)\
$(SRC_NMSPC:%.cpp= $(SRC_DIR)%.cpp)
SRC_DIR = src/
SRC_MAIN = main.cpp
SRC_FUNC = setEnv.cpp verboseCheck.cpp
SRC_CLASS = Server.cpp Channel.cpp
SRC_ACLASS = AClient.cpp Client.cpp ServerBot.cpp BotTicTacToe.cpp RockBot.cpp
SRC_NMSPC = Parse.cpp Command.cpp
DIRS = $(OBJ_DIR) $(DEP_DIR)
OBJ_DIR = obj/
OBJ = $(SRC:$(SRC_DIR)%.cpp=$(OBJ_DIR)%.o)
DEP_DIR = dep/
DEP = $(SRC:$(SRC_DIR)%.cpp=$(DEP_DIR)%.d)
all: $(DIRS) $(NAME)
$(DIRS):
@mkdir $(DIRS)
$(NAME): $(OBJ)
@printf "Linking object files together in binary: %s\n" $@
@$(CC) $(CFLAGS) $(OBJ) -o $(NAME)
$(OBJ_DIR)%.o: $(SRC_DIR)%.cpp
@printf "Compiling object file: %s\n" $@
@$(CC) $(CFLAGS) $(DEPFLAGS) $(INCL_HDR) -c $< -o $@
-include $(DEP)
subject: all
./$(NAME) 6667 password
clean:
@rm -f $(OBJ)
@rm -f $(DEP)
fclean: clean
@rm -f $(NAME)
@rm -f ._*
@rmdir $(DIRS) 2> /dev/null || true
re: fclean all
.PHONY: all clean fclean re subject