Android.mk文件中包含cpp文件的三种写法-(cocos2d-x 学习笔记)

一、

LOCAL_SRC_FILES := hellocpp/main.cpp \
                   ../../Classes/AppDelegate.cpp \
                   ../../Classes/HelloWorldScene.cpp

 

二、

FILE_LIST := hellocpp/main.cpp \
            $(wildcard $(LOCAL_PATH)/../../Classes/Shared/*.cpp) \
            $(wildcard $(LOCAL_PATH)/../../Classes/*.cpp) 

LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)

三、

define walk
    $(wildcard $(1)) $(foreach e, $(wildcard $(1)/*), $(call walk, $(e)))
endef
 
# 遍历Classes目录
ALLFILES = $(call walk, $(LOCAL_PATH)/../../Classes)
 
FILE_LIST := hellocpp/main.cpp
# 从所有文件中提取出所有.cpp文件
FILE_LIST += $(filter %.cpp, $(ALLFILES))
 
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)

 

posted @ 2014-04-09 14:09  c2c  阅读(421)  评论(0编辑  收藏  举报