-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
72 lines (58 loc) · 1.55 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
ROOT = ./sources
NAME = webserv
CXX = clang++
CXXFLAGS = -Wall -Werror -Wextra -Iincludes -std=c++98 -pedantic
#-fsanitize=address -g3
SRC = main.cpp \
$(ROOT)/Config.cpp \
$(ROOT)/ConfigMatcher.cpp \
$(ROOT)/HttpInfo.cpp \
$(ROOT)/HttpValidator.cpp \
$(ROOT)/InputOutput.cpp \
$(ROOT)/Data.cpp \
$(ROOT)/Request.cpp \
$(ROOT)/ConnectionHandler.cpp \
$(ROOT)/CgiHandler.cpp \
$(ROOT)/FileHandler.cpp \
$(ROOT)/Monitor.cpp \
$(ROOT)/FdTable.cpp \
$(ROOT)/EventHandler.cpp \
$(ROOT)/Processor.cpp \
$(ROOT)/GetProcessor.cpp \
$(ROOT)/DeleteProcessor.cpp \
$(ROOT)/PostProcessor.cpp \
$(ROOT)/UrlParser.cpp \
$(ROOT)/utils.cpp \
$(ROOT)/Response.cpp \
$(ROOT)/Server.cpp
OBJ = $(SRC:.cpp=.o)
all: $(NAME)
$(NAME): $(OBJ)
$(CXX) $(CXXFLAGS) $(OBJ) -o $(NAME)
start:
@sh server_content_setup.sh
./webserv tests/tmp_config.json
config:
$(CXX) $(CXXFLAGS) $(ROOT)/Config.cpp ./tests/config.cpp -o config
config_multi:
$(CXX) $(CXXFLAGS) $(ROOT)/Config.cpp ./tests/multi_config.cpp -o config
@touch sample_test_config.json
@./config tests/multi_config.json sample_test_config.json
@rm sample_test_config.json config
url_parser:
$(CXX) $(CXXFLAGS) $(ROOT)/UrlParser.cpp ./tests/urlParser.cpp -o url_parser
@./url_parser
@rm url_parser
utils:
$(CXX) $(CXXFLAGS) $(ROOT)/utils.cpp ./tests/utils.cpp -o utils
@./utils
@rm utils
clean:
rm -rf $(OBJ)
fclean: clean
rm -rf $(NAME)
@rm -f config tests/tmp_config.json
@rm -rf tests/www
re: fclean $(NAME)
.PHONY: all start config config_multi url_parser \
utils clean fclean re