-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
79 lines (59 loc) · 1.28 KB
/
Makefile
File metadata and controls
79 lines (59 loc) · 1.28 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
72
73
74
75
76
77
78
79
# Sources
SRC_FOLDERS = src \
src/http \
src/utils \
src/config \
src/network \
src/handler \
VPATH = $(SRC_FOLDERS)
SRCS_NO_MAIN= Config.cpp \
Token.cpp \
Lexer.cpp \
Validator.cpp \
Throw.cpp \
Parser.cpp \
ServerEngine.cpp \
ServerSocket.cpp \
ClientConnection.cpp \
Request.cpp \
RequestParser.cpp \
Response.cpp \
FileBufferReader.cpp \
RequestHandler.cpp \
GetHandler.cpp \
PostHandler.cpp \
DeleteHandler.cpp \
HTTP.cpp \
Log.cpp \
Utils.cpp \
CGIHandler.cpp \
SRCS = main.cpp $(SRCS_NO_MAIN)
# Includes
INCLUDES_DIRS = $(SRC_FOLDERS)
INCLUDE_FLAG = $(addprefix -I, $(INCLUDES_DIRS))
# Compilation
NAME = webserv
CPP = c++
CPPFLAGS = -Wall -Wextra -Werror -std=c++17 $(INCLUDE_FLAG) #-g -fsanitize=address
OBJS_DIR = obj
OBJS = $(addprefix $(OBJS_DIR)/, $(SRCS:.cpp=.o))
all: $(NAME)
@echo "\033[92mexecute with: \033[1;92m"./$(NAME)"\033[0m"
$(NAME): $(OBJS)
$(CPP) $(CPPFLAGS) $(OBJS) -o $(NAME)
$(OBJS_DIR)/%.o: %.cpp
@mkdir -p $(dir $@)
$(CPP) $(CPPFLAGS) -c $< -o $@
clean:
rm -f $(OBJS)
fclean: clean
rm -f $(NAME)
re: fclean all
t: $(NAME)
@./$(NAME) default.conf
ret: re t
debug: CPPFLAGS += -g
debug: $(NAME)
fdebug: fclean
fdebug: CPPFLAGS += -g
fdebug: $(NAME)