This is the mail archive of the gcc@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]

Re: nls patches - need help with make machinery


In article <200006032205.AAA07086@loewis.home.cs.tu-berlin.de> you write:

>INTLLIBS = @INTLLIBS@
>
>and then add this to all places in ch/Makefile.in where INTLLIBS is
>added in the cp Makefile (i.e. LIBS and LIBDEPS).

>P.S. What is the rationale for indirecting every configure variable
>through a Makefile variable?

It's a not-well-known, fairly useful trick.
If you enter

make CFLAGS=-O2

then the value you give on make's command line overrides what's in 
the Makefile (granted, this does not work for recursive builds).
(not to be confused with 'CFLAGS=-O2 make', in /bin/sh, which does set
the env variable CFLAGS, which does NOT override whatever is in the Makefile)

If you simply have 
LIBS=-lfoo -lintl -l${DASDWE}
and you want to override -lintl (say, with specialbuild/libintl.a to test
something), you have to override LIBS.
Whereas
make INTLLIBS=specialbuild/libintl.a
is simpler and faster.

The large advantage of not having to edit the Makefile is that of course,
you won't forget to edit it back later.

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