This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: user hostile gobbledygook in top level Makefile
On Mon, Nov 20, 2000 at 02:46:17AM -0200, Alexandre Oliva wrote:
> On Nov 19, 2000, "Zack Weinberg" <zackw@stanford.edu> wrote:
>
> > So I'm trying to figure out why I can't override BOOT_CFLAGS on the
> > command line from the top level
>
> You can. Or, at least, you're supposed to be able to do it.
I tried it and I coulda sworn it didn't work. But I was sleep
deprived at the time, so I may have been mistaken.
> > I see this in the top Makefile.in:
>
> > "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`"
>
> > Now, unless I am sorely confused, the effect of those echo | sed
> > commands is to convert "BOOT_CFLAGS=-fwhatever" into
> > "XFOO=-fwhatever", which means the subdir makefile won't see it.
>
> You're sorely confused :-)
>
> Note the `$$'. The purpose seems to be to replace `BOOT_CFLAGS=' with
> `XFOO=', as long as $(BOOT_CFLAGS) is empty. I.e., if you set
> BOOT_CFLAGS to non-empty, it will be passed down, but if you don't
> override it (note that it's not set in the top-level Makefile), you
> don't get the definition in the sub-directory overridden by the
> non-definition in the top level.
Oh yuck, surely there's a better way to achieve that?
zw