forked from itseugen/Webserv
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (46 loc) · 1.93 KB
/
Makefile
File metadata and controls
71 lines (46 loc) · 1.93 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 --------------------------------- #
# ---------------------------------------------------------------------------- #
# Config #
# ---------------------------------------------------------------------------- #
NAME := webserv
CPP := c++
CPPFLAGS := -Wall -Wextra -Werror -std=c++17
# ---------------------------------------------------------------------------- #
# Files #
# ---------------------------------------------------------------------------- #
OBJ_DIR := ./objs
VPATH := ./utils/ ./server/ ./exceptions/ ./parser/
SRC := main.cpp
UTILS_SRC := utils.cpp
SERVER_SRC := Server.cpp Request.cpp SocketManager.cpp MimeTypes.cpp
EXCEPTIONS_SRC := Exceptions.cpp
PARSER_SRC := stringing/StringHelp.cpp stringing/StringArr.cpp stringing/Pair.cpp \
stringing/Twin.cpp stringing/StringDataTracker.cpp parsing/ConfigParse.cpp \
parsing/ConfigData.cpp parsing/parse_config_file.cpp
LOG_SRC := log/Logger.cpp
SRCS := $(SRC) $(UTILS_SRC) $(SERVER_SRC) $(EXCEPTIONS_SRC) $(PARSER_SRC) $(LOG_SRC)
OBJS := $(addprefix $(OBJ_DIR)/, $(SRCS:%.cpp=%.o))
# ---------------------------------------------------------------------------- #
# Rules #
# ---------------------------------------------------------------------------- #
all: submodule $(NAME)
submodule:
@git submodule update --init --recursive
$(NAME): $(OBJS)
$(CPP) $(CPPFLAGS) $(OBJS) -o $(NAME)
@echo $(GREEN)"Linking $(NAME)!"$(DEFAULT);
$(OBJ_DIR)/%.o: %.cpp
mkdir -p $(dir $@)
$(CPP) $(CPPFLAGS) -c $< -o $@
debug: CPPFLAGS += -g
debug: re
nflag: CPPFLAGS =
nflag: all
clean:
rm -rf $(OBJS)
fclean: clean
rm -f $(NAME)
re: fclean all
.PHONY: all clean fclean re
DEFAULT = "\033[39m"
GREEN = "\033[32m"