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 NEWS NOTICE README.md
25 EXTRA_DIST += CODE_OF_CONDUCT.md
27 # Include all the extra licensing information for modules
28 EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE
29 EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE.descrip
30 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman
31 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman.descrip
32 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl
33 EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl.descrip
34 EXTRA_DIST += module/spl/THIRDPARTYLICENSE.gplv2
35 EXTRA_DIST += module/spl/THIRDPARTYLICENSE.gplv2.descrip
36 EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash
37 EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash.descrip
43 -${top_srcdir}/scripts/make_gitrev.sh
45 BUILT_SOURCES = gitrev
48 -$(RM) -R autom4te*.cache
49 -find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
50 -o -name .pc -o -name .hg -o -name .git \) -prune -o \
51 \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
52 -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
53 -o -name '.*.rej' -o -size 0 -o -name '*%' -o -name '.*.cmd' \
54 -o -name 'core' -o -name 'Makefile' -o -name 'Module.symvers' \
55 -o -name '*.order' -o -name '*.markers' -o -name '*.gcda' \
56 -o -name '*.gcno' \) \
57 -type f -print | xargs $(RM)
60 -[ -x ${top_builddir}/scripts/zfs-tests.sh ] && \
61 ${top_builddir}/scripts/zfs-tests.sh -c
64 cp ${top_srcdir}/include/zfs_gitrev.h $(distdir)/include; \
65 sed -i 's/Release:[[:print:]]*/Release: $(RELEASE)/' \
68 # For compatibility, create a matching spl-x.y.z directly which contains
69 # symlinks to the updated header and object file locations. These
70 # compatibility links will be removed in the next major release.
73 rm -rf $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
74 mkdir $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
75 cd $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
76 ln -s ../zfs-$(VERSION)/include/spl include && \
77 ln -s ../zfs-$(VERSION)/$(LINUX_VERSION) $(LINUX_VERSION) && \
78 ln -s ../zfs-$(VERSION)/zfs_config.h.in spl_config.h.in && \
79 ln -s ../zfs-$(VERSION)/zfs.release.in spl.release.in && \
80 cd $(DESTDIR)$(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION) && \
81 ln -fs zfs_config.h spl_config.h && \
82 ln -fs zfs.release spl.release
85 codecheck: cstyle shellcheck flake8 mancheck testscheck vcscheck
87 checkstyle: codecheck commitcheck
90 @if git rev-parse --git-dir > /dev/null 2>&1; then \
91 ${top_srcdir}/scripts/commitcheck.sh; \
95 @find ${top_srcdir} -name '*.[hc]' ! -name 'zfs_config.*' \
96 ! -name '*.mod.c' -type f \
97 -exec ${top_srcdir}/scripts/cstyle.pl -cpP {} \+
100 @if type shellcheck > /dev/null 2>&1; then \
101 shellcheck --exclude=SC1090 --format=gcc \
102 $$(find ${top_srcdir}/scripts/*.sh -type f) \
103 $$(find ${top_srcdir}/cmd/zed/zed.d/*.sh -type f) \
104 $$(find ${top_srcdir}/cmd/zpool/zpool.d/* -executable); \
106 echo "skipping shellcheck because shellcheck is not installed"; \
110 @if type mandoc > /dev/null 2>&1; then \
111 find ${top_srcdir}/man/man8 -type f -name 'zfs.8' \
112 -o -name 'zpool.8' -o -name 'zdb.8' \
113 -o -name 'zgenhostid.8' | \
114 xargs mandoc -Tlint -Werror; \
116 echo "skipping mancheck because mandoc is not installed"; \
120 @find ${top_srcdir}/tests/zfs-tests -type f \
121 \( -name '*.ksh' -not -executable \) -o \
122 \( -name '*.kshlib' -executable \) -o \
123 \( -name '*.shlib' -executable \) -o \
124 \( -name '*.cfg' -executable \) | \
125 xargs -r stat -c '%A %n' | \
126 awk '{c++; print} END {if(c>0) exit 1}'
129 @if git rev-parse --git-dir > /dev/null 2>&1; then \
130 git ls-files . --exclude-standard --others | \
131 awk '{c++; print} END {if(c>0) exit 1}' ; \
134 lint: cppcheck paxcheck
137 @if type cppcheck > /dev/null 2>&1; then \
138 cppcheck --quiet --force --error-exitcode=2 --inline-suppr \
139 --suppressions-list=.github/suppressions.txt \
140 -UHAVE_SSE2 -UHAVE_AVX512F -UHAVE_UIO_ZEROCOPY \
143 echo "skipping cppcheck because cppcheck is not installed"; \
147 @if type scanelf > /dev/null 2>&1; then \
148 ${top_srcdir}/scripts/paxcheck.sh ${top_srcdir}; \
150 echo "skipping paxcheck because scanelf is not installed"; \
154 @if type flake8 > /dev/null 2>&1; then \
155 flake8 ${top_srcdir}; \
157 echo "skipping flake8 because flake8 is not installed"; \
162 find $(top_srcdir) -name .git -prune -o -name '*.[hc]' | xargs ctags
166 find $(top_srcdir) -name .pc -prune -o -name '*.[hc]' | xargs etags -a
170 pkg: @DEFAULT_PACKAGE@
171 pkg-dkms: @DEFAULT_PACKAGE@-dkms
172 pkg-kmod: @DEFAULT_PACKAGE@-kmod
173 pkg-utils: @DEFAULT_PACKAGE@-utils