-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (59 loc) · 1.79 KB
/
Makefile
File metadata and controls
76 lines (59 loc) · 1.79 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
# This is a top-level Makefile. It contains project-wide compiler settings and
# variable definitions. The recipes it provides are:
# compile (default) -> build source code only
# lib -> build third party libraries
# test -> build unit tests
# clean
# Project-wide compiler settings.
export CXX=g++
export CXXFLAGS=-c -std=c++11 -Wall -Wextra -Werror
export LDFLAGS=-lpython2.7 -static-libgcc -static-libstdc++ -lpthread -Wl,-Bstatic -lgcov --coverage -lboost_system -lboost_thread -lboost_regex
export DEBUG_FLAGS=-DDEBUG -g
ifdef VERBOSE
export DEBUG_FLAGS+=-DDEBUG_VERBOSE
endif
# Get directory of this Makefile, AKA the top-level directory of the project.
# Adapted from this stackoverflow post: http://stackoverflow.com/a/18137056
MAKEFILE_PATH=$(abspath $(lastword $(MAKEFILE_LIST)))
export PROJ_ROOT=$(patsubst %/,%,$(dir $(MAKEFILE_PATH)))
export OBJ_DIR=$(PROJ_ROOT)/build
export BIN_DIR=$(PROJ_ROOT)/bin
export GTEST_DIR=$(PROJ_ROOT)/lib/googletest/googletest
export PARSER_DIR=$(PROJ_ROOT)/lib/nginx-configparser
.PHONY: compile
compile: lib
$(MAKE) -C src
.PHONY: debug
debug: lib
$(MAKE) -C src debug
.PHONY: lib
lib:
$(MAKE) -C lib
.PHONY: test
test: lib
$(MAKE) -C src test
$(MAKE) -C test
cd bin && ./webserver_tests
.PHONY: proxy-test
proxy-test: lib
$(MAKE) -C src test
$(MAKE) -C test
cd bin && ./proxy_webserver_tests
.PHONY: int-test
int-test: test
scripts/integration.sh && scripts/multithread_test.sh 2 && scripts/proxy_integration_test.sh
.PHONY: proxy-int-test
proxy-int-test: lib
scripts/proxy_integration_test.sh
.PHONY: proxy-302-test
proxy-302-test: lib
scripts/proxy_302_test.sh
.PHONY: gcov
gcov: test
gcov -o $(OBJ_DIR) -r src/*
.PHONY: clean
clean:
$(MAKE) -C src clean
$(MAKE) -C test clean
$(MAKE) -C lib clean
rm -rf $(OBJ_DIR)/*.gcda $(OBJ_DIR)/*.gcno