summaryrefslogtreecommitdiff
path: root/Makefile.am
blob: 588e02382c6a67026aeecd1fd7f106c769630e28 (plain)
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
####
# Seccomp Library
#

#
# This library is free software; you can redistribute it and/or modify it
# under the terms of version 2.1 of the GNU Lesser General Public License
# as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this library; if not, see <http://www.gnu.org/licenses>.
#

@CODE_COVERAGE_RULES@

CODE_COVERAGE_OUTPUT_FILE = libseccomp.lcov.info
CODE_COVERAGE_OUTPUT_DIRECTORY = libseccomp.lcov.html.d
CODE_COVERAGE_IGNORE_PATTERN = \
	*/usr/include/* \
	*/src/arch-syscall-check.c \
	*/src/syscalls.perf

ACLOCAL_AMFLAGS = -I m4
SUBDIRS = include src tools tests doc

pkgconfdir = ${libdir}/pkgconfig
pkgconf_DATA = libseccomp.pc

EXTRA_DIST = \
	CHANGELOG CREDITS LICENSE \
	README.md CONTRIBUTING.md SECURITY.md

# support silent builds
AM_MAKEFLAGS_0 = --quiet --no-print-directory
AM_MAKEFLAGS_1 =
AM_MAKEFLAGS_ = ${AM_MAKEFLAGS_0}
AM_MAKEFLAGS = ${AM_MAKEFLAGS_@AM_V@}

# enable python during distcheck
AM_DISTCHECK_CONFIGURE_FLAGS = --enable-python

check-build: all
	${MAKE} ${AM_MAKEFLAGS} -C src check-build
	${MAKE} ${AM_MAKEFLAGS} -C tests check-build

check-syntax:
	@./tools/check-syntax

if CODE_COVERAGE_ENABLED
test-code-coverage:
	LIBSECCOMP_TSTCFG_TYPE=basic,bpf-sim \
		${MAKE} ${AM_MAKEFLAGS} check-code-coverage
endif

if COVERITY
coverity-build: clean
	cov-build --dir cov-int ${MAKE} ${AM_MAKEFLAGS} check-build
endif

if COVERITY
coverity-tarball: coverity-build
	@if git rev-parse HEAD &> /dev/null; then \
		rev_full=$$(git rev-parse HEAD); \
		rev=$$(echo $$rev_full | cut -c1-8); \
	else \
		rev_full=$$(date --iso-8601=date); \
		rev=$$rev_full; \
	fi; \
	tar czf libseccomp-coverity_$$rev.tar.gz cov-int; \
	echo " HEAD revision: $$rev_full"; \
	ls -l libseccomp-coverity_$$rev.tar.gz
endif

help:
	@echo "libseccomp build system"
	@echo " make targets:"
	@echo "  (none):           build the library"
	@echo "  clean:            remove all build artifacts"
	@echo "  check:            run the automated regression tests"
	@echo "  check-build:      build the library and all tests"
	@echo "  check-syntax:     verify the code style"
	@echo "  distcheck:        verify the build for distribution"
	@echo "  dist-gzip:        build a release tarball"
	@echo "  coverity-tarball: build a tarball for use with Coverity (opt)"

clean-local:
	${RM} -rf cov-int libseccomp-coverity_*.tar.gz