-
Notifications
You must be signed in to change notification settings - Fork 38
/
Makefile
99 lines (74 loc) · 1.68 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
99
REBAR := rebar3
QUICER_VERSION ?= $(shell git describe --tags --always)
export QUICER_VERSION
.PHONY: all
all: compile
.PHONY: default
default: build-nif
.PHONY: build-nif
build-nif:
./build.sh 'v2.3.8'
compile:
$(REBAR) compile
.PHONY: clean
clean: distclean
fmt:
@clang-format-14 -i c_src/*
@rebar3 fmt
.PHONY: distclean
distclean:
$(REBAR) unlock --all
rm -rf _build erl_crash.dump rebar3.crashdump
rm -rf c_build/*
rm -rf priv/*
.PHONY: xref
xref:
$(REBAR) xref
.PHONY: eunit
eunit:
$(REBAR) eunit -v -c --cover_export_name eunit
.PHONY: proper
proper:
$(REBAR) proper -n 1000
.PHONY: proper-cover
proper-cover:
mkdir -p coverage
QUICER_TEST_COVER=1 $(REBAR) as test proper -c -n 1000 --noshrink
lcov -c --directory c_build/CMakeFiles/quicer_nif.dir/c_src/ \
--exclude "${PWD}/msquic/src/inc/*" \
--output-file ./coverage/proper-lcov.info
.PHONY: ct
ct:
QUICER_USE_SNK=1 $(REBAR) as test ct -v --readable=true
.PHONY: cover
cover: eunit proper-cover
mkdir -p coverage
QUICER_TEST_COVER=1 QUICER_USE_SNK=1 $(REBAR) as test ct --cover --cover_export_name=ct -v
$(REBAR) as test cover -v
lcov -c --directory c_build/CMakeFiles/quicer_nif.dir/c_src/ \
--exclude "${PWD}/msquic/src/inc/*" \
--output-file ./coverage/lcov.info
.PHONY: cover-html
cover-html: cover
genhtml -o coverage/ coverage/lcov.info coverage/proper-lcov.info
.PHONY: dialyzer
dialyzer:
$(REBAR) dialyzer
.PHONY: test
test: eunit ct
.PHONY: check
check: clang-format
.PHONY: clang-format
clang-format:
clang-format-14 --Werror --dry-run c_src/*
.PHONY: ci
ci: test dialyzer
.PHONY: tar
tar:
$(REBAR) tar
.PHONY: doc
doc:
$(REBAR) as doc ex_doc
.PHONY: publish
publish:
$(REBAR) as doc hex publish