help-make
[Top][All Lists]
Advanced

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

Re: make claims foo cannot be built


From: Ian Lynagh
Subject: Re: make claims foo cannot be built
Date: Mon, 4 Jan 2010 17:19:17 +0000
User-agent: Mutt/1.5.18 (2008-05-17)

On Tue, Dec 29, 2009 at 04:56:39PM +0000, Ian Lynagh wrote:
> On Tue, Dec 29, 2009 at 11:08:16AM -0500, Paul Smith wrote:
> > On Tue, 2009-12-29 at 13:02 +0000, Ian Lynagh wrote:
> > > Can anyone explain why make claims that foo cannot be built with this
> > > Makefile please? Looking at the "Implicit Rule Search Algorithm" in
> > > the info page it looks to me like it should work fine.
> > > 
> > > ##############################
> > > default: foo
> > >         @echo default
> > > 
> > > f%: bar
> > >         @echo This is $@ with $*
> > 
> > If the file "bar" does not exist then you'll get the message you see
> > since there is no way for make to know how to build bar, and as a result
> > this implicit rule cannot match.
> 
> But make does know how to build bar:
> 
> $ make bar
> This is zzz with zz
> This is the general rule for bar
> 
> and the info page says:
> 
>   6. If no pattern rule has been found so far, try harder.  For each
>      pattern rule in the list:
> 
>        d. For each prerequisite that does not exist, follow this
>           algorithm recursively to see if the prerequisite can be made
>           by an implicit rule.
> 
> so shouldn't the recursive call of the algorithm find that bar is
> buildable, and thus foo is buildable?

FWIW, the Solaris make behaves as I expect (modulo .INIT and .DONE):

$ make
This is zzz with zz
This is the general rule for .INIT
This is the general rule for bar
This is foo with oo
default
This is the general rule for .DONE

(and adding
.INIT: ;
.DONE: ;
makes it behave exactly as expected)

So, is this a GNU make bug?

Or am I reading the algorithm description wrong?

Or is the algorithm description wrong?


Thanks
Ian





reply via email to

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