This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Broken script in gcc/Makefile.in


On Wednesday 19 May 2004 18:12, Daniel Jacobowitz wrote:
> On Wed, May 19, 2004 at 05:25:40PM +0100, Paul Brook wrote:
> > The makefile segments for {AR,RANLIB,NM}_FOR_TARGET in gcc/Makefile.in
> > are broken. They contain the line
> >
> >  t='$(program_transform_name)'; echo nm | sed -e $$t ;
> >
> > which expands to t='s,^,arm-none-elf-,;'; echo ar | sed -e  ;
> >
> > This code is only executed when running make inside gcc/ as AR_FOR_TARGET
> > is overridden by the toplevel makefile.
> >
> > The patch below fixes this by avoiding the use of t.
> >
> > Tested with cross from i686-linux to arm-none-elf.
> > Ok?
>
> I'm feeling dense today.  How does the one expand to the other?  It
> should expand to: t='s,^,arm-none-elf-,;'; echo ar | sed -e $t ;
>
> (Though I think the new form is nicer anyway.)

I don't know enough about the inticacies of makefiles to tell if it's a bug or 
a feature (I'm using GNU make 3.8.0).
That line is inside backtics ( ` ) as an assignment, not as part of a makefile 
rule. I'm guessing this causes an extra variable expansion pass somewhere. 

Replacing $$t with $$$$t gives the correct result.

Paul


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]