#!/bin/sh # We build where we are SDK_BUILD_BASE=$(pwd -P)/output if [ -z "$SDK_SRC_BASE" ] then SDK_SRC_BASE=$(pwd -P) echo "Script variable SDK_SRC_BASE not set, assuming Argeo Build is building itself and using the local directory" fi SDK_MK=$SDK_SRC_BASE/sdk.mk if [ -f "$SDK_MK" ]; then echo "File $SDK_MK already exists. Remove it in order to configure a new build location:" echo "rm $SDK_MK" exit 1 else if [ -z "$JAVA_HOME" ] then JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java)))) echo "Environment variable JAVA_HOME not set, using $JAVA_HOME of $(which java)" fi # Create build directory, so that it can be used right away # and we check whether we have the rights mkdir -p $SDK_BUILD_BASE if [ -f "$SDK_MK" ]; then echo "Cannot create $SDK_BUILD_BASE, SDK configuration has failed." exit 2 fi # Generate sdk.mk cat > "$SDK_MK" <