#!/bin/bash set -euo pipefail SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" APP_ROOT_DIR="$(dirname "$SCRIPT_DIR")" ROOT_DIR="$(dirname "$(dirname "$SCRIPT_DIR")")" . "$APP_ROOT_DIR/config.sh" function usage { cat >&2 <&2 exit 1 ;; esac done if [[ -z $PLATFORM ]]; then if [ "`uname`" = "Darwin" ]; then PLATFORM="m" elif [ "`uname`" = "Linux" ]; then PLATFORM="l" # If platform not given explicitly, skip 32-bit build if 64-bit system if [ "$(arch)" = "x86_64" ]; then export SKIP_32=1 fi elif [ "`uname -o 2> /dev/null`" = "Cygwin" ]; then PLATFORM="w" fi fi CHANNEL="source" PARAMS="" if [ $DEVTOOLS -eq 1 ]; then PARAMS+=" -t" fi if [ $quick_build -eq 1 ]; then PARAMS+=" -q" fi hash=`git -C "$ROOT_DIR" rev-parse --short HEAD` build_dir=`mktemp -d` function cleanup { rm -rf $build_dir } trap cleanup EXIT "$SCRIPT_DIR/prepare_build" -s "$ROOT_DIR/build" -o "$build_dir" -c $CHANNEL -m $hash "$APP_ROOT_DIR/build.sh" -d "$build_dir" -p $PLATFORM -c $CHANNEL -s $PARAMS echo Done