Crow/Makefile

39 lines
1.4 KiB
Makefile
Raw Normal View History

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
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/
test: covtest
runtest: example
2014-04-01 12:25:16 +00:00
pkill example || exit 0
./example &
2014-04-01 12:25:16 +00:00
python test.py || exit 0
pkill example
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/
./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/
./covtest
2014-07-29 13:24:04 +00:00
gcov $(FLAGS_GCOV) unittest.cpp
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