On Fri, 2012-03-02 at 00:31 -0800, Mark Galeck (CW) wrote:
> goal1:  goal2
> goal2:
>                 <recipe>
> 
> This works in a simple case, but not always.  Because, if there are
> also various implicit rules that cover things like "goal1", then they
> take precedence over the empty rule for goal1 !!
> 
> The only way I see is to do
> 
> goal1:
>                 $(MAKE) goal2

You don't need that.  As long as there's ANY explicit command for goal1,
then it won't be subject to an implicit rule.  So just add one:

goal1: goal2
        @ :

(the ":" command is a shell built-in no-op command).

Now goal1 will never be matched against any implicit rules.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <psm...@gnu.org>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


_______________________________________________
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to