1 ACLOCAL_AMFLAGS = -I config
9 SUBDIRS += udev etc man scripts lib tests cmd contrib
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)
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 AUTHORS COPYRIGHT LICENSE NOTICE README.md
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)
41 -${top_srcdir}/scripts/zfs-tests.sh -c
44 sed -i 's/Release:[[:print:]]*/Release: $(RELEASE)/' \
47 # For compatibility, create a matching spl-x.y.z directly which contains
48 # symlinks to the updated header and object file locations. These
49 # compatibility links will be removed in the next major release.
52 mkdir $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
53 cd $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
54 ln -s ../zfs-$(VERSION)/include/spl include && \
55 ln -s ../zfs-$(VERSION)/$(LINUX_VERSION) $(LINUX_VERSION) && \
56 ln -s ../zfs-$(VERSION)/zfs_config.h.in spl_config.h.in && \
57 ln -s ../zfs-$(VERSION)/zfs.release.in spl.release.in && \
58 cd $(DESTDIR)$(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION) && \
59 ln -s zfs_config.h spl_config.h && \
60 ln -s zfs.release spl.release
63 checkstyle: cstyle shellcheck flake8 commitcheck mancheck testscheck
66 @if git rev-parse --git-dir > /dev/null 2>&1; then \
67 ${top_srcdir}/scripts/commitcheck.sh; \
71 @find ${top_srcdir} -name '*.[hc]' ! -name 'zfs_config.*' \
72 ! -name '*.mod.c' -type f \
73 -exec ${top_srcdir}/scripts/cstyle.pl -cpP {} \+
76 @if type shellcheck > /dev/null 2>&1; then \
77 shellcheck --exclude=SC1090 --format=gcc \
78 $$(find ${top_srcdir}/scripts/*.sh -type f) \
79 $$(find ${top_srcdir}/cmd/zed/zed.d/*.sh -type f) \
80 $$(find ${top_srcdir}/cmd/zpool/zpool.d/* -executable); \
84 @if type mandoc > /dev/null 2>&1; then \
85 find ${top_srcdir}/man/man8 -type f -name 'zfs.8' \
86 -o -name 'zpool.8' -o -name 'zdb.8' \
87 -o -name 'zgenhostid.8' | \
88 xargs mandoc -Tlint -Werror; \
92 @find ${top_srcdir}/tests/zfs-tests/tests -type f \
93 \( -name '*.ksh' -not -executable \) -o \
94 \( -name '*.kshlib' -executable \) -o \
95 \( -name '*.cfg' -executable \) | \
96 xargs -r stat -c '%A %n' | \
97 awk '{c++; print} END {if(c>0) exit 1}'
99 lint: cppcheck paxcheck
102 @if type cppcheck > /dev/null 2>&1; then \
103 cppcheck --quiet --force --error-exitcode=2 --inline-suppr \
104 --suppressions-list=.github/suppressions.txt \
105 -UHAVE_SSE2 -UHAVE_AVX512F -UHAVE_UIO_ZEROCOPY \
106 -UHAVE_DNLC ${top_srcdir}; \
110 @if type scanelf > /dev/null 2>&1; then \
111 ${top_srcdir}/scripts/paxcheck.sh ${top_srcdir}; \
115 @if type flake8 > /dev/null 2>&1; then \
116 flake8 ${top_srcdir}; \
121 find $(top_srcdir) -name .git -prune -o -name '*.[hc]' | xargs ctags
125 find $(top_srcdir) -name .pc -prune -o -name '*.[hc]' | xargs etags -a
129 pkg: @DEFAULT_PACKAGE@
130 pkg-dkms: @DEFAULT_PACKAGE@-dkms
131 pkg-kmod: @DEFAULT_PACKAGE@-kmod
132 pkg-utils: @DEFAULT_PACKAGE@-utils