14
votes

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
Waow .PRECIOUS works with patterns, but oddly enough, not .SECONDARY. i think i get a starting point answer to stackoverflow.com/questions/27090032/…philippe lhardy

1 Answers

13
votes

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