bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Paul Smith
Subject: Re: say which of .PRECIOUS: %.o *.o file.o will actually work
Date: Fri, 11 Oct 2024 15:49:27 -0400
User-agent: Evolution 3.52.4 (by Flathub.org)

On Fri, 2024-10-11 at 09:45 +0000, 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 and finish up,
> on success, by doing a rename to replace the old version.

Yes for sure.  But, I wonder why go to the trouble when it's even
simpler to just not use .PRECIOUS in the first place :).

Of course there are still situations where make can't clean up: if it's
killed via -9 (SIGKILL) instead of SIGINT for example, so "defensive
makefile recipes" can still be a good idea if you are trying to create
a truly bullet-proof build system (maybe for a hands-off CI
implementation).

As you point out, though, it requires cooperation on the part of the
tools make is invoking.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]