makefile - 在Makefile中,如何过滤掉目录下名称与通配符模式匹配的文件?

标签 makefile

给定先前定义的变量$(LOCAL_SRC_FILES),如何删除目录.AppleDouble下的每个文件。请注意,源代码树中的不同位置可以有多个 .AppleDouble 目录。

我尝试过:

LOCAL_SRC_FILES             := $(filter-out %.AppleDouble%, $(LOCAL_SRC_FILES))

这似乎不起作用。

谢谢。

最佳答案

像这样的东西可能会起作用:

LOCAL_SRC_FILES := $(foreach f,$(LOCAL_SRC_FILES),$(if $(findstring .AppleDouble,$f),,$f))

对于完全.AppleDouble的目录,我想你想要这个:

LOCAL_SRC_FILES := $(foreach f,$(LOCAL_SRC_FILES),$(if $(filter .AppleDouble,$(subst /, ,$f)),,$f))
不幸的是,

findstring 的匹配是不加区别的。它不关心单词边界或任何东西。

关于makefile - 在Makefile中,如何过滤掉目录下名称与通配符模式匹配的文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25655008/

相关文章:

c++ - 使用 automake 和 autoconf 包含动态库

linux - 适用于 Linux 的可移植 gcc

c++ - 生成文件 "nothing to be done"

c++ - 配置文件位置和二进制文件并构建系统,如 autoconf

makefile - $(VARIABLE) 和 % 模式规则之间的差异

makefile - $<(美元符号+左三角括号)在makefile中是什么意思?

compilation - 使/生成文件 : realize that there is a new (not changed) source file

makefile - Linux内核模块编程Makefile

makefile - 防止两个 make 实例执行同一个目标(并行 make)

linux - 制作[1] : arm-linux-gcc: Command not found in ubuntu