diff --git a/Makefile.am b/Makefile.am index b4e111b91ef1939125c46741da409799eef832c3..5f822b2462f0c4d0a8152d78212bd0d5c58b6f9f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -751,6 +751,15 @@ distcheck-hook: echo "Found backup files in final archive." 1>&2; \ exit 1; \ fi +# Empty files or directories should not be distributed. They can cause +# unnecessary warnings for packagers. Directories used by automake during +# distcheck must be excluded. + if find $(top_distdir) -empty -and -not \( \ + -path $(top_distdir)/_build -or \ + -path $(top_distdir)/_inst \) | grep .; then \ + echo "Found empty files or directories in final archive." 1>&2; \ + exit 1; \ + fi if test -n "$(BUILD_RELEASE)" && \ grep -n -H -E '^\*.*unreleased' $(top_distdir)/NEWS; then \ echo "Found unreleased version in NEWS." >&2; \