GNU make:不管失败是在其他所有对象之后运行目标吗? [英] GNU make: run a target after all others, regardless of failures?
问题描述
我有一个makefile,其中包含一些目标(例如,data1
至dataN
,alldata
取决于该目标),该目标生成一些数据,还有一个prettify
目标,该目标遍历输出并创建漂亮的报告. (注意:dataN
目标很多,makefile是机器生成的)
I have a makefile with some targets (say data1
through dataN
, on which alldata
depends) that generate some data, and a prettify
target which iterates over the output and creates a pretty report. (note: there are lots of dataN
targets and the makefile is machine-generated)
某些dataX
目标有时会失败,但是无论如何我都希望运行prettify
,因此prettify
并不依赖于alldata
.
Some of the dataX
targets occasionally fail, but I would like to run prettify
anyway, so prettify
doesn't depend on alldata
.
是否可以在make的单次调用中运行与make -k alldata || make prettify
等效的方法,从而使make尽最大努力构建所有数据,然后根据所生成的内容构建我的报告?
Is there a way to run the equivalent of make -k alldata || make prettify
in a single invocation of make such that make does a best-effort at building all the data, and then builds my report on whatever got made?
推荐答案
You can prepend the recipes for the dataX targets with a ‘-’,
or you can list the dataX targets as prerequisites of the special target .IGNORE
.
这篇关于GNU make:不管失败是在其他所有对象之后运行目标吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!