-
Notifications
You must be signed in to change notification settings - Fork 279
/
Makefile.autosetup
72 lines (60 loc) · 1.93 KB
/
Makefile.autosetup
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
include @builddir@/mk/defs.mk
DIRS= external compat libpkg/repo libpkg src docs scripts
@if TESTS
DIRS+= tests
@endif
include $(MK)/dir.mk
include $(MK)/common.mk
VPATH= $(top_srcdir)
@if coverage
check: clean-profiles
clean-profiles:
rm -f /tmp/pkg.*.profraw
@endif
check: all
@if TESTS
all: Kyuafile
check:
export UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1; \
export LLVM_PROFILE_FILE=/tmp/pkg.%p.profraw; \
if [ "$(HTML)" != "" ]; then \
args="-r $(top_builddir)/res.db" ; \
fi ; \
parallel=$$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN ) ; \
kyua --config=none \
--variable parallelism=$${parallel} \
test $$args \
--kyuafile='$(top_builddir)/Kyuafile' \
--build-root='$(top_builddir)' || FAILED=1 ; \
if [ "$(HTML)" != "" ]; then \
kyua report-html --force $$args --output=$(HTML) ; \
rm -f $(top_builddir)/res.db ; \
fi ; \
exit $${FAILED}
@endif
@if coverage
check-coverage: check
llvm-profdata merge --output=pkg.profdata /tmp/pkg.*.profraw
report-coverage:
llvm-cov report ./src/pkg -instr-profile=pkg.profdata --use-color -ignore-filename-regex=external -ignore-filename-regex=compat
@endif
COCCI_ARGS= -I ${top_srcdir} \
-I /usr/include \
-I /usr/local/include \
-I ${top_srcdir}/compat \
-I ${top_srcdir}/libpkg \
-I ${top_srcdir}/src \
-I ${top_srcdir}/external/yxml \
-I ${top_srcdir}/external/libucl/include \
-I ${top_srcdir}/external/uthash \
-I ${top_srcdir}/external/sqlite \
-I ${top_srcdir}/external/libelf
1cocci:
spatch ${COCCI_ARGS} -in_place -sp_file $(top_srcdir)/tests/cocci/${COCCITEST} -dir ${top_srcdir}/libpkg ; \
spatch ${COCCI_ARGS} -in_place -sp_file $(top_srcdir)/tests/cocci/${COCCITEST} -dir ${top_srcdir}/src ;
cocci:
for c in ${top_srcdir}/tests/cocci/*.cocci ; do \
echo "Passing $$c" ; \
spatch ${COCCI_ARGS} -in_place -sp_file $$c -dir ${top_srcdir}/libpkg ; \
spatch ${COCCI_ARGS} -in_place -sp_file $$c -dir ${top_srcdir}/src ; \
done