[Top][All Lists]
[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: |
Paul Smith |
Subject: |
Re: do I have to use recursive make to make one target fall on another? |
Date: |
Fri, 02 Mar 2012 08:36:39 -0500 |
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 <address@hidden> 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