在android.mk中的目录和子目录中创建所有.cpp文件的FILE_LIST

时间:2012-12-06 13:15:31

标签: android c++ makefile java-native-interface cocos2d-x

我试图在.cpp个目录中包含所有Classes,EasyLib and EasyLibUse,并在子目录中包含所有.cpp个文件。但我无法这样做,请检查我的打击android.mk文件。

我这样做是为.cpp添加cocos2dx androidLOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := game_shared LOCAL_MODULE_FILENAME := libgame FILE_LIST := $(wildcard $(LOCAL_PATH)/../../Classes/*.cpp) FILE_LIST += $(wildcard $(LOCAL_PATH)/../../EasyLib/**/*.cpp) FILE_LIST += $(wildcard $(LOCAL_PATH)/../../EasyLibUse/**/*.cpp) LOCAL_SRC_FILES := hellocpp/main.cpp \ $(FILE_LIST:$(LOCAL_PATH)/%=%) LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../Lib LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../LibUse LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static cocos_extension_static include $(BUILD_SHARED_LIBRARY) $(call import-module,CocosDenshion/android) \ $(call import-module,cocos2dx) \ $(call import-module,extensions) 游戏的文件。

FILE_LIST += $(wildcard $(LOCAL_PATH)/../../EasyLib/**/*.cpp)

FILE_LIST += $(wildcard $(LOCAL_PATH)/../../EasyLibUse/**/*.cpp)

修改

{{1}}

这两个无法在子目录中构建.cpp文件。

的问候, Aqif

1 个答案:

答案 0 :(得分:1)

这是我的Android.mk,我认为这就是你要找的东西:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := game_shared

LOCAL_MODULE_FILENAME := libgame

cppfiles := $(shell find $(LOCAL_PATH) -name "*.cpp" -printf "%P \n")

LOCAL_SRC_FILES := $(cppfiles)


folders := $(shell find $(LOCAL_PATH) -type d -printf "%P \n")

LOCAL_C_INCLUDES := $(folders)     

LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static cocos_extension_static


include $(BUILD_SHARED_LIBRARY)

$(call import-module,CocosDenshion/android) \
$(call import-module,cocos2dx) \
$(call import-module,extensions)