1 ACLOCAL_AMFLAGS = -I config
13 SUBDIRS += etc man scripts lib tests cmd contrib
21 extradir = $(prefix)/src/zfs-$(VERSION)
22 extra_HEADERS = zfs.release.in zfs_config.h.in
25 kerneldir = $(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION)
26 nodist_kernel_HEADERS = zfs.release zfs_config.h module/$(LINUX_SYMBOLS)
30 AUTOMAKE_OPTIONS = foreign
31 EXTRA_DIST = autogen.sh copy-builtin
32 EXTRA_DIST += cppcheck-suppressions.txt
33 EXTRA_DIST += config/config.awk config/rpm.am config/deb.am config/tgz.am
34 EXTRA_DIST += META AUTHORS COPYRIGHT LICENSE NEWS NOTICE README.md
35 EXTRA_DIST += CODE_OF_CONDUCT.md
36 EXTRA_DIST += module/lua/README.zfs module/os/linux/spl/README.md
38 # Include all the extra licensing information for modules
39 EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE
40 EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE.descrip
41 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman
42 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman.descrip
43 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl
44 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl.descrip
45 EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.cryptogams
46 EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.cryptogams.descrip
47 EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.openssl
48 EXTRA_DIST += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.openssl.descrip
49 EXTRA_DIST += module/os/linux/spl/THIRDPARTYLICENSE.gplv2
50 EXTRA_DIST += module/os/linux/spl/THIRDPARTYLICENSE.gplv2.descrip
51 EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash
52 EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash.descrip
56 GITREV = include/zfs_gitrev.h
60 ZFS_GITREV=$$(cd $(top_srcdir) && \
61 git describe --always --long --dirty 2>/dev/null); \
62 ZFS_GITREV=$${ZFS_GITREV:-unknown}; \
63 printf '#define\tZFS_META_GITREV "%s"\n' \
64 "$${ZFS_GITREV}" >$(GITREV)~; \
65 if cmp -s $(GITREV) $(GITREV)~; then \
68 mv -f $(GITREV)~ $(GITREV); \
73 BUILT_SOURCES = $(GITREV)
74 CLEANFILES = $(GITREV)
76 # Double-colon rules are allowed; there are multiple independent definitions.
78 -$(RM) -R autom4te*.cache build
79 -find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
80 -o -name .pc -o -name .hg -o -name .git \) -prune -o \
81 \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
82 -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
83 -o -name '.*.rej' -o -size 0 -o -name '*%' -o -name '.*.cmd' \
84 -o -name 'core' -o -name 'Makefile' -o -name 'Module.symvers' \
85 -o -name '*.order' -o -name '*.markers' -o -name '*.gcda' \
86 -o -name '*.gcno' \) \
87 -type f -print | xargs $(RM)
90 -[ -x ${top_builddir}/scripts/zfs-tests.sh ] && \
91 ${top_builddir}/scripts/zfs-tests.sh -c
94 $(SED) ${ac_inplace} -e 's/Release:[[:print:]]*/Release: $(RELEASE)/' \
98 # For compatibility, create a matching spl-x.y.z directly which contains
99 # symlinks to the updated header and object file locations. These
100 # compatibility links will be removed in the next major release.
103 rm -rf $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
104 mkdir $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
105 cd $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
106 ln -s ../zfs-$(VERSION)/include/spl include && \
107 ln -s ../zfs-$(VERSION)/$(LINUX_VERSION) $(LINUX_VERSION) && \
108 ln -s ../zfs-$(VERSION)/zfs_config.h.in spl_config.h.in && \
109 ln -s ../zfs-$(VERSION)/zfs.release.in spl.release.in && \
110 cd $(DESTDIR)$(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION) && \
111 ln -fs zfs_config.h spl_config.h && \
112 ln -fs zfs.release spl.release
117 codecheck: cstyle shellcheck flake8 mancheck testscheck vcscheck
120 checkstyle: codecheck commitcheck
124 @if git rev-parse --git-dir > /dev/null 2>&1; then \
125 ${top_srcdir}/scripts/commitcheck.sh; \
130 @find ${top_srcdir} -name build -prune -o -type f -name '*.[hc]' \
131 ! -name 'zfs_config.*' ! -name '*.mod.c' \
132 ! -name 'opt_global.h' ! -name '*_if*.h' \
133 -exec ${top_srcdir}/scripts/cstyle.pl -cpP {} \+
135 filter_executable = -exec test -x '{}' \; -print
139 @if type shellcheck > /dev/null 2>&1; then \
140 shellcheck --exclude=SC1090 --exclude=SC1117 --format=gcc \
141 $$(find ${top_srcdir}/scripts/*.sh -type f) \
142 $$(find ${top_srcdir}/cmd/zed/zed.d/*.sh -type f) \
143 $$(find ${top_srcdir}/cmd/zpool/zpool.d/* \
144 -type f ${filter_executable}); \
146 echo "skipping shellcheck because shellcheck is not installed"; \
151 @if type mandoc > /dev/null 2>&1; then \
152 find ${top_srcdir}/man/man8 -type f -name 'zfs.8' \
153 -o -name 'zpool.8' -o -name 'zdb.8' \
154 -o -name 'zgenhostid.8' | \
155 xargs mandoc -Tlint -Werror; \
157 echo "skipping mancheck because mandoc is not installed"; \
161 stat_fmt = -c '%A %n'
163 stat_fmt = -f '%Sp %N'
168 @find ${top_srcdir}/tests/zfs-tests -type f \
169 \( -name '*.ksh' -not ${filter_executable} \) -o \
170 \( -name '*.kshlib' ${filter_executable} \) -o \
171 \( -name '*.shlib' ${filter_executable} \) -o \
172 \( -name '*.cfg' ${filter_executable} \) | \
173 xargs -r stat ${stat_fmt} | \
174 awk '{c++; print} END {if(c>0) exit 1}'
178 @if git rev-parse --git-dir > /dev/null 2>&1; then \
179 git ls-files . --exclude-standard --others | \
180 awk '{c++; print} END {if(c>0) exit 1}' ; \
184 lint: cppcheck paxcheck
188 @if type cppcheck > /dev/null 2>&1; then \
189 cppcheck --quiet --force --error-exitcode=2 --inline-suppr \
190 --suppressions-list=${top_srcdir}/cppcheck-suppressions.txt \
191 -UHAVE_SSE2 -UHAVE_AVX512F -UHAVE_UIO_ZEROCOPY \
194 echo "skipping cppcheck because cppcheck is not installed"; \
199 @if type scanelf > /dev/null 2>&1; then \
200 ${top_srcdir}/scripts/paxcheck.sh ${top_builddir}; \
202 echo "skipping paxcheck because scanelf is not installed"; \
207 @if type flake8 > /dev/null 2>&1; then \
208 flake8 ${top_srcdir}; \
210 echo "skipping flake8 because flake8 is not installed"; \
216 find $(top_srcdir) -name '.?*' -prune \
217 -o -type f -name '*.[hcS]' -print | xargs ctags -a
222 find $(top_srcdir) -name '.?*' -prune \
223 -o -type f -name '*.[hcS]' -print | xargs etags -a
227 find $(top_srcdir) -name '.?*' -prune \
228 -o -type f -name '*.[hc]' -print >cscope.files
233 PHONY += pkg pkg-dkms pkg-kmod pkg-utils
234 pkg: @DEFAULT_PACKAGE@
235 pkg-dkms: @DEFAULT_PACKAGE@-dkms
236 pkg-kmod: @DEFAULT_PACKAGE@-kmod
237 pkg-utils: @DEFAULT_PACKAGE@-utils