码迷,mamicode.com
首页 > 移动开发 > 详细

Cocos2d-x 中Android.mk自动生成.cpp与.c类路径

时间:2014-09-25 17:49:19      阅读:167      评论:0      收藏:0      [点我收藏+]

标签:cocos2d-x   mk   android   cpp   c   

   今天,同事发现了一个可以自动生成Android.mk的脚本。这里贴上留着以后使用。之前在网上找的脚本只能识别以.cpp结尾的类,经过修改后也可以识别.c结尾的类。



LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := cocos2dcpp_shared

LOCAL_MODULE_FILENAME := libcocos2dcpp

#traverse all the directory and subdirectory
define walk
  $(wildcard $(1)) $(foreach e, $(wildcard $(1)/*), $(call walk, $(e)))
endef
 
#traverse Classes Directory
ALLFILES = $(call walk, $(LOCAL_PATH)/../../Classes)
 
FILE_LIST := hellocpp/main.cpp
FILE_LIST += $(filter %.cpp, $(ALLFILES))
FILE_LIST += $(filter %.c, $(ALLFILES))
 
FILE_INCLUDES := $(shell find $(LOCAL_PATH)/../../Classes -type d)
 
#source file will be compiled
LOCAL_SRC_FILES := $(FILE_LIST:$(LOCAL_PATH)/%=%)
 
                   
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../external/Box2D/ 	$(FILE_INCLUDES) 
LOCAL_WHOLE_STATIC_LIBRARIES := cocos2dx_static cocosdenshion_static cocos_extension_static box2d_static


include $(BUILD_SHARED_LIBRARY)

$(call import-module,.)
$(call import-module,audio/android)

# $(call import-module,Box2D)
# $(call import-module,editor-support/cocosbuilder)
# $(call import-module,editor-support/spine)
# $(call import-module,editor-support/cocostudio)
# $(call import-module,network)
# $(call import-module,extensions)








原文地址:http://blog.csdn.net/qqmcy/article/details/39551979

Cocos2d-x 中Android.mk自动生成.cpp与.c类路径

标签:cocos2d-x   mk   android   cpp   c   

原文地址:http://blog.csdn.net/qqmcy/article/details/39551979

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!