Add git commit version info

This commit is contained in:
john hood
2015-05-18 18:56:40 -04:00
committed by John Hood
parent e0138bdb2b
commit f3073bbe5d
5 changed files with 32 additions and 7 deletions
+21
View File
@@ -1,3 +1,24 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src scripts man conf
EXTRA_DIST = autogen.sh ocb-license.html README.md COPYING.iOS
nodist_noinst_HEADERS = version.h
BUILT_SOURCES = version.h
.PHONY: VERSION
VERSION:
@-[ -f VERSION ] || echo @PACKAGE_STRING@ > VERSION
@-git status > /dev/null 2>&1 && \
git describe --dirty > VERSION.new && \
! diff -q VERSION VERSION.new > /dev/null && \
mv VERSION.new VERSION
@rm -f VERSION.new
version.h: VERSION
@printf '#define BUILD_VERSION "%s"\n' "$$(cat VERSION)" > version.h.new
@-! diff -q version.h version.h.new > /dev/null && \
mv version.h.new version.h
@rm -f version.h.new
clean-local:
@rm -f version.h VERSION