从docs:“--keep正在进行”变成致命建设成一个成功的构建
通常
make
在这种情况下立即放弃,返回 非零状态。但是,如果-k
或--keep-going
标志指定 ,make
继续考虑 待定目标的其他先决条件,如果有必要重塑了它,它放弃和 返回非零状态之前。例如,在编制一个 对象文件的错误后,make -k
将继续编制虽然已经知道连接它们将是不可能的其他目标文件甚至 。 *备注 期权摘要:期权摘要。
换句话说,--keep-going
并不意味着make将完全忽视的错误,并与退出状态= 0返回。
相反,它意味着使将暂停的错误,并继续只依赖于其它建立(即建立不依赖于该失败的目标)。然而,它会最终“恢复”这些错误,并相应地失败。
但是,考虑生成文件:
# If 'd' was a "regular" file, we remove it first.
$(shell rm -rf D)
# Force make to do a "direcotry-serach(a "vpathization")", for the file 'all'.
$(shell rm -rf all)
# 'D' is a VPATH directory
$(shell mkdir D)
# Make will associate 'all' with 'D/all'
$(shell touch D/all)
VPATH = D
root: all;
# Building 'all' results in a fatal error.
all ::
false
.SILENT: D/all
执行,我们得到:
# The "normal" case (without '--keep-going').
$ make -j
makefile:15: recipe for target 'D/all' failed
make: *** [D/all] Error 1
$ echo 'exit-status is: '"'$?'"
exit-status is: '2'
##########################
# Run with '--keep-going'
$ make -j -k
makefile:15: recipe for target 'D/all' failed
make: *** [D/all] Error 1
$ echo 'exit-status is: '"'$?'"
exit-status is: '0'
构建失败为前提未能建立。然而制作了第二轮,在那里我们有-k
(--keep-going
)返回成功。
非礼上的失败(或不完全)的身材,虽然这是一个成功的构建。
这是预期的行为,还是有一些错误与上面的例子?