help-make
[Top][All Lists]
Advanced

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

RE: do I have to use recursive make to make one target fall on another?


From: Mark Galeck (CW)
Subject: RE: do I have to use recursive make to make one target fall on another?
Date: Fri, 2 Mar 2012 03:53:14 -0800

I see.  Well, I don't think I can use a pattern rule, because I can't change 
anything for goal2.  

I just don't understand why a pattern rule would take precedence over an 
explicit rule (with or without a recipe).  

It's a matter of being most specific.  The explicit rule can be thought of as a 
pattern rule with 0 length matching %, so it is more specific than any pattern 
rule, therefore, should have priority if it matches a target.  This is clearly 
to me the principle of least surprise.  At the very least, I should be able to 
manipulate what matches by the ordering of rules.  

But no, it looks like I  have to purposely make up bogus rules to make them 
take precedence over the implicit ones.    

-----Original Message-----
From: Eli Zaretskii [mailto:address@hidden 
Sent: Friday, March 02, 2012 3:51 AM
To: Mark Galeck (CW)
Cc: address@hidden
Subject: Re: do I have to use recursive make to make one target fall on another?

> From: "Mark Galeck (CW)" <address@hidden>
> CC: "address@hidden" <address@hidden>
> Date: Fri, 2 Mar 2012 01:46:28 -0800
> 
> Yes, thank you, so what you are saying, translated to my situation, is
> 
> Goal1 goal2: phony
>       <recipe for goal2>

No, that's not what I was saying.  The above doesn't use pattern
rules.  You must use pattern rules for what I said to work for you.

> This is still inefficient, because, if the user wants to make both
> goals: goal1 and goal2, the recipe will be attempted twice.

Because you didn't use pattern rules.  Only for pattern rules, GNU
Make knows to invoke the recipe only once.

>  I only want one attempt.  I want make to know goal1 will be made as a side 
> effect of goal2.

Then make that a pattern rule.



reply via email to

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