-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 DISCLAIMER COPYRIGHT README.markdown OPENSOLARIS.LICENSE
-
-distclean-local::
- -$(RM) -R autom4te*.cache
+dist_noinst_DATA += autogen.sh copy-builtin
+dist_noinst_DATA += AUTHORS CODE_OF_CONDUCT.md COPYRIGHT LICENSE META NEWS NOTICE
+dist_noinst_DATA += README.md RELEASES.md
+dist_noinst_DATA += module/lua/README.zfs module/os/linux/spl/README.md
+
+# Include all the extra licensing information for modules
+dist_noinst_DATA += module/icp/algs/skein/THIRDPARTYLICENSE
+dist_noinst_DATA += module/icp/algs/skein/THIRDPARTYLICENSE.descrip
+dist_noinst_DATA += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman
+dist_noinst_DATA += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman.descrip
+dist_noinst_DATA += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl
+dist_noinst_DATA += module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl.descrip
+dist_noinst_DATA += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.cryptogams
+dist_noinst_DATA += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.cryptogams.descrip
+dist_noinst_DATA += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.openssl
+dist_noinst_DATA += module/icp/asm-x86_64/modes/THIRDPARTYLICENSE.openssl.descrip
+dist_noinst_DATA += module/os/linux/spl/THIRDPARTYLICENSE.gplv2
+dist_noinst_DATA += module/os/linux/spl/THIRDPARTYLICENSE.gplv2.descrip
+dist_noinst_DATA += module/zfs/THIRDPARTYLICENSE.cityhash
+dist_noinst_DATA += module/zfs/THIRDPARTYLICENSE.cityhash.descrip
+
+@CODE_COVERAGE_RULES@
+
+GITREV = include/zfs_gitrev.h
+CLEANFILES += $(GITREV)
+PHONY += gitrev
+gitrev:
+ $(AM_V_GEN)$(top_srcdir)/scripts/make_gitrev.sh $(GITREV)
+
+all: gitrev
+
+PHONY += install-data-hook $(INSTALL_DATA_HOOKS)
+install-data-hook: $(INSTALL_DATA_HOOKS)
+
+PHONY += maintainer-clean-local
+maintainer-clean-local:
+ -$(RM) $(GITREV)
+
+PHONY += distclean-local
+distclean-local:
+ -$(RM) -R autom4te*.cache build