Linux 4.16 compat: use correct *_dec_and_test()
[zfs.git] / Makefile.am
blob90a1c94755e798c445c5bc2520db107b7e60b1ec
1 ACLOCAL_AMFLAGS = -I config
3 include config/rpm.am
4 include config/deb.am
5 include config/tgz.am
7 SUBDIRS = include rpm
8 if CONFIG_USER
9 SUBDIRS += udev etc man scripts lib tests cmd contrib
10 endif
11 if CONFIG_KERNEL
12 SUBDIRS += module
14 extradir = @prefix@/src/zfs-$(VERSION)
15 extra_HEADERS = zfs.release.in zfs_config.h.in
17 kerneldir = @prefix@/src/zfs-$(VERSION)/$(LINUX_VERSION)
18 nodist_kernel_HEADERS = zfs.release zfs_config.h module/$(LINUX_SYMBOLS)
19 endif
21 AUTOMAKE_OPTIONS = foreign
22 EXTRA_DIST  = autogen.sh copy-builtin
23 EXTRA_DIST += config/config.awk config/rpm.am config/deb.am config/tgz.am
24 EXTRA_DIST += META DISCLAIMER COPYRIGHT README.markdown OPENSOLARIS.LICENSE
26 @CODE_COVERAGE_RULES@
28 distclean-local::
29         -$(RM) -R autom4te*.cache
30         -find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
31                 -o -name .pc -o -name .hg -o -name .git \) -prune -o \
32                 \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
33                 -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
34                 -o -name '.*.rej' -o -size 0 -o -name '*%' -o -name '.*.cmd' \
35                 -o -name 'core' -o -name 'Makefile' -o -name 'Module.symvers' \
36                 -o -name '*.order' -o -name '*.markers' -o -name '*.gcda' \
37                 -o -name '*.gcno' \) \
38                 -type f -print | xargs $(RM)
40 dist-hook:
41         sed -i 's/Release:[[:print:]]*/Release:      $(RELEASE)/' \
42                 $(distdir)/META
44 checkstyle: cstyle shellcheck flake8 commitcheck mancheck testscheck
46 commitcheck:
47         @if git rev-parse --git-dir > /dev/null 2>&1; then \
48                 ${top_srcdir}/scripts/commitcheck.sh; \
49         fi
51 cstyle:
52         @find ${top_srcdir} -name '*.[hc]' ! -name 'zfs_config.*' \
53                 ! -name '*.mod.c' -type f \
54                 -exec ${top_srcdir}/scripts/cstyle.pl -cpP {} \+
56 shellcheck:
57         @if type shellcheck > /dev/null 2>&1; then \
58                 shellcheck --exclude=SC1090 --format=gcc \
59                         $$(find ${top_srcdir}/scripts/*.sh -type f) \
60                         $$(find ${top_srcdir}/cmd/zed/zed.d/*.sh -type f) \
61                         $$(find ${top_srcdir}/cmd/zpool/zpool.d/* -executable); \
62         fi
64 mancheck:
65         @if type mandoc > /dev/null 2>&1; then \
66                 find ${top_srcdir}/man/man8 -type f -name 'zfs.8' \
67                         -o -name 'zpool.8' -o -name 'zdb.8' \
68                         -o -name 'zgenhostid.8' | \
69                         xargs mandoc -Tlint -Werror; \
70         fi
72 testscheck:
73         @find ${top_srcdir}/tests/zfs-tests/tests -type f \
74                 \( -name '*.ksh' -not -executable \) -o \
75                 \( -name '*.kshlib' -executable \) -o \
76                 \( -name '*.cfg' -executable \) | \
77                 xargs -r stat -c '%A %n' | \
78                 awk '{c++; print} END {if(c>0) exit 1}'
80 lint: cppcheck paxcheck
82 cppcheck:
83         @if type cppcheck > /dev/null 2>&1; then \
84                 cppcheck --quiet --force --error-exitcode=2 --inline-suppr \
85                         --suppressions-list=.github/suppressions.txt \
86                         -UHAVE_SSE2 -UHAVE_AVX512F -UHAVE_UIO_ZEROCOPY \
87                         -UHAVE_DNLC ${top_srcdir}; \
88         fi
90 paxcheck:
91         @if type scanelf > /dev/null 2>&1; then \
92                 ${top_srcdir}/scripts/paxcheck.sh ${top_srcdir}; \
93         fi
95 flake8:
96         @if type flake8 > /dev/null 2>&1; then \
97                 flake8 ${top_srcdir}; \
98         fi
100 ctags:
101         $(RM) tags
102         find $(top_srcdir) -name .git -prune -o -name '*.[hc]' | xargs ctags
104 etags:
105         $(RM) TAGS
106         find $(top_srcdir) -name .pc -prune -o -name '*.[hc]' | xargs etags -a
108 tags: ctags etags
110 pkg: @DEFAULT_PACKAGE@
111 pkg-dkms: @DEFAULT_PACKAGE@-dkms
112 pkg-kmod: @DEFAULT_PACKAGE@-kmod
113 pkg-utils: @DEFAULT_PACKAGE@-utils