GNU make:不管失败是在其他所有对象之后运行目标吗? [英] GNU make: run a target after all others, regardless of failures?

查看:78
本文介绍了GNU make:不管失败是在其他所有对象之后运行目标吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个makefile,其中包含一些目标(例如,data1dataNalldata取决于该目标),该目标生成一些数据,还有一个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?

推荐答案

您可以
或者您可以
列出dataX目标作为特殊目标 .

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆