help-make
[Top][All Lists]
Advanced

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

Re: There is a bug in the make manual!!


From: Luke Shumaker
Subject: Re: There is a bug in the make manual!!
Date: Mon, 06 Sep 2010 23:41:01 -0400

It will only match the pattern rule if all the prerequisites exist.
Therefore, you must touch all the files first, which makes testing
expansion difficult because you must know what they expand to first.

To force /tmp/foo.o to use the pattern rule provided, put them on the
same line:
tmp/foo.o: %.o: $$(addsuffix /%.c,foo bar) foo.h

Sorry, I should have thought of that before sending my previous message.

~ LukeShu

On Tue, 2010-09-07 at 07:24 +0430, ali hagigat wrote:
> Luke,
> I tested your code by Fedora 12, make version 3.81:
> 
> .SECONDEXPANSION:
> /tmp/foo.o:
> %.o: $$(addsuffix /%.c,foo bar) foo.h
>       @echo '$+'
> 
> and the result is:
> make: Nothing to be done for `/tmp/foo.o'.
> 
> it did not expand to what you said!
> 
> On Mon, Sep 6, 2010 at 8:53 PM, Luke Shumaker <address@hidden> wrote:
> > On Mon, 2010-09-06 at 08:21 +0430, ali hagigat wrote:
> >> Secondary Expansion of Implicit Rules
> >> .SECONDEXPANSION:
> >> /tmp/foo.o:
> >> %.o: $$(addsuffix /%.c,foo bar) foo.h
> >> The prerequisite list after the secondary expansion and directory
> >> prefix reconstruction
> >> will be ‘/tmp/foo/foo.c /tmp/var/bar/foo.c foo.h’.
> >> ----------------------------------------------------------------------------------
> >> I copied some lines of the 2010 make manual, page 19. It says
> >> prerequisite list will be:
> >> /tmp/var/bar/foo.c
> >> Where is 'var'?
> >> It seems incorrect. Also expansion seems wrong.
> >
> > Indeed, using `$+' to check what it expands to:
> >    .SECONDEXPANSION:
> >
> >    /tmp/foo.o:
> >
> >    %.o: $$(addsuffix /%.c,foo bar) foo.h
> >        @echo '$+'
> > It does expand to '/tmp/foo/foo.c /tmp/bar/foo.c foo.h'
> >
> > You should check to make sure this bug hasn't already been filed:
> > https://savannah.gnu.org/bugs/?group=make
> > And if it hasn't, submit it:
> > https://savannah.gnu.org/bugs/?func=additem&group=make
> >
> > ~ LukeShu
> >
> >
> 
> _______________________________________________
> Help-make mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-make





reply via email to

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