-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (45 loc) · 1.67 KB
/
Copy pathMakefile
File metadata and controls
62 lines (45 loc) · 1.67 KB
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
.PHONY: build test cpptests erltest ctags format install clean pytest clang-tidy alltest hex_prepare hex_build publish_hex clean_hex
HEX_LIBWROUTER_DIR := bindings/erlang/c_src/libwrouter
build:
meson setup build
meson compile -C build
test: build
meson test -C build --print-errorlogs -v
cpptests: build
meson test -C build cpp --print-errorlogs -v
erltest: build
meson test -C build erlang --print-errorlogs -v;
pytest: test
PYTHONPATH=build/bindings/python pytest -s bindings/python/tests/
ctags:
ctags -R --kinds-C=+stu --extras=+q -f tags .
format:
clang-format -i include/* src/* tests/*.c tests/helpers/* examples/libmicrohttpd/*.c bindings/python/*.c bindings/python/*.h
alltest: test cpptests erltest pytest
coverage:
meson setup build-coverage -Db_coverage=true -Db_sanitize=none
meson compile -C build-coverage
meson test -C build-coverage --print-errorlogs -v
lcov --capture --directory build-coverage --output-file coverage.info
lcov --extract coverage.info "$$(pwd)/src/*" --output-file coverage.filtered.info
genhtml coverage.filtered.info --output-directory coverage_html
clang-tidy:
clang-tidy src/params.c -p build --fix --checks=misc-include-cleaner
hex_prepare:
rm -rf $(HEX_LIBWROUTER_DIR)
mkdir -p $(HEX_LIBWROUTER_DIR)/include $(HEX_LIBWROUTER_DIR)/src
cp LICENSE $(HEX_LIBWROUTER_DIR)/LICENSE
cp include/wrouter.h $(HEX_LIBWROUTER_DIR)/include/
cp src/*.c src/*.h $(HEX_LIBWROUTER_DIR)/src/
hex_build: hex_prepare
rebar3 hex build
publish_hex: hex_prepare
rebar3 hex publish package --repo hexpm --yes
clean_hex:
rm -rf $(HEX_LIBWROUTER_DIR)
clean:
meson setup --wipe build
install:
meson setup build
meson compile -C build
meson install -C build