Re: say which of .PRECIOUS: %.o *.o file.o will actually work

2024-10-11 Thread Paul Smith
On Fri, 2024-10-11 at 09:45 +, Edward Welbourne wrote: > Paul Smith (10 October 2024 17:56) wrote: > > .PRECIOUS is dangerous and should almost never be needed or used.  > > This danger can be avoided by having a recipe (or the command it > runs) generate the new file under an alternative name

Re: say which of .PRECIOUS: %.o *.o file.o will actually work

2024-10-11 Thread Edward Welbourne
Paul Smith (10 October 2024 17:56) wrote: > .PRECIOUS is dangerous and should almost never be needed or used. Its > goal is to prevent make from deleting files automatically when a > recipe fails (for any reason). There are very few, very rare > situations where this is what you want, because it

Re: say which of .PRECIOUS: %.o *.o file.o will actually work

2024-10-10 Thread Paul Smith
On Thu, 2024-10-10 at 11:45 -0400, Dmitry Goncharov wrote: > There is little benefit to mark files built by static pattern rules > precious,  because static pattern rules do not build intermediate > files. It's a mistake to consider .PRECIOUS in the context of intermediate files. This is a common

Re: say which of .PRECIOUS: %.o *.o file.o will actually work

2024-10-10 Thread Dmitry Goncharov
On Thursday, October 10, 2024, Britton Kerin wrote: > On Wed, Oct 9, 2024 at 4:01 PM Dmitry Goncharov wrote: >> >> On Tue, Oct 8, 2024 at 11:16 PM Dan Jacobson wrote: >> > >> > Manual says: >> > >> >You can list the target pattern of an implicit rule (such as '%.o') >> >as a prerequisite

Re: say which of .PRECIOUS: %.o *.o file.o will actually work

2024-10-10 Thread Britton Kerin
On Tue, Oct 8, 2024 at 7:16 PM Dan Jacobson wrote: > > Manual says: > >You can list the target pattern of an implicit rule (such as '%.o') >as a prerequisite of the special target '.PRECIOUS' to preserve >intermediate files made by implicit rules whose target patterns match >that f

Re: say which of .PRECIOUS: %.o *.o file.o will actually work

2024-10-10 Thread Dan Jacobson
Thanks. OK, the manual should say that >> .PRECIOUS: %.o will usually work, >> .PRECIOUS: *.o will never work, (unless the file really has an asterisk in its name) and >> .PRECIOUS: file.o will always work.

Re: say which of .PRECIOUS: %.o *.o file.o will actually work

2024-10-09 Thread Dmitry Goncharov
On Tue, Oct 8, 2024 at 11:16 PM Dan Jacobson wrote: > > Manual says: > >You can list the target pattern of an implicit rule (such as '%.o') >as a prerequisite of the special target '.PRECIOUS' to preserve >intermediate files made by implicit rules whose target patterns match >that

say which of .PRECIOUS: %.o *.o file.o will actually work

2024-10-08 Thread Dan Jacobson
Manual says: You can list the target pattern of an implicit rule (such as '%.o') as a prerequisite of the special target '.PRECIOUS' to preserve intermediate files made by implicit rules whose target patterns match that file's name; see *note Interrupts::. Well say which of .PRECIOUS: