-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
58 lines (47 loc) · 1.6 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
.PHONY: build build-cov clean ctags tests
BUILD_DIR=build
all: build
install:
@cd ${BUILD_DIR} && make install
package: build
@cd build && make package
@cp build/sippak-*.rpm dist
@cp build/sippak-*.deb dist
@cp build/sippak-*.tar.gz dist
build:
@test -d ${BUILD_DIR} || mkdir ${BUILD_DIR}
@cd ${BUILD_DIR} && cmake .. && make
build-debug:
@test -d ${BUILD_DIR} || mkdir ${BUILD_DIR}
@cd ${BUILD_DIR} && cmake .. -DCMAKE_BUILD_TYPE=Debug && make
build-cov: clean
@mkdir ${BUILD_DIR}
@cd ${BUILD_DIR} && cmake .. -DCMAKE_BUILD_TYPE=Coverage \
-DCMAKE_C_FLAGS="-Werror -fprofile-arcs -ftest-coverage -g -O0"
@cd ${BUILD_DIR} && cmake --build .
@cd ${BUILD_DIR} && ctest .
@lcov --capture --directory "${BUILD_DIR}/src" --output-file ${BUILD_DIR}/cov_full.info \
--gcov-tool gcov
@lcov -r ${BUILD_DIR}/cov_full.info '/usr/local/include/pj*' -o ${BUILD_DIR}/cov.info
@mkdir ${BUILD_DIR}/coverage
@genhtml --output-directory ${BUILD_DIR}/coverage --title "sippak utility" \
--legend --show-details ${BUILD_DIR}/cov.info
# @xdg-open ${BUILD_DIR}/coverage/index.html
codecov: build-cov
@bash <(curl -s https://codecov.io/bash) -t 49d36735-c7ba-47a3-8b19-d07e2de188fa
test:
@cd build && env CTEST_OUTPUT_ON_FAILURE=1 ctest
.PHONY: dev-test
# watchman-make -p 'src/**/*' 'tests/**/*' 'CMakeLists.txt' 'Makefile' -t dev-test
dev-test: build
@./build/tests/unit/test_getopts
@./build/tests/unit/test_dns_helper
@./build/tests/unit/test_auth_calc
ctags:
@echo -n 'Generating ctags...'
@ctags -R src 2>/dev/null
@echo ' done.'
clean:
@echo "Clean build directory..."
@rm -rf ${BUILD_DIR}
@rm -rf *gcov