diff options
Diffstat (limited to 'jenkins-ci-build.sh')
-rwxr-xr-x | jenkins-ci-build.sh | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/jenkins-ci-build.sh b/jenkins-ci-build.sh index b18ff14b..fb922f25 100755 --- a/jenkins-ci-build.sh +++ b/jenkins-ci-build.sh @@ -1,6 +1,9 @@ #!/bin/bash +UNAME=`uname` MASTER_DIR=`dirname $0` +BUILD_DEFAULT="release" + cd ${MASTER_DIR} if [ "$OPTIONS" = "all_options" ]; @@ -9,7 +12,20 @@ then export USE_FREETYPE=1 fi -CORES=`awk '/^processor/ { N++} END { print N }' /proc/cpuinfo` +if [ "$UNAME" == "Darwin" ]; then + CORES=`sysctl -n hw.ncpu` +elif [ "$UNAME" == "Linux" ]; then + CORES=`awk '/^processor/ { N++} END { print N }' /proc/cpuinfo` +fi + +echo "platform : ${UNAME}" +echo "cores : ${CORES}" +if [ "${BUILD_TYPE}" == "" ]; then + BUILD_TYPE="${BUILD_DEFAULT}" + echo "build type : defaulting to ${BUILD_TYPE}" +else + echo "build type : ${BUILD_TYPE}" +fi make -j${CORES} distclean ${BUILD_TYPE} |