Android.mk for Building Against NDK

It seems that whenever I add a new .cpp file in the class folder. I have to modify the Android.mk file to let the NDK script know that there’s a new .cpp file and they need to compile it as well.

After some time my Android.mk file would look like:

LOCAL_SRC_FILES := helloworld/main.cpp …/…/Classes/AppDelegate.cpp …/…/Classes/CCBReader.cpp …/…/Classes/CCBClassGenerator.cpp …/…/Classes/HelloCocosBuilder.cpp

I am wondering is there a way for me to appoint a specific folder so that no matter how many .cpp files I have added into that folder, the NDK script would know and compile them all. So that I don’t have to add each .cpp file one by one.

Thanks in advance.

Maybe u can try this -> http://www.cocos2d-x.org/boards/7/topics/7317?r=9101#message-9101

hi, i m getting this error when i run my app on eclipse for android “make: * No rule to make target `jni_‘/testcpp/main.cpp’, needed by `obj/local/armeabi/objs-debug/testcpp_shared/testcpp/main.o’.”
what’s wrong with my mk file?
here is my mk file :

TOP_LOCAL_PATH :=$(call my-dir)
include $(call all-subdir-makefiles)
LOCAL_PATH := $(TOP_LOCAL_PATH)

include $(CLEAR_VARS)
LOCAL_LDLIBS:=-llog
LOCAL_MODULE := testcpp_shared
LOCAL_MODULE_FILENAME := libtestcpp
LOCAL_SRC_FILES := testcpp/main.cpp carTest.cpp test.cpp ScreenLayer.cpp track1.cpp GameOverScene.cpp MyContactListener.cpp story.cpp AdvanceSprite.cpp Hello.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH)/…/…/Classes

LOCAL_STATIC_LIBRARIES := curl_static_prebuilt

LOCAL_WHOLE_STATIC_LIBRARIES := cocos_testcpp_common
LOCAL_WHOLE_STATIC_LIBRARIES = cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES
= cocosdenshion_static
LOCAL_WHOLE_STATIC_LIBRARIES = box2d_static
LOCAL_WHOLE_STATIC_LIBRARIES
= chipmunk_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static

include $(BUILD_SHARED_LIBRARY)

$(call import-module,samples/TestCpp)
$(call import-module,cocos2dx)
$(call import-module,cocos2dx/platform/third_party/android/prebuilt/libcurl)
$(call import-module,CocosDenshion/android)
$(call import-module,extensions)
$(call import-module,external/Box2D)
$(call import-module,external/chipmunk)