xwords/xwords4/android/scripts/ndkbuild.sh
2010-01-04 05:50:12 +00:00

41 lines
855 B
Bash
Executable file

#!/bin/sh
APP=xwords4
OLDDIR=$(pwd)
if [ -z "$NDK_ROOT" ]; then
echo -n "NDK_ROOT not set... "
NDK_ROOT="$HOME/android-ndk-1.5_r1"
if [ -d $NDK_ROOT ]; then
echo "using $NDK_ROOT"
else
echo "NDK not found; install and set NDK_ROOT to point to it"
exit 1
fi
fi
cd $(dirname $0)
cd ../
if [ -h $NDK_ROOT/sources/$APP -a $(readlink $NDK_ROOT/sources/$APP) != $(pwd) ]; then
rm $NDK_ROOT/sources/$APP
fi
if [ ! -h $NDK_ROOT/sources/$APP ]; then
echo "adding symlink to sources"
ln -sf $(pwd) $NDK_ROOT/sources/$APP
fi
if [ -h $NDK_ROOT/apps/$APP -a $(readlink $NDK_ROOT/apps/$APP) != $(pwd) ]; then
rm $NDK_ROOT/apps/$APP
fi
if [ ! -h $NDK_ROOT/apps/$APP ]; then
echo "adding symlink to apps"
ln -sf $(pwd) $NDK_ROOT/apps/$APP
fi
cd $NDK_ROOT
make APP=$APP
cd $OLDDIR
echo "$0 done"