标签:des android style blog http color os 使用 ar
在编写android.mk
的过程中,免不了要修改LOCAL_C_INCLUDES
来设置头文件的include目录, 一般写成这样
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes $(LOCAL_PATH)/../../Classes/game $(LOCAL_PATH)/../../Classes/logic $(LOCAL_PATH)/../../Classes/view
有一个目录就要写一行, 实在繁琐, 有没有写法可以把源码目录下的所有子目录都引入呢, 看下面
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes
LOCAL_C_INCLUDES += $(shell ls -FR $(LOCAL_C_INCLUDES) | grep $(LOCAL_PATH)/$ )
LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES:$(LOCAL_PATH)/%:=$(LOCAL_PATH)/%)
即可把$(LOCAL_PATH)/../../Classes
目录和子目录全部包含进来
还有一种写法, 就是使用sed
命令, 效果是一样的, 我对sed
不是很熟悉, 简单写了一下
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes
LOCAL_C_INCLUDES += $(shell ls -FR $(LOCAL_C_INCLUDES) | grep $(LOCAL_PATH)/$ | sed "s/:/ /g" )
这两行和上面三行的结果是一样的
[转]编写 android.mk 中 LOCAL_C_INCLUDES 的技巧
标签:des android style blog http color os 使用 ar
原文地址:http://www.cnblogs.com/slysky/p/4023840.html