diff --git a/s/build b/s/build index b59804626..f471229b8 100755 --- a/s/build +++ b/s/build @@ -1,8 +1,5 @@ #!/bin/sh -ROOT=`pwd` -while [ ! -d $ROOT/.git ]; do - ROOT=`dirname $ROOT` -done +ROOT=$(git rev-parse --show-toplevel) [ -z "$BUILD" ] && BUILD=Debug if [ -z "$JOBS" ] ; then @@ -37,7 +34,13 @@ git submodule update echo "build eressea" cd $ROOT/$BUILD +BRANCH=$(git status -s -b | head -1 | cut -d\ -f 2 | sed 's/\..*//') +if [ "$BRANCH" == "master" ] ; then VERSION=$(git describe --match 'v*.*.*' --tags | sed 's/^v//') cmake -DERESSEA_VERSION="$VERSION" .. +else +REV=$(git rev-parse --short HEAD) +cmake -DERESSEA_BUILDNO="$REV-$BUILD" .. +fi make $MAKEOPTS && make test cd $OLDPWD diff --git a/s/cmake-init b/s/cmake-init index ea94afb7c..370725a4d 100755 --- a/s/cmake-init +++ b/s/cmake-init @@ -1,13 +1,6 @@ #!/bin/sh -ROOT=$(pwd) -while [ ! -d $ROOT/.git ]; do - ROOT=$(dirname $ROOT) - if [ "$ROOT" == "/" ; then - echo "could not find root, are you in the git repository?" - exit - fi -done +ROOT=$(git rev-parse --show-toplevel) [ -z $BUILD ] && BUILD=Debug [ -z "$CC" ] && [ ! -z `which clang` ] && CC="clang" [ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc" diff --git a/s/runtests b/s/runtests index e0e20b5c7..58498436f 100755 --- a/s/runtests +++ b/s/runtests @@ -1,11 +1,7 @@ #!/bin/bash set -e -ROOT=$(pwd) -while [ ! -d $ROOT/.git ]; do - ROOT=$(dirname $ROOT) -done - +ROOT=$(git rev-parse --show-toplevel) [ -z $BUILD ] && BUILD=Debug ; export BUILD if [ ! -e $ROOT/$BUILD ]; then diff --git a/src/kernel/version.c b/src/kernel/version.c index 6de6ddb40..45b9815bc 100644 --- a/src/kernel/version.c +++ b/src/kernel/version.c @@ -5,7 +5,7 @@ #ifndef ERESSEA_VERSION // the version number, if it was not passed to make with -D -#define ERESSEA_VERSION "3.10.0-devel" +#define ERESSEA_VERSION "3.10.0" #endif const char *eressea_version(void) {