]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
build: fix generation of ChangeLog
authorVincent Bernat <bernat@luffy.cx>
Sun, 6 Jan 2013 13:45:53 +0000 (14:45 +0100)
committerVincent Bernat <bernat@luffy.cx>
Sun, 6 Jan 2013 13:45:53 +0000 (14:45 +0100)
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

index e4b29a41c1ef271d1e02a02fc6375c1f7872b40f..d51087cacb3bc6d718bfcc0081c4228ad02e35ce 100644 (file)
@@ -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)