bug-make
[Top][All Lists]
Advanced

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

Re: Order-only prerequisites


From: Frank Heckenbach
Subject: Re: Order-only prerequisites
Date: Wed, 07 Jun 2023 08:29:15 +0200

Henrik Carlqvist wrote:

> > Consider this makefile:
> > 
> > .PHONY: a b
> > a:; @echo a
> > b:; @echo b
> > b: | a
> 
> Your problem with this Makefile is that it never creates any files a or b.

That's why I made them phony. But that was just for demonstration.
I get the same effects with this makefile (when a and b don't exist
before):

a:; touch a
b:; touch b
b: | a

except for "'a' is up to date." instead of "Nothing to be done for 'a'.".

> > If so, is there another way to achieve what I want?
> 
> This totally depends upon what you want.

As I said, a way to specify in which order recipes are invoked
(here, a before b) if they are invoked, without influencing whether
they are invoked (only a, only b or a and b, as given on the command
line).



reply via email to

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