1 include $(top_srcdir)/config/Shellcheck.am
3 ACLOCAL_AMFLAGS = -I config
11 SUBDIRS += man scripts lib tests cmd etc contrib
19 extradir = $(prefix)/src/zfs-$(VERSION)
20 extra_HEADERS = zfs.release.in zfs_config.h.in
23 kerneldir = $(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION)
24 nodist_kernel_HEADERS = zfs.release zfs_config.h module/$(LINUX_SYMBOLS)
28 AUTOMAKE_OPTIONS = foreign
29 EXTRA_DIST = autogen.sh copy-builtin
30 EXTRA_DIST += config/config.awk config/rpm.am config/deb.am config/tgz.am
31 EXTRA_DIST += AUTHORS CODE_OF_CONDUCT.md COPYRIGHT LICENSE META NEWS NOTICE
32 EXTRA_DIST += README.md RELEASES.md
33 EXTRA_DIST += module/lua/README.zfs module/os/linux/spl/README.md
35 # Include all the extra licensing information for modules
36 EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE
37 EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE.descrip
38 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman
39 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman.descrip
40 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl
41 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl.descrip
42 EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.cryptogams
43 EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.cryptogams.descrip
44 EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.openssl
45 EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.openssl.descrip
46 EXTRA_DIST += module/os/linux/spl/THIRDPARTYLICENSE.gplv2
47 EXTRA_DIST += module/os/linux/spl/THIRDPARTYLICENSE.gplv2.descrip
48 EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash
49 EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash.descrip
53 GITREV = include/zfs_gitrev.h
57 $(AM_V_GEN)$(top_srcdir)/scripts/make_gitrev.sh $(GITREV)
61 # Double-colon rules are allowed; there are multiple independent definitions.
62 maintainer-clean-local::
66 -$(RM) -R autom4te*.cache build
67 -find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
68 -o -name .pc -o -name .hg -o -name .git \) -prune -o \
69 \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
70 -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
71 -o -name '.*.rej' -o -size 0 -o -name '*%' -o -name '.*.cmd' \
72 -o -name 'core' -o -name 'Makefile' -o -name 'Module.symvers' \
73 -o -name '*.order' -o -name '*.markers' -o -name '*.gcda' \
74 -o -name '*.gcno' \) \
75 -type f -print | xargs $(RM)
78 -[ -x ${top_builddir}/scripts/zfs-tests.sh ] && \
79 ${top_builddir}/scripts/zfs-tests.sh -c
82 $(AM_V_GEN)$(top_srcdir)/scripts/make_gitrev.sh -D $(distdir) $(GITREV)
83 $(SED) ${ac_inplace} -e 's/Release:[[:print:]]*/Release: $(RELEASE)/' \
87 # For compatibility, create a matching spl-x.y.z directly which contains
88 # symlinks to the updated header and object file locations. These
89 # compatibility links will be removed in the next major release.
92 rm -rf $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
93 mkdir $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
94 cd $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
95 ln -s ../zfs-$(VERSION)/include/spl include && \
96 ln -s ../zfs-$(VERSION)/$(LINUX_VERSION) $(LINUX_VERSION) && \
97 ln -s ../zfs-$(VERSION)/zfs_config.h.in spl_config.h.in && \
98 ln -s ../zfs-$(VERSION)/zfs.release.in spl.release.in && \
99 cd $(DESTDIR)$(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION) && \
100 ln -fs zfs_config.h spl_config.h && \
101 ln -fs zfs.release spl.release
106 codecheck: cstyle shellcheck checkbashisms flake8 mancheck testscheck vcscheck
109 checkstyle: codecheck commitcheck
113 @if git rev-parse --git-dir > /dev/null 2>&1; then \
114 ${top_srcdir}/scripts/commitcheck.sh; \
118 cstyle_line = -print0 | parallel -X0 ${top_srcdir}/scripts/cstyle.pl -cpP {}
120 cstyle_line = -exec ${top_srcdir}/scripts/cstyle.pl -cpP {} +
124 @find ${top_srcdir} -name build -prune \
125 -o -type f -name '*.[hc]' \
126 ! -name 'zfs_config.*' ! -name '*.mod.c' \
127 ! -name 'opt_global.h' ! -name '*_if*.h' \
128 ! -path './module/zstd/lib/*' \
129 ! -path './module/zfs/lz4.c' \
132 filter_executable = -exec test -x '{}' \; -print
134 SHELLCHECKDIRS = cmd contrib etc scripts tests
135 SHELLCHECKSCRIPTS = autogen.sh
137 PHONY += checkabi storeabi
140 libabiversion=`abidw -v | $(SED) 's/[^0-9]//g'`; \
141 if test $$libabiversion -lt "200"; then \
143 "*** Please use libabigail 2.0.0 version or newer;\n" \
144 "*** otherwise results are not consistent!\n" \
145 "(or see https://github.com/openzfs/libabigail-docker )\n"; \
149 checkabi: checklibabiversion lib
150 $(MAKE) -C lib checkabi
152 storeabi: checklibabiversion lib
153 $(MAKE) -C lib storeabi
157 ${top_srcdir}/scripts/mancheck.sh ${top_srcdir}/man ${top_srcdir}/tests/test-runner/man
160 stat_fmt = -c '%A %n'
162 stat_fmt = -f '%Sp %N'
167 @find ${top_srcdir}/tests/zfs-tests -type f \
168 \( -name '*.ksh' -not ${filter_executable} \) -o \
169 \( -name '*.kshlib' ${filter_executable} \) -o \
170 \( -name '*.shlib' ${filter_executable} \) -o \
171 \( -name '*.cfg' ${filter_executable} \) | \
172 xargs -r stat ${stat_fmt} | \
173 awk '{c++; print} END {if(c>0) exit 1}'
177 @if git rev-parse --git-dir > /dev/null 2>&1; then \
178 git ls-files . --exclude-standard --others | \
179 awk '{c++; print} END {if(c>0) exit 1}' ; \
183 lint: cppcheck paxcheck
185 CPPCHECKDIRS = cmd lib module
187 cppcheck: $(CPPCHECKDIRS)
188 @if test -n "$(CPPCHECK)"; then \
189 set -e ; for dir in $(CPPCHECKDIRS) ; do \
190 $(MAKE) -C $$dir cppcheck ; \
193 echo "skipping cppcheck because cppcheck is not installed"; \
198 @if type scanelf > /dev/null 2>&1; then \
199 ${top_srcdir}/scripts/paxcheck.sh ${top_builddir}; \
201 echo "skipping paxcheck because scanelf is not installed"; \
206 @if type flake8 > /dev/null 2>&1; then \
207 flake8 ${top_srcdir}; \
209 echo "skipping flake8 because flake8 is not installed"; \
215 find $(top_srcdir) -name '.?*' -prune \
216 -o -type f -name '*.[hcS]' -print | xargs ctags -a
221 find $(top_srcdir) -name '.?*' -prune \
222 -o -type f -name '*.[hcS]' -print | xargs etags -a
226 find $(top_srcdir) -name '.?*' -prune \
227 -o -type f -name '*.[hc]' -print >cscope.files
232 PHONY += pkg pkg-dkms pkg-kmod pkg-utils
233 pkg: @DEFAULT_PACKAGE@
234 pkg-dkms: @DEFAULT_PACKAGE@-dkms
235 pkg-kmod: @DEFAULT_PACKAGE@-kmod
236 pkg-utils: @DEFAULT_PACKAGE@-utils
238 include config/rpm.am
239 include config/deb.am
240 include config/tgz.am