-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
98 lines (95 loc) · 2.94 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
help:
@echo "Usage:"
@echo " make help"
@echo " make shared"
@echo " make static"
@echo " make release"
@echo " make tests"
@echo " make doc"
@echo " make cppcheck"
@echo " make debug"
@echo " make paranoid"
@echo " make coverage"
@echo " make coverage-report"
@echo " make init"
@echo " make clean"
@echo " make update"
@echo " make upgrade"
@echo " make install"
@echo " make docker-build"
@echo " make docker-run"
@echo " make docker-rm"
@echo "Example:"
@echo " make static "
@echo " make shared VERBOSE=1 ARGS=-j5"
@echo " BUILD_SHARED_LIBS=ON make tests"
@echo " make install ARGS=\"--prefix ./build/test-install\""
CMAKE ?= cmake
PRJ = `basename ${PWD}`
doc:
rm -rf docs
if hash doxygen 2>/dev/null; then doxygen; fi
runup:
mkdir -p build
rm -rf ./build/CMakeCache.txt
if [ ! -d external/cmake-ci/cmake ]; then git submodule update --init external/cmake-ci; fi
init: runup
${CMAKE} -B ./build
./external/cmake-ci/scripts/after_make.sh
cppcheck: runup
./external/cmake-ci/scripts/cppcheck-ci.sh
release: runup
cd build && ${CMAKE} .. -DDISABLE_WARNINGS=ON
${CMAKE} --build ./build -- $(or ${ARGS},-j4)
./external/cmake-ci/scripts/after_make.sh
static: runup
cd build && ${CMAKE} .. -DBUILD_SHARED_LIBS=OFF -DDISABLE_WARNINGS=ON
${CMAKE} --build ./build -- $(or ${ARGS},-j4)
./external/cmake-ci/scripts/after_make.sh
shared: runup
cd build && ${CMAKE} .. -DBUILD_SHARED_LIBS=ON -DDISABLE_WARNINGS=ON
${CMAKE} --build ./build -- $(or ${ARGS},-j4)
./external/cmake-ci/scripts/after_make.sh
tests: runup
cd build && ${CMAKE} .. -DBUILD_TESTING=ON
${CMAKE} --build ./build -- $(or ${ARGS},-j4)
cd build && ctest --output-on-failure
./external/cmake-ci/scripts/after_make.sh
paranoid: runup
cd build && ${CMAKE} .. -DBUILD_TESTING=ON -DPARANOID_WARNINGS=ON
${CMAKE} --build ./build -- $(or ${ARGS},-j4)
./external/cmake-ci/scripts/after_make.sh
debug: runup
cd build && ${CMAKE} .. -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE="Debug" -DEXTRA_WARNINGS=ON
${CMAKE} --build ./build -- $(or ${ARGS},-j4)
./external/cmake-ci/scripts/after_make.sh
coverage: runup
cd build && ${CMAKE} .. -DCODE_COVERAGE=ON -DDISABLE_WARNINGS=ON
${CMAKE} --build ./build -- $(or ${ARGS},-j4)
./external/cmake-ci/scripts/after_make.sh
cd build && ctest
./external/cmake-ci/scripts/coverage-report.sh build summary
coverage-report: runup
cd build && ${CMAKE} .. -DCODE_COVERAGE=ON -DDISABLE_WARNINGS=ON
${CMAKE} --build ./build -- $(or ${ARGS},-j4)
./external/cmake-ci/scripts/after_make.sh
cd build && ctest
mkdir -p docs
mkdir -p docs/html
./external/cmake-ci/scripts/coverage-report.sh build docs/html/cov-report
clean:
rm -rf docs
cd build && make clean
rm build/CMakeCache.txt
update: runup
./external/cmake-ci/scripts/update.sh
upgrade: update
./external/cmake-ci/scripts/upgrade.sh
install: runup
${CMAKE} --install ./build ${ARGS}
docker-build:
docker build -t ${PRJ} -f Dockerfile.build .
docker-run:
docker run --rm -it ${PRJ}
docker-rm:
docker rmi ${PRJ}