forked from timsort/cpp-TimSort
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (28 loc) · 891 Bytes
/
Makefile
File metadata and controls
39 lines (28 loc) · 891 Bytes
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
COMPILE := $(CXX) -I. -Wall -Wextra -g $(CXXFLAGS)
OPTIMIZE := -DNDEBUG -O2
LIB_BOOST_TEST := -lboost_unit_test_framework-mt
all:
@echo This library is a C++ header file only.
.bin:
mkdir -p .bin
test: test/test.cpp timsort.hpp .bin
$(COMPILE) $(LIB_BOOST_TEST) $< -o .bin/$@
time ./.bin/$@
test-with-optimization: test/test.cpp timsort.hpp .bin
$(COMPILE) $(OPTIMIZE) $(LIB_BOOST_TEST) $< -o .bin/$@
time ./.bin/$@
test-with-std-move: test/test.cpp timsort.hpp .bin
$(COMPILE) $(LIB_BOOST_TEST) -std=c++11 -DENABLE_STD_MOVE $< -o .bin/$@
time ./.bin/$@
bench: example/bench.cpp timsort.hpp .bin
$(COMPILE) $(OPTIMIZE) $< -o .bin/$@
$(CXX) -v
./.bin/$@
coverage:
make test CXXFLAGS="-coverage -O0"
gcov test.gcda | grep -A 1 "File './timsort.hpp'"
mv timsort.hpp.gcov coverage.txt
rm -rf *.gc*
clean:
rm -rf *~ .bin coverage.txt
.PHONY: test bench coverage clean