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 \
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)
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])