On Tue, Oct 8, 2024 at 11:16 PM Dan Jacobson <jida...@jidanni.org> 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 file's name; see *note Interrupts::. > > Well say which of > .PRECIOUS: %.o > .PRECIOUS: *.o > .PRECIOUS: file.o > will actually work. > > The words above make the reader think they should use the first form. > > But in my experiments, only this last one works.
.PRECIOUS: %.o has the desired effect when a related implicit rule is used. For example, the following marks hello.x and hello.q as precious. .PRECIOUS: %.x %.q all: hello.x %.x: %.q; $(info $@ from $<) %.q:; regards, Dmitry