diff --git a/Makefile.am b/Makefile.am index da4f6407d18b..3992fe9adb22 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,173 +1,174 @@ ACLOCAL_AMFLAGS = -I config include config/rpm.am include config/deb.am include config/tgz.am SUBDIRS = include rpm if CONFIG_USER SUBDIRS += udev etc man scripts lib tests cmd contrib endif if CONFIG_KERNEL SUBDIRS += module extradir = $(prefix)/src/zfs-$(VERSION) extra_HEADERS = zfs.release.in zfs_config.h.in kerneldir = $(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION) nodist_kernel_HEADERS = zfs.release zfs_config.h module/$(LINUX_SYMBOLS) endif AUTOMAKE_OPTIONS = foreign EXTRA_DIST = autogen.sh copy-builtin EXTRA_DIST += config/config.awk config/rpm.am config/deb.am config/tgz.am EXTRA_DIST += META AUTHORS COPYRIGHT LICENSE NEWS NOTICE README.md EXTRA_DIST += CODE_OF_CONDUCT.md # Include all the extra licensing information for modules EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE EXTRA_DIST += module/icp/algs/skein/THIRDPARTYLICENSE.descrip EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman.descrip EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl EXTRA_DIST += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl.descrip EXTRA_DIST += module/spl/THIRDPARTYLICENSE.gplv2 EXTRA_DIST += module/spl/THIRDPARTYLICENSE.gplv2.descrip EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash EXTRA_DIST += module/zfs/THIRDPARTYLICENSE.cityhash.descrip @CODE_COVERAGE_RULES@ .PHONY: gitrev gitrev: -${top_srcdir}/scripts/make_gitrev.sh BUILT_SOURCES = gitrev -distclean-local: +# Double-colon rules are allowed; there are multiple independent definitions. +distclean-local:: -$(RM) -R autom4te*.cache -find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \ -o -name .pc -o -name .hg -o -name .git \) -prune -o \ \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ -o -name '.*.rej' -o -size 0 -o -name '*%' -o -name '.*.cmd' \ -o -name 'core' -o -name 'Makefile' -o -name 'Module.symvers' \ -o -name '*.order' -o -name '*.markers' -o -name '*.gcda' \ -o -name '*.gcno' \) \ -type f -print | xargs $(RM) all-local: -[ -x ${top_builddir}/scripts/zfs-tests.sh ] && \ ${top_builddir}/scripts/zfs-tests.sh -c dist-hook: gitrev cp ${top_srcdir}/include/zfs_gitrev.h $(distdir)/include; \ sed -i 's/Release:[[:print:]]*/Release: $(RELEASE)/' \ $(distdir)/META # For compatibility, create a matching spl-x.y.z directly which contains # symlinks to the updated header and object file locations. These # compatibility links will be removed in the next major release. if CONFIG_KERNEL install-data-hook: rm -rf $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \ mkdir $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \ cd $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \ ln -s ../zfs-$(VERSION)/include/spl include && \ ln -s ../zfs-$(VERSION)/$(LINUX_VERSION) $(LINUX_VERSION) && \ ln -s ../zfs-$(VERSION)/zfs_config.h.in spl_config.h.in && \ ln -s ../zfs-$(VERSION)/zfs.release.in spl.release.in && \ cd $(DESTDIR)$(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION) && \ ln -fs zfs_config.h spl_config.h && \ ln -fs zfs.release spl.release endif codecheck: cstyle shellcheck flake8 mancheck testscheck vcscheck checkstyle: codecheck commitcheck commitcheck: @if git rev-parse --git-dir > /dev/null 2>&1; then \ ${top_srcdir}/scripts/commitcheck.sh; \ fi cstyle: @find ${top_srcdir} -name '*.[hc]' ! -name 'zfs_config.*' \ ! -name '*.mod.c' -type f \ -exec ${top_srcdir}/scripts/cstyle.pl -cpP {} \+ shellcheck: @if type shellcheck > /dev/null 2>&1; then \ shellcheck --exclude=SC1090 --format=gcc \ $$(find ${top_srcdir}/scripts/*.sh -type f) \ $$(find ${top_srcdir}/cmd/zed/zed.d/*.sh -type f) \ $$(find ${top_srcdir}/cmd/zpool/zpool.d/* -executable); \ else \ echo "skipping shellcheck because shellcheck is not installed"; \ fi mancheck: @if type mandoc > /dev/null 2>&1; then \ find ${top_srcdir}/man/man8 -type f -name 'zfs.8' \ -o -name 'zpool.8' -o -name 'zdb.8' \ -o -name 'zgenhostid.8' | \ xargs mandoc -Tlint -Werror; \ else \ echo "skipping mancheck because mandoc is not installed"; \ fi testscheck: @find ${top_srcdir}/tests/zfs-tests -type f \ \( -name '*.ksh' -not -executable \) -o \ \( -name '*.kshlib' -executable \) -o \ \( -name '*.shlib' -executable \) -o \ \( -name '*.cfg' -executable \) | \ xargs -r stat -c '%A %n' | \ awk '{c++; print} END {if(c>0) exit 1}' vcscheck: @if git rev-parse --git-dir > /dev/null 2>&1; then \ git ls-files . --exclude-standard --others | \ awk '{c++; print} END {if(c>0) exit 1}' ; \ fi lint: cppcheck paxcheck cppcheck: @if type cppcheck > /dev/null 2>&1; then \ cppcheck --quiet --force --error-exitcode=2 --inline-suppr \ --suppressions-list=.github/suppressions.txt \ -UHAVE_SSE2 -UHAVE_AVX512F -UHAVE_UIO_ZEROCOPY \ ${top_srcdir}; \ else \ echo "skipping cppcheck because cppcheck is not installed"; \ fi paxcheck: @if type scanelf > /dev/null 2>&1; then \ ${top_srcdir}/scripts/paxcheck.sh ${top_srcdir}; \ else \ echo "skipping paxcheck because scanelf is not installed"; \ fi flake8: @if type flake8 > /dev/null 2>&1; then \ flake8 ${top_srcdir}; \ else \ echo "skipping flake8 because flake8 is not installed"; \ fi ctags: $(RM) tags find $(top_srcdir) -name .git -prune -o -name '*.[hc]' | xargs ctags etags: $(RM) TAGS find $(top_srcdir) -name .pc -prune -o -name '*.[hc]' | xargs etags -a tags: ctags etags pkg: @DEFAULT_PACKAGE@ pkg-dkms: @DEFAULT_PACKAGE@-dkms pkg-kmod: @DEFAULT_PACKAGE@-kmod pkg-utils: @DEFAULT_PACKAGE@-utils diff --git a/contrib/dracut/02zfsexpandknowledge/Makefile.am b/contrib/dracut/02zfsexpandknowledge/Makefile.am index a5c567c161c8..6e553e8d456f 100644 --- a/contrib/dracut/02zfsexpandknowledge/Makefile.am +++ b/contrib/dracut/02zfsexpandknowledge/Makefile.am @@ -1,22 +1,24 @@ pkgdracutdir = $(dracutdir)/modules.d/02zfsexpandknowledge pkgdracut_SCRIPTS = \ module-setup.sh EXTRA_DIST = \ $(top_srcdir)/contrib/dracut/02zfsexpandknowledge/module-setup.sh.in $(pkgdracut_SCRIPTS):%:%.in -$(SED) -e 's,@bindir\@,$(bindir),g' \ -e 's,@sbindir\@,$(sbindir),g' \ -e 's,@datadir\@,$(datadir),g' \ -e 's,@dracutdir\@,$(dracutdir),g' \ -e 's,@udevdir\@,$(udevdir),g' \ -e 's,@udevruledir\@,$(udevruledir),g' \ -e 's,@sysconfdir\@,$(sysconfdir),g' \ $< >'$@' +# Double-colon rules are allowed; there are multiple independent definitions. clean-local:: -$(RM) $(pkgdracut_SCRIPTS) +# Double-colon rules are allowed; there are multiple independent definitions. distclean-local:: -$(RM) $(pkgdracut_SCRIPTS) diff --git a/contrib/dracut/90zfs/Makefile.am b/contrib/dracut/90zfs/Makefile.am index 0a557f57f256..1680230fa34e 100644 --- a/contrib/dracut/90zfs/Makefile.am +++ b/contrib/dracut/90zfs/Makefile.am @@ -1,37 +1,38 @@ pkgdracutdir = $(dracutdir)/modules.d/90zfs pkgdracut_SCRIPTS = \ export-zfs.sh \ module-setup.sh \ mount-zfs.sh \ parse-zfs.sh \ zfs-generator.sh \ zfs-load-key.sh \ zfs-needshutdown.sh \ zfs-lib.sh pkgdracut_DATA = \ zfs-env-bootfs.service EXTRA_DIST = \ $(top_srcdir)/contrib/dracut/90zfs/export-zfs.sh.in \ $(top_srcdir)/contrib/dracut/90zfs/module-setup.sh.in \ $(top_srcdir)/contrib/dracut/90zfs/mount-zfs.sh.in \ $(top_srcdir)/contrib/dracut/90zfs/parse-zfs.sh.in \ $(top_srcdir)/contrib/dracut/90zfs/zfs-generator.sh.in \ $(top_srcdir)/contrib/dracut/90zfs/zfs-load-key.sh.in \ $(top_srcdir)/contrib/dracut/90zfs/zfs-needshutdown.sh.in \ $(top_srcdir)/contrib/dracut/90zfs/zfs-lib.sh.in \ $(top_srcdir)/contrib/dracut/90zfs/zfs-env-bootfs.service.in $(pkgdracut_SCRIPTS) $(pkgdracut_DATA) :%:%.in -$(SED) -e 's,@bindir\@,$(bindir),g' \ -e 's,@sbindir\@,$(sbindir),g' \ -e 's,@udevdir\@,$(udevdir),g' \ -e 's,@udevruledir\@,$(udevruledir),g' \ -e 's,@sysconfdir\@,$(sysconfdir),g' \ -e 's,@systemdunitdir\@,$(systemdunitdir),g' \ -e 's,@mounthelperdir\@,$(mounthelperdir),g' \ $< >'$@' +# Double-colon rules are allowed; there are multiple independent definitions. distclean-local:: -$(RM) $(pkgdracut_SCRIPTS) $(pkgdracut_DATA) diff --git a/contrib/initramfs/hooks/Makefile.am b/contrib/initramfs/hooks/Makefile.am index 1735872c29b7..3d8ef627ed47 100644 --- a/contrib/initramfs/hooks/Makefile.am +++ b/contrib/initramfs/hooks/Makefile.am @@ -1,21 +1,23 @@ hooksdir = /usr/share/initramfs-tools/hooks hooks_SCRIPTS = \ zfs EXTRA_DIST = \ $(top_srcdir)/contrib/initramfs/hooks/zfs.in $(hooks_SCRIPTS):%:%.in -$(SED) -e 's,@sbindir\@,$(sbindir),g' \ -e 's,@sysconfdir\@,$(sysconfdir),g' \ -e 's,@udevdir\@,$(udevdir),g' \ -e 's,@udevruledir\@,$(udevruledir),g' \ -e 's,@mounthelperdir\@,$(mounthelperdir),g' \ $< >'$@' +# Double-colon rules are allowed; there are multiple independent definitions. clean-local:: -$(RM) $(hooks_SCRIPTS) +# Double-colon rules are allowed; there are multiple independent definitions. distclean-local:: -$(RM) $(hooks_SCRIPTS) diff --git a/contrib/initramfs/scripts/Makefile.am b/contrib/initramfs/scripts/Makefile.am index 12c2641b80cc..3ab18ba2cbce 100644 --- a/contrib/initramfs/scripts/Makefile.am +++ b/contrib/initramfs/scripts/Makefile.am @@ -1,20 +1,22 @@ scriptsdir = /usr/share/initramfs-tools/scripts scripts_DATA = \ zfs SUBDIRS = local-top EXTRA_DIST = \ $(top_srcdir)/contrib/initramfs/scripts/zfs.in $(scripts_DATA):%:%.in -$(SED) -e 's,@sbindir\@,$(sbindir),g' \ -e 's,@sysconfdir\@,$(sysconfdir),g' \ $< >'$@' +# Double-colon rules are allowed; there are multiple independent definitions. clean-local:: -$(RM) $(scripts_SCRIPTS) +# Double-colon rules are allowed; there are multiple independent definitions. distclean-local:: -$(RM) $(scripts_SCRIPTS) diff --git a/etc/init.d/Makefile.am b/etc/init.d/Makefile.am index 93432386a2c4..8b1a7cf9629b 100644 --- a/etc/init.d/Makefile.am +++ b/etc/init.d/Makefile.am @@ -1,44 +1,45 @@ initdir = $(DEFAULT_INIT_DIR) init_SCRIPTS = zfs-import zfs-mount zfs-share zfs-zed initcommondir = $(sysconfdir)/zfs initcommon_SCRIPTS = zfs-functions initconfdir = $(DEFAULT_INITCONF_DIR) initconf_SCRIPTS = zfs EXTRA_DIST = \ $(top_srcdir)/etc/init.d/zfs-functions.in \ $(top_srcdir)/etc/init.d/zfs-share.in \ $(top_srcdir)/etc/init.d/zfs-import.in \ $(top_srcdir)/etc/init.d/zfs-mount.in \ $(top_srcdir)/etc/init.d/zfs-zed.in \ $(top_srcdir)/etc/init.d/zfs.in $(init_SCRIPTS) $(initconf_SCRIPTS) $(initcommon_SCRIPTS):%:%.in -(if [ -e /etc/debian_version ]; then \ NFS_SRV=nfs-kernel-server; \ else \ NFS_SRV=nfs; \ fi; \ if [ -e /sbin/openrc-run ]; then \ SHELL=/sbin/openrc-run; \ else \ SHELL=/bin/sh; \ fi; \ $(SED) -e 's,@bindir\@,$(bindir),g' \ -e 's,@sbindir\@,$(sbindir),g' \ -e 's,@udevdir\@,$(udevdir),g' \ -e 's,@udevruledir\@,$(udevruledir),g' \ -e 's,@sysconfdir\@,$(sysconfdir),g' \ -e 's,@initconfdir\@,$(initconfdir),g' \ -e 's,@initdir\@,$(initdir),g' \ -e 's,@runstatedir\@,$(runstatedir),g' \ -e "s,@SHELL\@,$$SHELL,g" \ -e "s,@NFS_SRV\@,$$NFS_SRV,g" \ $< >'$@'; \ [ '$@' = 'zfs-functions' -o '$@' = 'zfs' ] || \ chmod +x '$@') +# Double-colon rules are allowed; there are multiple independent definitions. distclean-local:: -$(RM) $(init_SCRIPTS) $(initcommon_SCRIPTS) $(initconf_SCRIPTS) diff --git a/etc/modules-load.d/Makefile.am b/etc/modules-load.d/Makefile.am index 58c7acd44e7c..47762b7d0657 100644 --- a/etc/modules-load.d/Makefile.am +++ b/etc/modules-load.d/Makefile.am @@ -1,13 +1,14 @@ modulesload_DATA = \ zfs.conf EXTRA_DIST = \ $(top_srcdir)/etc/modules-load.d/zfs.conf.in $(modulesload_DATA):%:%.in -$(SED) \ -e '' \ $< >'$@' +# Double-colon rules are allowed; there are multiple independent definitions. distclean-local:: -$(RM) $(modulesload_DATA) diff --git a/etc/systemd/system-generators/Makefile.am b/etc/systemd/system-generators/Makefile.am index c730982a5152..b4df01322211 100644 --- a/etc/systemd/system-generators/Makefile.am +++ b/etc/systemd/system-generators/Makefile.am @@ -1,15 +1,16 @@ systemdgenerator_SCRIPTS = \ zfs-mount-generator EXTRA_DIST = \ $(top_srcdir)/etc/systemd/system-generators/zfs-mount-generator.in $(systemdgenerator_SCRIPTS): %: %.in -$(SED) -e 's,@bindir\@,$(bindir),g' \ -e 's,@runstatedir\@,$(runstatedir),g' \ -e 's,@sbindir\@,$(sbindir),g' \ -e 's,@sysconfdir\@,$(sysconfdir),g' \ $< >'$@' +# Double-colon rules are allowed; there are multiple independent definitions. distclean-local:: -$(RM) $(systemdgenerator_SCRIPTS) diff --git a/etc/systemd/system/Makefile.am b/etc/systemd/system/Makefile.am index 130c6c757a59..4e14467a044f 100644 --- a/etc/systemd/system/Makefile.am +++ b/etc/systemd/system/Makefile.am @@ -1,39 +1,40 @@ systemdpreset_DATA = \ 50-zfs.preset systemdunit_DATA = \ zfs-zed.service \ zfs-import-cache.service \ zfs-import-scan.service \ zfs-mount.service \ zfs-share.service \ zfs-volume-wait.service \ zfs-import.target \ zfs-volumes.target \ zfs.target EXTRA_DIST = \ $(top_srcdir)/etc/systemd/system/zfs-zed.service.in \ $(top_srcdir)/etc/systemd/system/zfs-import-cache.service.in \ $(top_srcdir)/etc/systemd/system/zfs-import-scan.service.in \ $(top_srcdir)/etc/systemd/system/zfs-mount.service.in \ $(top_srcdir)/etc/systemd/system/zfs-share.service.in \ $(top_srcdir)/etc/systemd/system/zfs-import.target.in \ $(top_srcdir)/etc/systemd/system/zfs-volume-wait.service.in \ $(top_srcdir)/etc/systemd/system/zfs-volumes.target.in \ $(top_srcdir)/etc/systemd/system/zfs.target.in \ $(top_srcdir)/etc/systemd/system/50-zfs.preset.in $(systemdunit_DATA) $(systemdpreset_DATA):%:%.in -$(SED) -e 's,@bindir\@,$(bindir),g' \ -e 's,@runstatedir\@,$(runstatedir),g' \ -e 's,@sbindir\@,$(sbindir),g' \ -e 's,@sysconfdir\@,$(sysconfdir),g' \ $< >'$@' install-data-hook: $(MKDIR_P) "$(DESTDIR)$(systemdunitdir)" ln -sf /dev/null "$(DESTDIR)$(systemdunitdir)/zfs-import.service" +# Double-colon rules are allowed; there are multiple independent definitions. distclean-local:: -$(RM) $(systemdunit_DATA) $(systemdpreset_DATA) diff --git a/tests/zfs-tests/include/Makefile.am b/tests/zfs-tests/include/Makefile.am index 41e105287b48..86c387c677d7 100644 --- a/tests/zfs-tests/include/Makefile.am +++ b/tests/zfs-tests/include/Makefile.am @@ -1,20 +1,21 @@ pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/include dist_pkgdata_DATA = \ blkdev.shlib \ commands.cfg \ libtest.shlib \ math.shlib \ properties.shlib \ zpool_script.shlib EXTRA_DIST = default.cfg.in nodist_pkgdata_DATA = default.cfg $(nodist_pkgdata_DATA): %: %.in -$(SED) -e 's,@zfsexecdir\@,$(zfsexecdir),g' \ -e 's,@sysconfdir\@,$(sysconfdir),g' \ $< >'$@' +# Double-colon rules are allowed; there are multiple independent definitions. distclean-local:: -$(RM) default.cfg diff --git a/tests/zfs-tests/tests/functional/pyzfs/Makefile.am b/tests/zfs-tests/tests/functional/pyzfs/Makefile.am index 0a27adeccaf4..c4cd10894c3c 100644 --- a/tests/zfs-tests/tests/functional/pyzfs/Makefile.am +++ b/tests/zfs-tests/tests/functional/pyzfs/Makefile.am @@ -1,18 +1,19 @@ pkgpyzfsdir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/pyzfs pkgpyzfs_SCRIPTS = \ pyzfs_unittest.ksh EXTRA_DIST = \ pyzfs_unittest.ksh.in # # The pyzfs module is built either for Python 2 or Python 3. In order # to properly test it the unit tests must be updated to the matching vesion. # $(pkgpyzfs_SCRIPTS):%:%.in -$(SED) -e 's,@PYTHON\@,$(PYTHON),g' \ $< >'$@' -chmod 775 $@ +# Double-colon rules are allowed; there are multiple independent definitions. distclean-local:: -$(RM) $(pkgpyzfs_SCRIPTS) diff --git a/udev/rules.d/Makefile.am b/udev/rules.d/Makefile.am index f79ea4b3c3e4..86c33fc697cc 100644 --- a/udev/rules.d/Makefile.am +++ b/udev/rules.d/Makefile.am @@ -1,20 +1,21 @@ udevrule_DATA = \ 69-vdev.rules \ 60-zvol.rules \ 90-zfs.rules EXTRA_DIST = \ $(top_srcdir)/udev/rules.d/69-vdev.rules.in \ $(top_srcdir)/udev/rules.d/60-zvol.rules.in \ $(top_srcdir)/udev/rules.d/90-zfs.rules.in $(udevrule_DATA):%:%.in -$(SED) -e 's,@bindir\@,$(bindir),g' \ -e 's,@sbindir\@,$(sbindir),g' \ -e 's,@udevdir\@,$(udevdir),g' \ -e 's,@udevruledir\@,$(udevruledir),g' \ -e 's,@sysconfdir\@,$(sysconfdir),g' \ $< > '$@' +# Double-colon rules are allowed; there are multiple independent definitions. distclean-local:: -$(RM) $(udevrule_DATA)