Generate include/serno.h from git information, if available.

This commit is contained in:
Jilles Tjoelker 2011-06-18 13:22:57 +02:00
parent 0531ae63b6
commit d3cfd0324a

View file

@ -64,7 +64,10 @@ build:
echo "Doing so now."; \ echo "Doing so now."; \
sh configure; \ sh configure; \
fi 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/_/-/`;\ 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 ; \ [ -z "$$revh" ] || echo '#define SERNO "'$$revh'"' >include/serno.h ; \
fi fi