This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Broken script in gcc/Makefile.in
- From: Paul Brook <paul at codesourcery dot com>
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 19 May 2004 18:21:15 +0100
- Subject: Re: [patch] Broken script in gcc/Makefile.in
- Organization: CodeSourcery
- References: <200405191725.40785.paul@codesourcery.com> <20040519171204.GA11464@nevyn.them.org>
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