问题
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?
回答1:
You can use .SECONDARY with no prerequisites, this will set all intermediate targets behave as SECONDARY.
来源:https://stackoverflow.com/questions/17625394/secondary-for-a-pattern-rule-with-gnu-make