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