makefile之二
来源:互联网 发布:网络直复营销理论案例 编辑:程序博客网 时间:2024/05/16 06:34
ALL_DEPENDENCY_DIRS := $(patsubst %/,%,$(sort $(ALL_DEPENDENCY_DIRS)))
-include $(wildcard $(ALL_DEPENDENCY_DIRS:%=%/*.d))
以上两句话的意思是:
对ALL_DEPENDENCY_DIRS中的所有成员排序,并截去结尾的斜杠;获取所有成员的路径下以.d结尾的文件,并-include之,忽视可能出现的错误。
$(patsubst
pattern,
replacement,
text)
‘%’ characters in patsubst
function invocations can be quoted with preceding backslashes (‘\’). Backslashes that would otherwise quote ‘%’ characters can be quoted with more backslashes. Backslashes that quote ‘%’ characters or other backslashes are removed from the pattern before it is compared file names or has a stem substituted into it. Backslashes that are not in danger of quoting ‘%’ characters go unmolested. For example, the pattern the\%weird\\%pattern\\ has ‘the%weird\’ preceding the operative ‘%’ character, and ‘pattern\\’ following it. The final two backslashes are left alone because they cannot affect any ‘%’ character.
Whitespace between words is folded into single space characters; leading and trailing whitespace is discarded.
If you want make
to simply ignore a makefile which does not exist or cannot be remade, with no error message, use the -include
directive instead of include
, like this:
-include filenames...
This acts like include
in every way except that there is no error (not even a warning) if any of the filenames (or any prerequisites of any of the filenames) do not exist or cannot be remade.
Wildcard expansion happens automatically in rules. But wildcard expansion does not normally take place when a variable is set, or inside the arguments of a function. If you want to do wildcard expansion in such places, you need to use the wildcard
function, like this:
$(wildcard pattern...)
This string, used anywhere in a makefile, is replaced by a space-separated list of names of existing files that match one of the given file name patterns. If no existing file name matches a pattern, then that pattern is omitted from the output of the wildcard
function. Note that this is different from how unmatched wildcards behave in rules, where they are used verbatim rather than ignored.
Substitution references are a simpler way to get the effect of the patsubst
function:
$(var:pattern=replacement)
is equivalent to
$(patsubst pattern,replacement,$(var))
The second shorthand simplifies one of the most common uses of patsubst
: replacing the suffix at the end of file names.
$(var:suffix=replacement)
is equivalent to
$(patsubst %suffix,%replacement,$(var))
- Linux之Makefile (二)
- makefile学习之二
- makefile杂谈,之二
- makefile总结之二
- makefile之二
- Makefile (二)之 规则、语法
- makefile 详细用法之二
- Makefile解读之二: sub-make
- Makefile基础 -- Unix学习总结之二
- linux KBuild MakeFile介绍 之二
- linux KBuild MakeFile介绍 之二
- Makefile学习之使用变量(二)
- Makefile学习之隐含规则(二)
- contiki2.6之Makefile详细解读二
- linux KBuild MakeFile介绍 之二
- makefile之二:符号、函数说明
- android开发笔记之Makefile(二)
- Makefile(二)
- 寒假巩固——帧布局+自定义颜色资源使用+Timer
- Android深入浅出之Audio 第一部分 AudioTrack分析
- android透明处理
- AndroidStudio打包so文件解决办法-2
- 如何使用qq截图
- makefile之二
- cocos2d-android基础——瞬时动作和延时动作
- 使用npm安装一些包失败了的看过来(npm国内镜像介绍)
- v$process 中的TRACEFILE 字段
- Unity 3d 保存玩家数据到本地之PlayerPrefs, C#封装
- SIP呼叫流程典型流程图解及其详细解释 .
- 测试softcascade的训练过程
- Android 匹配联系人号码长度修改方法
- 监控数据库运行情况(一)