From 80771ccb88b5c4558f1bc78fc17abd514ce92983 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sun, 6 Jan 2013 14:45:53 +0100 Subject: [PATCH] build: fix generation of ChangeLog We must be able to have one when git is not present because we include it in dist, but we also must generate it on each release. The previous fix would keep the ChangeLog empty or not updated. We use a PHONY target instead (and not a real PHONY target since we cannot add it because automake doesn't like it). --- Makefile.am | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Makefile.am b/Makefile.am index e4b29a41..d51087ca 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,14 +8,11 @@ DIST_SUBDIRS = $(SUBDIRS) libevent dist_doc_DATA = README.md NEWS doc_DATA = ChangeLog -# If not present, just ship an empty one -ChangeLog: - touch $@ -# Build changelog from git history -dist-hook: $(distdir)/ChangeLog -$(distdir)/ChangeLog: - if test -d $(top_srcdir)/.git; then \ +# Not able to add a .PHONY target +force-changelog-generation: +ChangeLog: force-changelog-generation + $(AM_V_GEN)if test -d $(top_srcdir)/.git; then \ prev=$$(git describe --tags --always --match [0-9]* 2> /dev/null) ; \ for tag in $$(git tag | grep -E '^[0-9]+(\.[0-9]+){1,}$$' | sort -rn); do \ if [ x"$$prev" = x ]; then prev=$$tag ; fi ; \ @@ -26,6 +23,8 @@ $(distdir)/ChangeLog: echo "" ; \ prev=$$tag ; \ done > $@ ; \ + else \ + touch $@ ; \ fi MOSTLYCLEANFILES = $(DX_CLEANFILES) -- 2.39.5