summaryrefslogtreecommitdiff
path: root/scripts/release-common.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/release-common.sh')
-rwxr-xr-xscripts/release-common.sh44
1 files changed, 30 insertions, 14 deletions
diff --git a/scripts/release-common.sh b/scripts/release-common.sh
index 62f8ed8..ae856df 100755
--- a/scripts/release-common.sh
+++ b/scripts/release-common.sh
@@ -1,25 +1,29 @@
#!/bin/bash
#
-# This script creates a binary release of OpenSCAD.
-# This should work under Mac OS X, Windows (msys), and Linux cross-compiling
-# for windows using mingw-cross-env (use like: OSTYPE=mingw-cross-env release-common.sh).
-# Linux support pending.
-# The script will create a file called openscad-<versionstring>.zip
-# in the current directory (or in the $DEPLOYDIR of a mingw cross build)
+# This script creates a binary release of OpenSCAD. This should work
+# under Mac OS X, Linux 32, Linux 64, and Linux->Win32 MXE cross-build.
+# Windows under msys has not been tested recently.
#
-# Usage: release-common.sh [-v <versionstring>] [-c]
-# -v Version string (e.g. -v 2010.01)
-# -c Build with commit info
+# The script will create a file called openscad-<versionstring>.<extension> in
+# the current directory (or under ./mingw32)
+#
+# Usage: release-common.sh [-v <versionstring>] [-c] [-x32]
+# -v Version string (e.g. -v 2010.01)
+# -c Build with commit info
+# -mingw32 Cross-compile for win32 using MXE
#
# If no version string is given, todays date will be used (YYYY-MM-DD)
# If no make target is given, release will be used on Windows, none one Mac OS X
#
# The commit info will extracted from git and be passed to qmake as OPENSCAD_COMMIT
# to identify a build in the about box.
+#
+# The mingw32 cross compile depends on the MXE cross-build tools. Please
+# see the README.md file on how to install these dependencies.
printUsage()
{
- echo "Usage: $0 -v <versionstring> -c
+ echo "Usage: $0 -v <versionstring> -c -mingw32
echo
echo " Example: $0 -v 2010.01
}
@@ -42,11 +46,18 @@ elif [[ $OSTYPE == "linux-gnu" ]]; then
ARCH=32
fi
echo "Detected ARCH: $ARCH"
-elif [[ $OSTYPE == "mingw-cross-env" ]]; then
+fi
+
+if [ "`echo $* | grep mingw32`" ]; then
OS=LINXWIN
fi
-echo "Detected OS: $OS"
+if [ $OS ]; then
+ echo "Detected OS: $OS"
+else
+ echo "Error: Couldn't detect OSTYPE"
+ exit
+fi
while getopts 'v:c' c
do
@@ -147,14 +158,19 @@ case $OS in
;;
esac
+if [ ! $NUMCPU ]; then
+ echo "note: you can 'export NUMCPU=x' for multi-core compiles (x=number)";
+ NUMCPU=2
+fi
+
case $OS in
LINXWIN)
- # make -jx sometimes has problems with parser_yacc
+ # dont use paralell builds, it can error-out on parser_yacc.
cd $DEPLOYDIR && make $TARGET
cd $OPENSCADDIR
;;
*)
- make -j2 $TARGET
+ make -j$NUMCPU $TARGET
;;
esac
contact: Jan Huwald // Impressum