LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
#编译库的名称
LOCAL_MODULE := cocos2dcpp_shared
#编译库的文件名
LOCAL_MODULE_FILENAME := libcocos2dcpp
#包含的源文件
LOCAL_SRC_FILES := hellocpp/main.cpp \
../../Classes/AppDelegate.cpp \
../../Classes/Card.cpp \
../../Classes/GameOverLayer.cpp \
../../Classes/GameScene.cpp \
../../Classes/HighScore.cpp \
../../Classes/PopLayer.cpp \
../../Classes/SimpleRecognizer.cpp
#c/C++头文件包含路径
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes
#引用的静态链接库
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocosdenshion_static
LOCAL_WHOLE_STATIC_LIBRARIES += box2d_static
#编译成动态库
include $(BUILD_SHARED_LIBRARY)
#导入外部模块的.mk文件 ,和 include基本一样 import-module是指ndk_module_path设置的路径(包含应用的路径)(-x在build_native.py中设置(ndk_module_path = ‘NDK_MODULE_PATH=%s;%s/external;%s/cocos‘ % (cocos_root, cocos_root, cocos_root)))
$(call import-module,2d)
$(call import-module,audio/android)
$(call import-module,Box2D)
原文:http://xuguohongai.blog.51cto.com/4291348/1439620