xref: /freebsd/contrib/openpam/Makefile.am (revision 5e3190f700637fcfc1a52daeaa4a031fdd2557c7)
1ACLOCAL_AMFLAGS = -I m4
2
3SUBDIRS = misc include lib bin modules
4
5if WITH_DOC
6SUBDIRS += doc
7endif
8
9SUBDIRS += t
10
11EXTRA_DIST = \
12	CREDITS \
13	HISTORY \
14	INSTALL \
15	LICENSE \
16	README \
17	RELNOTES \
18	autogen.sh \
19	misc/gendoc.pl
20
21if WITH_CODE_COVERAGE
22covdir = @abs_top_builddir@/cov
23coverage: coverage-clean all coverage-prepare coverage-run coverage-report
24coverage-clean:
25	-rm -rf "${covdir}"
26coverage-prepare:
27	mkdir "${covdir}"
28if CLANG_CODE_COVERAGE
29profdata = ${covdir}/@PACKAGE@.profdata
30# hardcoding libpam.so here is horrible, need to find a better solution
31coverage-run:
32	LLVM_PROFILE_FILE="${covdir}/@PACKAGE@.%p.raw" \
33	    ${MAKE} -C "@abs_top_builddir@" check
34coverage-report:
35	llvm-profdata@clang_ver@ merge \
36	    --sparse "${covdir}/@PACKAGE@".*.raw -o "${profdata}"
37	llvm-cov@clang_ver@ show \
38	    --format=html --tab-size=8 \
39	    --output-dir="${covdir}" \
40	    --instr-profile="${profdata}" \
41	    --object "@abs_top_builddir@/lib/libpam/.libs/libpam.so"
42	@echo "coverage report: file://${covdir}/index.html"
43endif
44else
45coverage:
46	echo "code coverage is not enabled." >&2
47	false
48endif
49