From c00d59a568d856f09e77703269b57fa21df2e597 Mon Sep 17 00:00:00 2001 From: minggo Date: Wed, 23 Nov 2011 16:43:52 +0800 Subject: [PATCH] fixed #838: android template support x86 --- create-android-project.bat | 6 +++--- template/android/AndroidTemplate1.mk | 16 ++++------------ template/android/AndroidTemplate2.mk | 2 +- template/android/Application.mk | 2 +- template/android/copy_files.sh | 2 +- 5 files changed, 10 insertions(+), 18 deletions(-) diff --git a/create-android-project.bat b/create-android-project.bat index 80509430bb..cc12cc33dc 100644 --- a/create-android-project.bat +++ b/create-android-project.bat @@ -11,15 +11,15 @@ if not exist "%cd%\create-android-project.bat" echo Error!!! You should run it u if not exist "%~dpn0.sh" echo Script "%~dpn0.sh" not found & pause & exit 3 :: modify it to work under your environment -set _CYGBIN=f:\cygwin\bin +set _CYGBIN=d:\programe\cygwin\bin if not exist "%_CYGBIN%" echo Couldn't find Cygwin at "%_CYGBIN%" & pause & exit 4 :: modify it to work under your environment -set _ANDROIDTOOLS=d:\android-sdk\tools +set _ANDROIDTOOLS=d:\programe\android\android-sdk\tools if not exist "%_ANDROIDTOOLS%" echo Couldn't find android sdk tools at "%_ANDROIDTOOLS%" & pause & exit 5 :: modify it to work under your environment -set _NDKROOT=e:\android-ndk-r5 +set _NDKROOT=d:\programe\android\ndk\android-ndk-r6b if not exist "%_NDKROOT%" echo Couldn't find ndk at "%_NDKROOT%" & pause & exit 6 :: create android project diff --git a/template/android/AndroidTemplate1.mk b/template/android/AndroidTemplate1.mk index 470104fb1b..92966d655c 100644 --- a/template/android/AndroidTemplate1.mk +++ b/template/android/AndroidTemplate1.mk @@ -2,22 +2,14 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := game -LOCAL_SRC_FILES := main.cpp \ -../../../Classes/AppDelegate.cpp \ -../../../Classes/HelloWorldScene.cpp +LOCAL_SRC_FILES := main.cpp LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../cocos2dx \ $(LOCAL_PATH)/../../../../cocos2dx/platform \ $(LOCAL_PATH)/../../../../cocos2dx/include \ - $(LOCAL_PATH)/../../../../CocosDenshion/include \ - $(LOCAL_PATH)/../../../Classes + $(LOCAL_PATH)/../../../Classes -# it is used for ndk-r5 -# if you build with ndk-r4, comment it -# because the new Windows toolchain doesn't support Cygwin's drive -# mapping (i.e /cygdrive/c/ instead of C:/) -LOCAL_LDLIBS := -L$(call host-path, $(LOCAL_PATH)/../../libs/armeabi) \ - -lcocos2d -llog -lcocosdenshion \ - -L$(call host-path, $(LOCAL_PATH)/../../../../cocos2dx/platform/third_party/android/libraries) -lcurl +LOCAL_LDLIBS := -L$(call host-path, $(LOCAL_PATH)/../../libs/$(TARGET_ARCH_ABI)) \ + -lcocos2d -llog -lgame_logic include $(BUILD_SHARED_LIBRARY) diff --git a/template/android/AndroidTemplate2.mk b/template/android/AndroidTemplate2.mk index bdef5abe06..87e30c591e 100644 --- a/template/android/AndroidTemplate2.mk +++ b/template/android/AndroidTemplate2.mk @@ -5,6 +5,6 @@ subdirs := $(addprefix $(LOCAL_PATH)/../../../,$(addsuffix /Android.mk, \ cocos2dx \ CocosDenshion/android \ )) -subdirs += $(LOCAL_PATH)/helloworld/Android.mk +subdirs += $(LOCAL_PATH)/../../Classes/Android.mk $(LOCAL_PATH)/helloworld/Android.mk include $(subdirs) diff --git a/template/android/Application.mk b/template/android/Application.mk index d132003bbd..424e5c1f1e 100644 --- a/template/android/Application.mk +++ b/template/android/Application.mk @@ -1,3 +1,3 @@ # it is needed for ndk-r5 APP_STL := stlport_static -APP_MODULES := cocos2d cocosdenshion game \ No newline at end of file +APP_MODULES := cocos2d cocosdenshion game_logic game \ No newline at end of file diff --git a/template/android/copy_files.sh b/template/android/copy_files.sh index ab4f5e3a19..b49e8365f4 100644 --- a/template/android/copy_files.sh +++ b/template/android/copy_files.sh @@ -33,7 +33,7 @@ move_files_into_android(){ copy_cpp_h_from_helloworld(){ mkdir $APP_DIR/Classes - for file in `ls $HELLOWORLD_ROOT/Classes/* | grep -E '.*\.[cpp|h]' ` + for file in `ls $HELLOWORLD_ROOT/Classes/* | grep -E '.*\.[cpp|h|mk]' ` do if [ -f $file ];then cp $file $APP_DIR/Classes