From: Vincent Bernat Date: Sun, 6 Jan 2013 13:45:53 +0000 (+0100) Subject: build: fix generation of ChangeLog X-Git-Tag: 0.7.1~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80771ccb88b5c4558f1bc78fc17abd514ce92983;p=thirdparty%2Flldpd.git 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). --- 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)