1 ACLOCAL_AMFLAGS = -I config
9 SUBDIRS += man scripts lib tests cmd etc 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 += config/config.awk config/rpm.am config/deb.am config/tgz.am
29 EXTRA_DIST += AUTHORS CODE_OF_CONDUCT.md COPYRIGHT LICENSE META NEWS NOTICE
30 EXTRA_DIST += README.md RELEASES.md
31 EXTRA_DIST += module/lua/README.zfs module/os/linux/spl/README.md
33 # Include all the extra licensing information for modules
34 EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE
35 EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE.descrip
36 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman
37 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman.descrip
38 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl
39 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl.descrip
40 EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.cryptogams
41 EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.cryptogams.descrip
42 EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.openssl
43 EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.openssl.descrip
44 EXTRA_DIST += module/os/linux/spl/THIRDPARTYLICENSE.gplv2
45 EXTRA_DIST += module/os/linux/spl/THIRDPARTYLICENSE.gplv2.descrip
46 EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash
47 EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash.descrip
51 GITREV = include/zfs_gitrev.h
55 $(AM_V_GEN)$(top_srcdir)/scripts/make_gitrev.sh $(GITREV)
59 # Double-colon rules are allowed; there are multiple independent definitions.
60 maintainer-clean-local::
64 -$(RM) -R autom4te*.cache build
65 -find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
66 -o -name .pc -o -name .hg -o -name .git \) -prune -o \
67 \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
68 -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
69 -o -name '.*.rej' -o -size 0 -o -name '*%' -o -name '.*.cmd' \
70 -o -name 'core' -o -name 'Makefile' -o -name 'Module.symvers' \
71 -o -name '*.order' -o -name '*.markers' -o -name '*.gcda' \
72 -o -name '*.gcno' \) \
73 -type f -print | xargs $(RM)
76 -[ -x ${top_builddir}/scripts/zfs-tests.sh ] && \
77 ${top_builddir}/scripts/zfs-tests.sh -c
80 $(AM_V_GEN)$(top_srcdir)/scripts/make_gitrev.sh -D $(distdir) $(GITREV)
81 $(SED) ${ac_inplace} -e 's/Release:[[:print:]]*/Release: $(RELEASE)/' \
85 # For compatibility, create a matching spl-x.y.z directly which contains
86 # symlinks to the updated header and object file locations. These
87 # compatibility links will be removed in the next major release.
90 rm -rf $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
91 mkdir $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
92 cd $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
93 ln -s ../zfs-$(VERSION)/include/spl include && \
94 ln -s ../zfs-$(VERSION)/$(LINUX_VERSION) $(LINUX_VERSION) && \
95 ln -s ../zfs-$(VERSION)/zfs_config.h.in spl_config.h.in && \
96 ln -s ../zfs-$(VERSION)/zfs.release.in spl.release.in && \
97 cd $(DESTDIR)$(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION) && \
98 ln -fs zfs_config.h spl_config.h && \
99 ln -fs zfs.release spl.release
104 codecheck: cstyle shellcheck checkbashisms flake8 mancheck testscheck vcscheck
107 checkstyle: codecheck commitcheck
111 @if git rev-parse --git-dir > /dev/null 2>&1; then \
112 ${top_srcdir}/scripts/commitcheck.sh; \
117 @find ${top_srcdir} -name build -prune \
118 -o -type f -name '*.[hc]' \
119 ! -name 'zfs_config.*' ! -name '*.mod.c' \
120 ! -name 'opt_global.h' ! -name '*_if*.h' \
121 ! -path './module/zstd/lib/*' \
122 -exec ${top_srcdir}/scripts/cstyle.pl -cpP {} \+
124 filter_executable = -exec test -x '{}' \; -print
128 @if type shellcheck > /dev/null 2>&1; then \
129 shellcheck --exclude=SC1090,SC1117,SC1091 --format=gcc \
130 $$(find ${top_srcdir} -name "config*" -prune -name tests -prune \
131 -o -name "*.sh" -o -name "*.sh.in" -type f) \
132 $$(find ${top_srcdir}/cmd/zpool/zpool.d/* \
133 -type f ${filter_executable}); \
135 echo "skipping shellcheck because shellcheck is not installed"; \
138 PHONY += checkabi storeabi
140 $(MAKE) -C lib checkabi
143 $(MAKE) -C lib storeabi
145 PHONY += checkbashisms
147 @if type checkbashisms > /dev/null 2>&1; then \
148 checkbashisms -n -p -x \
149 $$(find ${top_srcdir} \
150 -name '.git' -prune \
151 -o -name 'build' -prune \
152 -o -name 'tests' -prune \
153 -o -name 'config' -prune \
154 -o -name 'zed-functions.sh*' -prune \
155 -o -name 'zfs-import*' -prune \
156 -o -name 'zfs-mount*' -prune \
157 -o -name 'zfs-zed*' -prune \
158 -o -name 'smart' -prune \
159 -o -name 'paxcheck.sh' -prune \
160 -o -name 'make_gitrev.sh' -prune \
161 -o -name '90zfs' -prune \
162 -o -path '*initramfs/hooks' -prune \
163 -o -type f ! -name 'config*' \
165 -exec awk 'FNR==1 && /^#!.*bin\/sh/ {print FILENAME}' {} \+); \
167 echo "skipping checkbashisms because checkbashisms is not installed"; \
172 @if type mandoc > /dev/null 2>&1; then \
173 find ${top_srcdir}/man/man8 -type f -name '*[1-9]*' \
174 -exec mandoc -Tlint -Werror {} \+; \
176 echo "skipping mancheck because mandoc is not installed"; \
180 stat_fmt = -c '%A %n'
182 stat_fmt = -f '%Sp %N'
187 @find ${top_srcdir}/tests/zfs-tests -type f \
188 \( -name '*.ksh' -not ${filter_executable} \) -o \
189 \( -name '*.kshlib' ${filter_executable} \) -o \
190 \( -name '*.shlib' ${filter_executable} \) -o \
191 \( -name '*.cfg' ${filter_executable} \) | \
192 xargs -r stat ${stat_fmt} | \
193 awk '{c++; print} END {if(c>0) exit 1}'
197 @if git rev-parse --git-dir > /dev/null 2>&1; then \
198 git ls-files . --exclude-standard --others | \
199 awk '{c++; print} END {if(c>0) exit 1}' ; \
203 lint: cppcheck paxcheck
205 CPPCHECKDIRS = cmd lib module
207 cppcheck: $(CPPCHECKDIRS)
208 @if test -n "$(CPPCHECK)"; then \
209 set -e ; for dir in $(CPPCHECKDIRS) ; do \
210 $(MAKE) -C $$dir cppcheck ; \
213 echo "skipping cppcheck because cppcheck is not installed"; \
218 @if type scanelf > /dev/null 2>&1; then \
219 ${top_srcdir}/scripts/paxcheck.sh ${top_builddir}; \
221 echo "skipping paxcheck because scanelf is not installed"; \
226 @if type flake8 > /dev/null 2>&1; then \
227 flake8 ${top_srcdir}; \
229 echo "skipping flake8 because flake8 is not installed"; \
235 find $(top_srcdir) -name '.?*' -prune \
236 -o -type f -name '*.[hcS]' -print | xargs ctags -a
241 find $(top_srcdir) -name '.?*' -prune \
242 -o -type f -name '*.[hcS]' -print | xargs etags -a
246 find $(top_srcdir) -name '.?*' -prune \
247 -o -type f -name '*.[hc]' -print >cscope.files
252 PHONY += pkg pkg-dkms pkg-kmod pkg-utils
253 pkg: @DEFAULT_PACKAGE@
254 pkg-dkms: @DEFAULT_PACKAGE@-dkms
255 pkg-kmod: @DEFAULT_PACKAGE@-kmod
256 pkg-utils: @DEFAULT_PACKAGE@-utils
258 include config/rpm.am
259 include config/deb.am
260 include config/tgz.am