From d3cfd0324a37930b7cc2cdf1d221f9e04b098b92 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Sat, 18 Jun 2011 13:22:57 +0200 Subject: [PATCH] Generate include/serno.h from git information, if available. --- Makefile.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 50363600..7a555d84 100644 --- a/Makefile.in +++ b/Makefile.in @@ -64,7 +64,10 @@ build: echo "Doing so now."; \ sh configure; \ fi - @if [ -d .hg ] ; then \ + @if [ -d .git ] ; then \ + revh=`git log -1 --date=short --pretty=format:%cd_%h 2>/dev/null | sed -e s/-//g -e s/_/-/`;\ + [ -z "$$revh" ] || echo '#define SERNO "'$$revh'"' >include/serno.h ; \ + elif [ -d .hg ] ; then \ revh=`hg parents --template '{date|shortdate}_{node|short}' 2>/dev/null | sed -e s/-//g -e s/_/-/`;\ [ -z "$$revh" ] || echo '#define SERNO "'$$revh'"' >include/serno.h ; \ fi