aboutsummaryrefslogtreecommitdiffstats
path: root/generate_version_h.sh
blob: 4ea23c09b75a3196575cf6e0f69144623d90ba7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

VERSION=`git describe --abbrev=0`
HASH=`git show --format="%h" --no-patch master`
BRANCH=`git rev-parse --abbrev-ref HEAD`

echo "#ifndef HAVE_VERSION_H"
echo "#define HAVE_VERSION_H"
echo ""
echo "#define VERSION \"$VERSION\""
echo "#define HASH \"$HASH\""
echo "#define BRANCH \"$BRANCH\""
echo "#define VERSION_FULL VERSION\"-\"HASH\" (\"BRANCH\")\""
echo "char* version();"
echo ""
echo "#endif"