Archived
1
0
Fork 0

Adding version generation script for Makefile.

This commit is contained in:
Henrik Hautakoski 2013-08-22 10:01:54 +02:00
parent 39b8fb640f
commit d779db6715
3 changed files with 35 additions and 1 deletions

18
VERSION-GEN Normal file
View file

@ -0,0 +1,18 @@
#!/bin/sh
VERSION=$(git describe --always --tags --match "v[0-9]*" HEAD 2>/dev/null)
if [ -n "$(git status --porcelain)" ]; then
VERSION="${VERSION}-dirty"
fi
if [ -f "${1}" ]; then
OLD=$(cat ${1} | sed 's/VERSION = //')
else
OLD=unset
fi
if [ "${VERSION}" != "${OLD}" ]; then
#echo >&2 "VERSION = ${VERSION}"
echo "VERSION = ${VERSION}" > ${1}
fi