]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
build: try to save current version in `VERSION`
authorVincent Bernat <bernat@luffy.cx>
Wed, 20 Feb 2013 21:35:57 +0000 (22:35 +0100)
committerVincent Bernat <bernat@luffy.cx>
Wed, 20 Feb 2013 21:35:57 +0000 (22:35 +0100)
Makefile.am
configure.ac

index 16870f81de9e592365e9e5bce87b2a6e70b2138c..71711f58459bb736787eca0e7313f16e1c5e2284 100644 (file)
@@ -6,10 +6,11 @@ SUBDIRS      = src/compat src src/daemon src/lib src/client tests
 EXTRA_DIST   = $(DX_CONFIG) include
 DIST_SUBDIRS = $(SUBDIRS) libevent
 
-dist_doc_DATA = README.md NEWS ChangeLog
+dist_doc_DATA = README.md NEWS ChangeLog VERSION
+
+dist-hook: $(distdir)/ChangeLog $(distdir)/VERSION
 
 # Build changelog from git history
-dist-hook: $(distdir)/ChangeLog
 __force-changelog-generation:
 $(distdir)/ChangeLog: __force-changelog-generation
        $(AM_V_GEN)if test -d $(top_srcdir)/.git; then \
@@ -29,4 +30,15 @@ $(distdir)/ChangeLog: __force-changelog-generation
 ChangeLog:
        touch $@
 
+# Keep current version in a file in case we need to regenerate outside of git
+__force-VERSION-generation:
+$(distdir)/VERSION: __force-VERSION-generation
+       $(AM_V_GEN)if test -d $(top_srcdir)/.git; then \
+               git describe --tags --always --match '[0-9]*' 2> /dev/null > $@ ; \
+       else \
+               touch $@ ; \
+       fi
+VERSION:
+       touch VERSION
+
 MOSTLYCLEANFILES = $(DX_CLEANFILES)
index 319afaa685e4a421353d30e1d2647fcb6f8f1713..ea24d2def02092763dcfa065635bb4a061cf453c 100644 (file)
@@ -11,7 +11,7 @@ dnl Use something like this if you need to patch autoconf files and
 dnl regenerate configure outside upstream git tree:
 dnl AC_INIT([lldpd], [0.5.7], [bernat@luffy.cx])
 AC_INIT([lldpd],
-        [m4_esyscmd_s([git describe --tags --always --match [0-9]* 2> /dev/null || date +%F])],
+        [m4_esyscmd_s([git describe --tags --always --match [0-9]* 2> /dev/null || cat VERSION 2> /dev/null || date +%F])],
         [bernat@luffy.cx])
 
 AC_CONFIG_SRCDIR([src/log.c])