new build scripts, new versioning system

This commit is contained in:
Enno Rehling 2017-01-30 10:26:08 +01:00
parent da6a58aed5
commit 3d8d091207
4 changed files with 10 additions and 18 deletions

11
s/build
View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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) {