2010-12-18 18:23:31 +08:00
|
|
|
# set params
|
2012-03-20 16:10:12 +08:00
|
|
|
NDK_ROOT_LOCAL=/cygdrive/d/programe/android/ndk/android-ndk-r7b
|
2011-12-20 16:50:39 +08:00
|
|
|
COCOS2DX_ROOT_LOCAL=/cygdrive/e/cocos2d-x
|
|
|
|
|
|
|
|
# try to get global variable
|
|
|
|
if [ $NDK_ROOT"aaa" != "aaa" ]; then
|
|
|
|
echo "use global definition of NDK_ROOT: $NDK_ROOT"
|
|
|
|
NDK_ROOT_LOCAL=$NDK_ROOT
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $COCOS2DX_ROOT"aaa" != "aaa" ]; then
|
|
|
|
echo "use global definition of COCOS2DX_ROOT: $COCOS2DX_ROOT"
|
|
|
|
COCOS2DX_ROOT_LOCAL=$COCOS2DX_ROOT
|
|
|
|
fi
|
|
|
|
|
|
|
|
HELLOWORLD_ROOT=$COCOS2DX_ROOT_LOCAL/HelloWorld/android
|
2010-12-20 14:17:51 +08:00
|
|
|
|
2011-01-21 15:45:55 +08:00
|
|
|
# make sure assets is exist
|
2010-12-20 14:44:38 +08:00
|
|
|
if [ -d $HELLOWORLD_ROOT/assets ]; then
|
2011-01-21 15:45:55 +08:00
|
|
|
rm -rf $HELLOWORLD_ROOT/assets
|
2010-12-20 14:17:51 +08:00
|
|
|
fi
|
|
|
|
|
2011-01-21 15:45:55 +08:00
|
|
|
mkdir $HELLOWORLD_ROOT/assets
|
|
|
|
|
|
|
|
# copy resources
|
2012-02-14 18:04:56 +08:00
|
|
|
for file in $COCOS2DX_ROOT_LOCAL/HelloWorld/Resources/*
|
2011-01-21 15:45:55 +08:00
|
|
|
do
|
|
|
|
if [ -d $file ]; then
|
|
|
|
cp -rf $file $HELLOWORLD_ROOT/assets
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f $file ]; then
|
|
|
|
cp $file $HELLOWORLD_ROOT/assets
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2010-12-18 18:23:31 +08:00
|
|
|
# build
|
2011-12-20 16:50:39 +08:00
|
|
|
pushd $NDK_ROOT_LOCAL
|
2011-03-01 19:53:39 +08:00
|
|
|
./ndk-build -C $HELLOWORLD_ROOT $*
|
2010-12-18 18:23:31 +08:00
|
|
|
popd
|
|
|
|
|