2012-12-06 88 views
0

我想包括所有.cppClasses,EasyLib and EasyLibUse目錄和所有.cpp文件罪有子目錄。但我無法這樣做,請檢查我的打擊android.mk文件。在android.mk目錄和子目錄中創建所有.cpp文件的FILE_LIST

我這樣做,包括我的cocos2dx遊戲.cpp文件android

LOCAL_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) 

這兩構建失敗的.cpp子目錄中的文件。

問候, Aqif

+0

在其中的三個確實讓無法找到文件? – Beta

+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) 
+0

如果我在'$(LOCAL_PATH)'的目錄下有子目錄怎麼辦? –

+1

@IgorGanapolsky,「find -d」命令全部檢索它們。 –

相關問題