X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/blobdiff_plain/0bc1805c4b8135363cf0c0a98a1d84781bbea7b1..f78dde64c011f95274eee188a09495c0f67ed81c:/Makefile.am diff --git a/Makefile.am b/Makefile.am index 01ff0a6..4bdc88c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -149,6 +149,39 @@ unfuck-distdir: find '$(distdir)' -type f -exec chmod u+w {} + .PHONY: unfuck-distdir +GITLOG_FLAGS = --format='%s%n%n%b%n' + +dist-hook: generate-changelog +generate-changelog: unfuck-distdir + -: "$${GIT_DIR=$(top_srcdir)/.git}"; \ + export GIT_DIR; test -d "$$GIT_DIR" || exit 0; \ + $(top_srcdir)/gitlog-to-changelog $(GITLOG_FLAGS) \ + >'$(distdir)/ChangeLog.gen' && \ + mv -f '$(distdir)/ChangeLog.gen' '$(distdir)/ChangeLog' + rm -f '$(distdir)/ChangeLog.gen' +.PHONY: generate-changelog + +GENERIC_V = $(GENERIC_V_@AM_V@) +GENERIC_V_ = $(GENERIC_V_@AM_DEFAULT_V@) +GENERIC_V_0 = @printf '%2.0s%$(DX_ALIGN_V)s %s\n' + +TEST_DISTRIBUTION = false +TEST_DISTRIBUTION_OR_ERROR = if $(TEST_DISTRIBUTION); \ + then echo 'Proceeding anyway...'; \ + else echo 'Run $(MAKE) TEST_DISTRIBUTION=true to ignore this failure.'; \ + false; \ + fi + +distcheck-hook: + $(GENERIC_V) : 'CHECK ' ChangeLog; \ + $(AWK) '/^Stub/ { print FILENAME ":" NR ":", $$0; exit 1 }' \ + $(distdir)/ChangeLog || { \ + echo 'ERROR: *** Packaged ChangeLog was not properly generated from git log.'; \ + echo ' *** The source version was used instead, but this appears to'; \ + echo ' *** be the stub from a git checkout. The "git" and "perl"'; \ + echo ' *** programs are required for ChangeLog generation to work.'; \ + $(TEST_DISTRIBUTION_OR_ERROR); } >&2 + # Supporting rules for bison/flex. BISON_V = $(BISON_V_@AM_V@)