1# SPDX-License-Identifier: CDDL-1.0 2CLEANFILES = 3dist_noinst_DATA = 4INSTALL_DATA_HOOKS = 5INSTALL_EXEC_HOOKS = 6ALL_LOCAL = 7CLEAN_LOCAL = 8CHECKS = shellcheck checkbashisms 9 10include $(top_srcdir)/config/Rules.am 11include $(top_srcdir)/config/CppCheck.am 12include $(top_srcdir)/config/Shellcheck.am 13include $(top_srcdir)/config/Substfiles.am 14include $(top_srcdir)/scripts/Makefile.am 15 16ACLOCAL_AMFLAGS = -I config 17 18SUBDIRS = include 19if BUILD_LINUX 20include $(srcdir)/%D%/rpm/Makefile.am 21endif 22 23if CONFIG_USER 24include $(srcdir)/%D%/cmd/Makefile.am 25include $(srcdir)/%D%/contrib/Makefile.am 26include $(srcdir)/%D%/etc/Makefile.am 27include $(srcdir)/%D%/lib/Makefile.am 28include $(srcdir)/%D%/man/Makefile.am 29include $(srcdir)/%D%/tests/Makefile.am 30if BUILD_LINUX 31include $(srcdir)/%D%/udev/Makefile.am 32endif 33endif 34CPPCHECKDIRS += module 35if CONFIG_KERNEL 36SUBDIRS += module 37 38extradir = $(prefix)/src/zfs-$(VERSION) 39extra_HEADERS = zfs.release.in zfs_config.h.in 40endif 41 42dist_noinst_DATA += autogen.sh copy-builtin 43dist_noinst_DATA += AUTHORS CODE_OF_CONDUCT.md COPYRIGHT LICENSE META NEWS NOTICE 44dist_noinst_DATA += README.md RELEASES.md 45dist_noinst_DATA += module/lua/README.zfs module/os/linux/spl/README.md 46 47# Include all the extra licensing information for modules 48dist_noinst_DATA += module/icp/algs/skein/THIRDPARTYLICENSE 49dist_noinst_DATA += module/icp/algs/skein/THIRDPARTYLICENSE.descrip 50dist_noinst_DATA += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman 51dist_noinst_DATA += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman.descrip 52dist_noinst_DATA += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl 53dist_noinst_DATA += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl.descrip 54dist_noinst_DATA += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.cryptogams 55dist_noinst_DATA += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.cryptogams.descrip 56dist_noinst_DATA += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.openssl 57dist_noinst_DATA += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.openssl.descrip 58dist_noinst_DATA += module/os/linux/spl/THIRDPARTYLICENSE.gplv2 59dist_noinst_DATA += module/os/linux/spl/THIRDPARTYLICENSE.gplv2.descrip 60dist_noinst_DATA += module/zfs/THIRDPARTYLICENSE.cityhash 61dist_noinst_DATA += module/zfs/THIRDPARTYLICENSE.cityhash.descrip 62 63@CODE_COVERAGE_RULES@ 64 65GITREV = include/zfs_gitrev.h 66CLEANFILES += $(GITREV) 67PHONY += gitrev 68gitrev: 69 $(AM_V_GEN)$(top_srcdir)/scripts/make_gitrev.sh $(GITREV) 70 71all: gitrev 72 73PHONY += install-data-hook $(INSTALL_DATA_HOOKS) 74install-data-hook: $(INSTALL_DATA_HOOKS) 75 76PHONY += install-exec-hook $(INSTALL_EXEC_HOOKS) 77install-exec-hook: $(INSTALL_EXEC_HOOKS) 78 79PHONY += maintainer-clean-local 80maintainer-clean-local: 81 -$(RM) $(GITREV) 82 83PHONY += distclean-local 84distclean-local: 85 -$(RM) -R autom4te*.cache build 86 -find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \ 87 -o -name .pc -o -name .hg -o -name .git \) -prune -o \ 88 \( -name '*.orig' -o -name '*.rej' -o -name '*~' \ 89 -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \ 90 -o -name '.*.rej' -o -size 0 -o -name '*%' -o -name '.*.cmd' \ 91 -o -name 'core' -o -name 'Makefile' -o -name 'Module.symvers' \ 92 -o -name '*.order' -o -name '*.markers' -o -name '*.gcda' \ 93 -o -name '*.gcno' \) \ 94 -type f -delete 95 96PHONY += $(CLEAN_LOCAL) 97clean-local: $(CLEAN_LOCAL) 98 99PHONY += $(ALL_LOCAL) 100all-local: $(ALL_LOCAL) 101 102dist-hook: 103 $(top_srcdir)/scripts/make_gitrev.sh -D $(distdir) $(GITREV) 104 $(SED) $(ac_inplace) 's/\(Release:[[:space:]]*\).*/\1$(RELEASE)/' $(distdir)/META 105 106PHONY += codecheck $(CHECKS) 107codecheck: $(CHECKS) 108 109SHELLCHECKSCRIPTS += autogen.sh 110 111PHONY += checkstyle 112checkstyle: codecheck commitcheck 113 114PHONY += commitcheck 115commitcheck: 116 $(AM_V_at)if git rev-parse --git-dir > /dev/null 2>&1; then \ 117 ${top_srcdir}/scripts/commitcheck.sh; \ 118 fi 119 120CHECKS += spdxcheck 121spdxcheck: 122 $(AM_V_at)$(top_srcdir)/scripts/spdxcheck.pl 123 124if HAVE_PARALLEL 125cstyle_line = -print0 | parallel -X0 ${top_srcdir}/scripts/cstyle.pl -cpP {} 126else 127cstyle_line = -exec ${top_srcdir}/scripts/cstyle.pl -cpP {} + 128endif 129CHECKS += cstyle 130cstyle: 131 $(AM_V_at)find $(top_srcdir) -name build -prune \ 132 -o -type f -name '*.[hc]' \ 133 ! -name 'zfs_config.*' ! -name '*.mod.c' \ 134 ! -name 'opt_global.h' ! -name '*_if*.h' \ 135 ! -name 'zstd_compat_wrapper.h' \ 136 ! -path './module/zstd/zstd-in.c' \ 137 ! -path './module/zstd/lib/*' \ 138 ! -path './include/sys/lua/*' \ 139 ! -path './module/lua/l*.[ch]' \ 140 ! -path './module/zfs/lz4.c' \ 141 $(cstyle_line) 142 143filter_executable = -exec test -x '{}' \; -print 144CHECKS += testscheck 145testscheck: 146 $(AM_V_at)[ $$(find $(top_srcdir)/tests/zfs-tests -type f \ 147 \( -name '*.ksh' -not $(filter_executable) \) -o \ 148 \( -name '*.kshlib' $(filter_executable) \) -o \ 149 \( -name '*.shlib' $(filter_executable) \) -o \ 150 \( -name '*.cfg' $(filter_executable) \) | \ 151 tee /dev/stderr | wc -l) -eq 0 ] 152 153CHECKS += vcscheck 154vcscheck: 155 $(AM_V_at)if git rev-parse --git-dir > /dev/null 2>&1; then \ 156 git ls-files . --exclude-standard --others | \ 157 awk '{c++; print} END {if(c>0) exit 1}' ; \ 158 fi 159 160CHECKS += zstdcheck 161zstdcheck: 162 @$(MAKE) -C module check-zstd-symbols 163 164PHONY += lint 165lint: cppcheck paxcheck 166 167PHONY += paxcheck 168paxcheck: 169 $(AM_V_at)if type scanelf > /dev/null 2>&1; then \ 170 $(top_srcdir)/scripts/paxcheck.sh $(top_builddir); \ 171 else \ 172 echo "skipping paxcheck because scanelf is not installed"; \ 173 fi 174 175CHECKS += flake8 176flake8: 177 $(AM_V_at)if type flake8 > /dev/null 2>&1; then \ 178 flake8 $(top_srcdir); \ 179 else \ 180 echo "skipping flake8 because flake8 is not installed"; \ 181 fi 182 183PHONY += regen-tests 184regen-tests: 185 @$(MAKE) -C tests/zfs-tests/tests regen 186 187PHONY += ctags 188ctags: 189 $(RM) tags 190 find $(top_srcdir) -name '.?*' -prune \ 191 -o -type f -name '*.[hcS]' -exec ctags -a {} + 192 193PHONY += etags 194etags: 195 $(RM) TAGS 196 find $(top_srcdir) -name '.?*' -prune \ 197 -o -type f -name '*.[hcS]' -exec etags -a {} + 198 199PHONY += cscopelist 200cscopelist: 201 find $(top_srcdir) -name '.?*' -prune \ 202 -o -type f -name '*.[hc]' -print >cscope.files 203 204PHONY += tags 205tags: ctags etags 206 207PHONY += pkg pkg-dkms pkg-kmod pkg-utils 208pkg: @DEFAULT_PACKAGE@ 209pkg-dkms: @DEFAULT_PACKAGE@-dkms 210pkg-kmod: @DEFAULT_PACKAGE@-kmod 211pkg-utils: @DEFAULT_PACKAGE@-utils 212 213include config/rpm.am 214include config/deb.am 215include config/tgz.am 216 217.PHONY: $(PHONY) 218