2013-11-05 04:23:47 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -u -e
|
|
|
|
|
|
|
|
APPMK=./jni/Application.mk
|
2013-11-09 14:20:21 +01:00
|
|
|
TMP_MK=/tmp/tmp_$$_Application.mk
|
2013-11-05 04:23:47 +01:00
|
|
|
XWORDS_DEBUG_ARMONLY=${XWORDS_DEBUG_ARMONLY:-""}
|
2013-11-05 15:36:16 +01:00
|
|
|
XWORDS_DEBUG_X86ONLY=${XWORDS_DEBUG_X86ONLYx:-""}
|
2013-11-05 04:23:47 +01:00
|
|
|
|
2013-11-09 14:20:21 +01:00
|
|
|
echo "# Generated by $0; do not edit!!!" > $TMP_MK
|
2013-11-05 04:23:47 +01:00
|
|
|
|
|
|
|
if [ "$1" = "release" ]; then
|
2013-11-09 14:20:21 +01:00
|
|
|
echo "APP_ABI := armeabi x86" >> $TMP_MK
|
2013-11-05 04:23:47 +01:00
|
|
|
elif [ -n "$XWORDS_DEBUG_ARMONLY" ]; then
|
2013-11-09 14:20:21 +01:00
|
|
|
echo "APP_ABI := armeabi" >> $TMP_MK
|
2013-11-05 15:36:16 +01:00
|
|
|
elif [ -n "$XWORDS_DEBUG_X86ONLY" ]; then
|
2013-11-09 14:20:21 +01:00
|
|
|
echo "APP_ABI := x86" >> $TMP_MK
|
2013-11-05 04:23:47 +01:00
|
|
|
else
|
2013-11-09 14:20:21 +01:00
|
|
|
echo "APP_ABI := armeabi x86" >> $TMP_MK
|
2013-11-05 04:23:47 +01:00
|
|
|
fi
|
2014-03-04 16:07:44 +01:00
|
|
|
# echo "APP_OPTIM := debug" >> $TMP_MK
|
2013-11-09 14:20:21 +01:00
|
|
|
|
|
|
|
# Now replace the existing file, but only if it's different. Touching
|
|
|
|
# it causes the library to be completely rebuilt, so avoid that if
|
|
|
|
# possible!
|
|
|
|
|
|
|
|
if [ ! -f $APPMK ]; then
|
|
|
|
cp $TMP_MK $APPMK
|
|
|
|
elif ! diff $APPMK $TMP_MK; then
|
|
|
|
cp $TMP_MK $APPMK
|
|
|
|
fi
|
|
|
|
rm -f $TMP_MK
|