-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
115 lines (93 loc) · 2.19 KB
/
Makefile
File metadata and controls
115 lines (93 loc) · 2.19 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
CC=c++
INCLUDES=$(addprefix -Iincludes/, config\
config/block\
exception\
generator\
header\
interface\
poll\
request\
request/body\
request/form\
response\
session)
CFLAGS=-Wall -Werror -Wextra -MMD -MP -std=c++98 -Iincludes $(INCLUDES) -O2
CONFIG=$(addprefix config/, $(addsuffix .cpp, AllowMethodGroup\
ConfigParser\
ServerConfig\
ServerConfigManager\
ServerConfigManagerBuilder\
$(addprefix block/, BlockConfig\
CgiBlockConfig\
GeneratorBlockConfig\
HttpBlockConfig\
LocationBlockConfig\
ServerBlockConfig)))
EXCEPTION=$(addprefix exception/, $(addsuffix .cpp, ResponseException))
GENERATOR=$(addprefix generator/, $(addsuffix .cpp, CgiResponseGenerator\
ErrorResponseGenerator\
FileUploadGenerator\
HandleCgi\
RedirectResponseGenerator\
ResponseGeneratorParent\
StaticPageResponseGenerator))
HEADER=$(addprefix header/, $(addsuffix .cpp, ContentType\
HeaderBuilder\
HeaderParent\
Method\
ResponseStatus\
Uri))
POLL=$(addprefix poll/, $(addsuffix .cpp, ReadBuffer\
RequestManager\
RequestWrapper\
ResponseWriter\
SocketManager))
REQUEST=$(addprefix request/, $(addsuffix .cpp, Header\
Request\
RequestUri\
$(addprefix body/, FormRequestBody\
RawRequestBody\
RequestBody)\
$(addprefix form/, FormElement\
FormFile\
FormString)))
RESPONSE=$(addprefix response/, $(addsuffix .cpp, Response\
ResponseHeader))
SESSION=$(addprefix session/, $(addsuffix .cpp, Session\
SessionManager))
SRCS= IToString.cpp \
main.cpp \
utils.cpp \
$(CONFIG) \
$(EXCEPTION) \
$(GENERATOR) \
$(HEADER) \
$(POLL) \
$(REQUEST) \
$(RESPONSE) \
$(SESSION)
OBJS=$(SRCS:.cpp=.o)
DEPS=$(SRCS:.cpp=.d)
NAME=webserv
CGI_SRCS=static_pages/cgi_test.cpp
CGI_OBJS=$(CGI_SRCS:.cpp=.o)
CGI_DEPS=$(CGI_SRCS:.cpp=.d)
CGI_NAME=static_pages/a.out
RM=rm -f
all: $(NAME) $(CGI_NAME)
$(NAME): $(OBJS)
$(CC) $(CFLAGS) $(OBJS) -o $(NAME)
$(CGI_NAME): $(CGI_OBJS)
$(CC) $(CFLAGS) $(CGI_OBJS) -o $(CGI_NAME)
%.o: %.cpp
$(CC) $(CFLAGS) -o $@ -c $<
clean:
$(RM) $(OBJS) $(DEPS) $(CGI_OBJS) $(CGI_DEPS)
fclean:
make clean
$(RM) $(NAME) $(CGI_NAME)
re:
make fclean
make all
-include $(DEPS)
-include $(CGI_DEPS)