-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
76 lines (54 loc) · 2.4 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
73
74
75
#Credits to Team05 for helping with the HTTPS deployment parameters for use with docker
CXX=g++
CXXOPTIMIZE= -O2
CXXFLAGS= -g -Wall -std=c++11 #-Wl,--no-as-needed -std=c++11
LDFLAGS= -static-libgcc -static-libstdc++ -pthread -Wl,-Bstatic -lssl -lcrypto -lboost_thread -lboost_filesystem -lboost_system -lboost_regex -Wl,-Bdynamic -ldl
SRCFILES = server.cpp response.cpp request.cpp request_parser.cpp config.cc config_parser.cc request_handler.cpp echo_handler.cpp file_handler.cpp not_found_handler.cpp status_handler.cpp server_stats.cpp proxy_handler.cpp spaceteam_proxy_handler.cpp cpp-markdown/markdown.cpp cpp-markdown/markdown-tokens.cpp
GTEST_DIR = googletest/googletest
GMOCK_DIR = googletest/googlemock
all: CXXFLAGS += $(CXXOPTIMIZE)
all: SRCFILES += main.cpp
all: webserver
test: CXXFLAGS += -isystem ${GTEST_DIR}/include -isystem ${GMOCK_DIR}/include
test: SRCFILES += config_parser_test.cc config_test.cc server_test.cpp response_test.cpp file_handler_test.cpp request_parser_test.cpp echo_handler_test.cpp not_found_handler_test.cpp status_handler_test.cpp server_stats_test.cpp proxy_handler_test.cpp ${GTEST_DIR}/src/gtest_main.cc libgtest.a
test: | clean webserver_test
build_image:
./build_image.sh
build_image_https:
./build_image_https.sh
run_image:
docker run --rm -t -p 8080:8080 httpserver
run_image_https:
docker run --rm -t -p 8081:8081 httpsserver
deploy:
./deploy.sh
deployHttps:
./deploy_https.sh
run:
./webserver config
run_https:
./webserver httpsconfig
run_coverage:
./webserver_test
gcov -r server.cpp response.cpp config.cc config_parser.cc request_parser.cpp echo_handler.cpp file_handler.cpp request.cpp not_found_handler.cpp status_handler.cpp server_stats.cpp proxy_handler.cpp base_
webserver:
$(CXX) -I /usr/include/boost/ -o $@ $^ $(CXXFLAGS) $(SRCFILES) $(LDFLAGS)
webserver_test:
$(CXX) $(CXXFLAGS) -I${GTEST_DIR} -c ${GTEST_DIR}/src/gtest-all.cc
ar -rv libgtest.a gtest-all.o
$(CXX) -I /usr/include/boost/ -o $@ $^ $(CXXFLAGS) -fprofile-arcs -ftest-coverage $(SRCFILES) $(LDFLAGS)
clean:
rm -rf *.o *.gcov *.gcda *.gcno webserver webserver_test
integration:
make clean && make
python reverse_proxy_integration.py
integration_302:
make clean && make
python reverse_proxy_302_integration.py
spaceteam_proxy:
make clean && make
./proxy_handler_integration_test.sh
spaceteam_302:
make clean && make
./spaceteam_302_redirect_integration_test.sh
.PHONY: all clean deploy