2014-07-27 14:23:58 +00:00
|
|
|
PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
|
|
|
|
|
|
|
|
ifeq ($(PLATFORM),darwin)
|
|
|
|
FLAGS_BOOST_THREAD = -lboost_thread-mt
|
|
|
|
else
|
|
|
|
FLAGS_BOOST_THREAD = -lboost_thread
|
|
|
|
FLAGS_DEBUG = -g
|
2014-07-29 13:24:04 +00:00
|
|
|
FLAGS_GCOV = -r
|
2014-07-27 14:23:58 +00:00
|
|
|
endif
|
|
|
|
|
2014-07-08 10:00:50 +00:00
|
|
|
binaries=covtest example
|
|
|
|
|
2014-04-14 18:02:48 +00:00
|
|
|
all: covtest example
|
2014-07-08 10:00:50 +00:00
|
|
|
|
2014-05-20 16:17:56 +00:00
|
|
|
example: example.cpp settings.h crow.h http_server.h http_connection.h parser.h http_response.h routing.h common.h utility.h json.h datetime.h logging.h
|
2014-07-27 14:23:58 +00:00
|
|
|
${CXX} -Wall $(FLAGS_DEBUG) -O3 -std=c++1y -o example example.cpp http-parser/http_parser.c -pthread -lboost_system $(FLAGS_BOOST_THREAD) -ltcmalloc_minimal -I http-parser/
|
2014-04-14 18:02:48 +00:00
|
|
|
|
|
|
|
test: covtest
|
|
|
|
|
|
|
|
runtest: example
|
2014-04-01 12:25:16 +00:00
|
|
|
pkill example || exit 0
|
2014-03-31 16:51:50 +00:00
|
|
|
./example &
|
2014-04-01 12:25:16 +00:00
|
|
|
python test.py || exit 0
|
2014-03-31 16:51:50 +00:00
|
|
|
pkill example
|
2014-04-14 18:02:48 +00:00
|
|
|
|
2014-05-20 16:17:56 +00:00
|
|
|
unittest: unittest.cpp routing.h utility.h crow.h http_server.h http_connection.h parser.h http_response.h common.h json.h datetime.h logging.h
|
2014-07-27 14:23:58 +00:00
|
|
|
${CXX} -Wall $(FLAGS_DEBUG) -std=c++1y -o unittest unittest.cpp http-parser/http_parser.c -pthread -lboost_system $(FLAGS_BOOST_THREAD) -I http-parser/
|
2014-04-14 18:02:48 +00:00
|
|
|
./unittest
|
|
|
|
|
2014-05-20 16:17:56 +00:00
|
|
|
covtest: unittest.cpp routing.h utility.h crow.h http_server.h http_connection.h parser.h http_response.h common.h json.h datetime.h logging.h
|
2014-07-27 14:23:58 +00:00
|
|
|
${CXX} -Wall $(FLAGS_DEBUG) -std=c++1y -o covtest --coverage unittest.cpp http-parser/http_parser.c -pthread -lboost_system $(FLAGS_BOOST_THREAD) -I http-parser/
|
2014-04-14 18:02:48 +00:00
|
|
|
./covtest
|
2014-07-29 13:24:04 +00:00
|
|
|
gcov $(FLAGS_GCOV) unittest.cpp
|
2014-04-14 18:02:48 +00:00
|
|
|
|
2014-07-08 10:00:50 +00:00
|
|
|
.PHONY: clean
|
2014-04-02 16:38:08 +00:00
|
|
|
|
2014-07-08 10:00:50 +00:00
|
|
|
clean:
|
|
|
|
rm -f $(binaries) *.o
|