在Android.mk使用make的“通配符”功能 [英] Using Make's 'wildcard' function in Android.mk
问题描述
我使用制作的通配符有问题code>在我的Android.mk构建文件的功能
。
I'm having a problem using Make's wildcard
function in my Android.mk build file.
我的其他的makefile使用线路像这样的规定在此文件夹中的所有.c文件:
My other makefiles use a line like this one to specify "All .c files in this folder":
CFILES:= $(通配符* .C)
在我的Android.mk文件,我想这样的:
In my Android.mk file I tried this:
LOCAL_SRC_FILES:= $(通配符* .C)
然而,这具有相同的影响为不包括在所有的任何文件。
However, this has the same affect as not including any files at all.
如果我包括文件手动构建工程,我期望。
If I include the files manually the build works as I'd expect.
我不知道是否可能在当前的工作目录是不是在当时我的项目路径这种说法是评估?如果是的话,我可以使用 $(叫我-DIR)
和通配符功能的组合,以获取列表我想要的吗?
I'm wondering if maybe the current working directory isn't my project path at the time this statement is evaluated? If so, can I use a combination of $(call my-dir)
and the wildcard function to get the list I want?
推荐答案
下面就是我使用过这样做的:
Here's what I've used in the past for doing this:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := mylibrary
LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.c)
include $(BUILD_STATIC_LIBRARY)
我的-DIR是由构建系统提供的一个宏,并返回包含Android.mk文件的目录的路径。
'my-dir' is a macro provided by the build system and returns the path of the directory containing the Android.mk file.
这篇关于在Android.mk使用make的“通配符”功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!