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:[email protected]] Sent: Friday, March 02, 2012 3:51 AM To: Mark Galeck (CW) Cc: [email protected] Subject: Re: do I have to use recursive make to make one target fall on another? > From: "Mark Galeck (CW)" <[email protected]> > CC: "[email protected]" <[email protected]> > 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. _______________________________________________ Help-make mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-make
