unix - ${_+_} 在 BSD Makefile 中

标签 unix makefile bsd

我找到了 ${_+_}the FreeBSD Makefile .
${_+_}是什么意思在 BSD 生成文件中?

最佳答案

${_+_}指一个变量。它在 share/mk/sys.mk 中定义由 make 过程读取。所以用户 Zack 在他的评论中指出了正确的方向;此变量扩展为 +在某些情况下签名,取决于给出的标志:

.if !empty(.MAKEFLAGS:M-n) && ${.MAKEFLAGS:M-n} == "-n"
_+_     ?=
.else
_+_     ?=  +
.endif

对此的理由可以在 this commit 的评论中找到。和 this one ,其中引入了符号:
Make make recurse into sub-directories and sub-makes when given
two -n flags.  If only one -n flag is given the old behaviour
is retained (POLA).

关于unix - ${_+_} 在 BSD Makefile 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15747472/

相关文章:

c - 如何在 Windows 上编译 C 完美最小哈希库?

python - 在 python 中创建 makefile

ios - 为什么 recvfrom 方法的返回值是 4294967295 应该是 0 或 -1?

Bash printf 文字逐字字符串

linux - 在 OSX 上与 git 一起使用时,lesskey 配置不会被 less pager 使用

python - 使用 getopt() 获取从命令行传递的值

bash - 如何让猫开始新的一行

node.js - 在另一个 docker 容器内运行 docker 容器?

c++ - CMake add_library(<lib> OBJECT <src>) 有环境变量吗?

bash - Sed 用于消除某些模式周围的字符而不是其他模式