1 ACLOCAL_AMFLAGS = -I config
9 SUBDIRS += etc man scripts lib tests cmd contrib
17 extradir = $(prefix)/src/zfs-$(VERSION)
18 extra_HEADERS = zfs.release.in zfs_config.h.in
21 kerneldir = $(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION)
22 nodist_kernel_HEADERS = zfs.release zfs_config.h module/$(LINUX_SYMBOLS)
26 AUTOMAKE_OPTIONS = foreign
27 EXTRA_DIST = autogen.sh copy-builtin
28 EXTRA_DIST += cppcheck-suppressions.txt
29 EXTRA_DIST += config/config.awk config/rpm.am config/deb.am config/tgz.am
30 EXTRA_DIST += META AUTHORS COPYRIGHT LICENSE NEWS NOTICE README.md
31 EXTRA_DIST += CODE_OF_CONDUCT.md
32 EXTRA_DIST += module/lua/README.zfs module/os/linux/spl/README.md
34 # Include all the extra licensing information for modules
35 EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE
36 EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE.descrip
37 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman
38 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman.descrip
39 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl
40 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl.descrip
41 EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.cryptogams
42 EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.cryptogams.descrip
43 EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.openssl
44 EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.openssl.descrip
45 EXTRA_DIST += module/os/linux/spl/THIRDPARTYLICENSE.gplv2
46 EXTRA_DIST += module/os/linux/spl/THIRDPARTYLICENSE.gplv2.descrip
47 EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash
48 EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash.descrip
52 GITREV = include/zfs_gitrev.h
53 CLEANFILES = $(GITREV)
57 $(AM_V_GEN)$(top_srcdir)/scripts/make_gitrev.sh $(GITREV)
61 # Double-colon rules are allowed; there are multiple independent definitions.
63 -$(RM) -R autom4te*.cache build
64 -find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
65 -o -name .pc -o -name .hg -o -name .git \) -prune -o \
66 \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
67 -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
68 -o -name '.*.rej' -o -size 0 -o -name '*%' -o -name '.*.cmd' \
69 -o -name 'core' -o -name 'Makefile' -o -name 'Module.symvers' \
70 -o -name '*.order' -o -name '*.markers' -o -name '*.gcda' \
71 -o -name '*.gcno' \) \
72 -type f -print | xargs $(RM)
75 -[ -x ${top_builddir}/scripts/zfs-tests.sh ] && \
76 ${top_builddir}/scripts/zfs-tests.sh -c
79 $(SED) ${ac_inplace} -e 's/Release:[[:print:]]*/Release: $(RELEASE)/' \
83 # For compatibility, create a matching spl-x.y.z directly which contains
84 # symlinks to the updated header and object file locations. These
85 # compatibility links will be removed in the next major release.
88 rm -rf $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
89 mkdir $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
90 cd $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
91 ln -s ../zfs-$(VERSION)/include/spl include && \
92 ln -s ../zfs-$(VERSION)/$(LINUX_VERSION) $(LINUX_VERSION) && \
93 ln -s ../zfs-$(VERSION)/zfs_config.h.in spl_config.h.in && \
94 ln -s ../zfs-$(VERSION)/zfs.release.in spl.release.in && \
95 cd $(DESTDIR)$(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION) && \
96 ln -fs zfs_config.h spl_config.h && \
97 ln -fs zfs.release spl.release
102 codecheck: cstyle shellcheck checkbashisms flake8 mancheck testscheck vcscheck
105 checkstyle: codecheck commitcheck
109 @if git rev-parse --git-dir > /dev/null 2>&1; then \
110 ${top_srcdir}/scripts/commitcheck.sh; \
115 @find ${top_srcdir} -name build -prune -o -type f -name '*.[hc]' \
116 ! -name 'zfs_config.*' ! -name '*.mod.c' \
117 ! -name 'opt_global.h' ! -name '*_if*.h' \
118 -exec ${top_srcdir}/scripts/cstyle.pl -cpP {} \+
120 filter_executable = -exec test -x '{}' \; -print
124 @if type shellcheck > /dev/null 2>&1; then \
125 shellcheck --exclude=SC1090 --exclude=SC1117 --format=gcc \
126 $$(find ${top_srcdir}/scripts/*.sh -type f) \
127 $$(find ${top_srcdir}/cmd/zed/zed.d/*.sh -type f) \
128 $$(find ${top_srcdir}/cmd/zpool/zpool.d/* \
129 -type f ${filter_executable}); \
131 echo "skipping shellcheck because shellcheck is not installed"; \
134 PHONY += checkbashisms
136 @if type checkbashisms > /dev/null 2>&1; then \
137 checkbashisms -n -p -x \
138 $$(find ${top_srcdir} \
139 -name '.git' -prune \
140 -o -name 'build' -prune \
141 -o -name 'tests' -prune \
142 -o -name 'config' -prune \
143 -o -type f ! -name 'config*' \
145 -exec bash -c 'awk "NR==1 && /\#\!.*bin\/sh.*/ {print FILENAME;}" "{}"' \;); \
147 echo "skipping checkbashisms because checkbashisms is not installed"; \
152 @if type mandoc > /dev/null 2>&1; then \
153 find ${top_srcdir}/man/man8 -type f -name 'zfs.8' \
154 -o -name 'zpool.8' -o -name 'zdb.8' \
155 -o -name 'zgenhostid.8' | \
156 xargs mandoc -Tlint -Werror; \
158 echo "skipping mancheck because mandoc is not installed"; \
162 stat_fmt = -c '%A %n'
164 stat_fmt = -f '%Sp %N'
169 @find ${top_srcdir}/tests/zfs-tests -type f \
170 \( -name '*.ksh' -not ${filter_executable} \) -o \
171 \( -name '*.kshlib' ${filter_executable} \) -o \
172 \( -name '*.shlib' ${filter_executable} \) -o \
173 \( -name '*.cfg' ${filter_executable} \) | \
174 xargs -r stat ${stat_fmt} | \
175 awk '{c++; print} END {if(c>0) exit 1}'
179 @if git rev-parse --git-dir > /dev/null 2>&1; then \
180 git ls-files . --exclude-standard --others | \
181 awk '{c++; print} END {if(c>0) exit 1}' ; \
185 lint: cppcheck paxcheck
189 @if type cppcheck > /dev/null 2>&1; then \
190 cppcheck --quiet --force --error-exitcode=2 --inline-suppr \
191 --suppressions-list=${top_srcdir}/cppcheck-suppressions.txt \
192 -UHAVE_SSE2 -UHAVE_AVX512F -UHAVE_UIO_ZEROCOPY \
195 echo "skipping cppcheck because cppcheck is not installed"; \
200 @if type scanelf > /dev/null 2>&1; then \
201 ${top_srcdir}/scripts/paxcheck.sh ${top_builddir}; \
203 echo "skipping paxcheck because scanelf is not installed"; \
208 @if type flake8 > /dev/null 2>&1; then \
209 flake8 ${top_srcdir}; \
211 echo "skipping flake8 because flake8 is not installed"; \
217 find $(top_srcdir) -name '.?*' -prune \
218 -o -type f -name '*.[hcS]' -print | xargs ctags -a
223 find $(top_srcdir) -name '.?*' -prune \
224 -o -type f -name '*.[hcS]' -print | xargs etags -a
228 find $(top_srcdir) -name '.?*' -prune \
229 -o -type f -name '*.[hc]' -print >cscope.files
234 PHONY += pkg pkg-dkms pkg-kmod pkg-utils
235 pkg: @DEFAULT_PACKAGE@
236 pkg-dkms: @DEFAULT_PACKAGE@-dkms
237 pkg-kmod: @DEFAULT_PACKAGE@-kmod
238 pkg-utils: @DEFAULT_PACKAGE@-utils
240 include config/rpm.am
241 include config/deb.am
242 include config/tgz.am