.SECONDARY用于GNU Make的模式规则 [英] .SECONDARY for a pattern rule with GNU Make

查看:90
本文介绍了.SECONDARY用于GNU Make的模式规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用GNU Make的特殊目标.SECONDARY指定在作为中间文件创建时,不应删除特定模式规则的结果. .PRECIOUS使用模式,但奇怪的是,.SECONDARY无法使用.我不想使用.PRECIOUS,因为我确实希望在Make被信号中断的情况下删除该文件,或者当该命令与.DELETE_ON_ERROR结合使用时,该命令返回非零退出状态.有什么建议吗?

I want to use the special target .SECONDARY of GNU Make to specify that the results of a particular pattern rule should not be deleted when created as a intermediate files. .PRECIOUS works with patterns, but oddly enough, not .SECONDARY. I don't want to use .PRECIOUS, because I do want the file to be deleted in the case that Make is interrupted by a signal, or the command returns a non-zero exit status when used in combination with .DELETE_ON_ERROR. Any suggestions?

推荐答案

您可以在没有先决条件的情况下使用.SECONDARY,这会将所有中间目标设置为SECONDARY.

You can use .SECONDARY with no prerequisites, this will set all intermediate targets behave as SECONDARY.

这篇关于.SECONDARY用于GNU Make的模式规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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