From: daid Date: Wed, 29 Oct 2014 15:56:38 +0000 (+0100) Subject: Auto-detect which make tool to use. X-Git-Tag: 14.10-RC5~7 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=9619cc4d88985e67fcf2679430dac27c6ea3438e;p=cura.git Auto-detect which make tool to use. --- diff --git a/package.sh b/package.sh index ef4b9bb9..bfb993f5 100755 --- a/package.sh +++ b/package.sh @@ -81,6 +81,12 @@ if [ "$BUILD_TARGET" = "none" ]; then exit 0 fi +if [ -z `which make` ]; then + MAKE=make +else + MAKE=mingw32-make +fi + # Change working directory to the directory the script is in # http://stackoverflow.com/a/246128 SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -91,7 +97,7 @@ checkTool curl "curl: http://curl.haxx.se/" if [ $BUILD_TARGET = "win32" ]; then #Check if we have 7zip, needed to extract and packup a bunch of packages for windows. checkTool 7z "7zip: http://www.7-zip.org/" - checkTool mingw32-make "mingw: http://www.mingw.org/" + checkTool $MAKE "mingw: http://www.mingw.org/" fi #For building under MacOS we need gnutar instead of tar if [ -z `which gnutar` ]; then @@ -123,7 +129,7 @@ if [ "$BUILD_TARGET" = "darwin" ]; then rm -rf CuraEngine git clone ${CURA_ENGINE_REPO} if [ $? != 0 ]; then echo "Failed to clone CuraEngine"; exit 1; fi - make -C CuraEngine VERSION=${BUILD_NAME} + $MAKE -C CuraEngine VERSION=${BUILD_NAME} if [ $? != 0 ]; then echo "Failed to build CuraEngine"; exit 1; fi cp CuraEngine/build/CuraEngine scripts/darwin/dist/Cura.app/Contents/Resources/CuraEngine @@ -220,7 +226,7 @@ if [ "$BUILD_TARGET" = "debian_i386" ]; then rm -rf CuraEngine git clone ${CURA_ENGINE_REPO} if [ $? != 0 ]; then echo "Failed to clone CuraEngine"; exit 1; fi - make -C CuraEngine VERSION=${BUILD_NAME} + $MAKE -C CuraEngine VERSION=${BUILD_NAME} if [ $? != 0 ]; then echo "Failed to build CuraEngine"; exit 1; fi rm -rf scripts/linux/${BUILD_TARGET}/usr/share/cura mkdir -p scripts/linux/${BUILD_TARGET}/usr/share/cura @@ -256,7 +262,7 @@ if [ "$BUILD_TARGET" = "debian_amd64" ]; then rm -rf CuraEngine git clone ${CURA_ENGINE_REPO} if [ $? != 0 ]; then echo "Failed to clone CuraEngine"; exit 1; fi - make -C CuraEngine + $MAKE -C CuraEngine if [ $? != 0 ]; then echo "Failed to build CuraEngine"; exit 1; fi rm -rf scripts/linux/${BUILD_TARGET}/usr/share/cura mkdir -p scripts/linux/${BUILD_TARGET}/usr/share/cura @@ -292,7 +298,7 @@ if [ "$BUILD_TARGET" = "debian_armhf" ]; then rm -rf CuraEngine git clone ${CURA_ENGINE_REPO} if [ $? != 0 ]; then echo "Failed to clone CuraEngine"; exit 1; fi - make -C CuraEngine VERSION=${BUILD_NAME} + $MAKE -C CuraEngine VERSION=${BUILD_NAME} if [ $? != 0 ]; then echo "Failed to build CuraEngine"; exit 1; fi rm -rf scripts/linux/${BUILD_TARGET}/usr/share/cura mkdir -p scripts/linux/${BUILD_TARGET}/usr/share/cura @@ -394,7 +400,7 @@ if [ $BUILD_TARGET = "win32" ]; then rm -rf ${TARGET_DIR}/python/Lib/OpenGL/DLLS/gle* #Build the C++ engine - mingw32-make -C CuraEngine VERSION=${BUILD_NAME} + $MAKE -C CuraEngine VERSION=${BUILD_NAME} if [ $? != 0 ]; then echo "Failed to build CuraEngine"; exit 1; fi fi