[hatari-devel] CC/HOSTCC

Thomas Huth huth at users.berlios.de
Wed Mar 10 18:47:50 CET 2010


On Tue, 9 Mar 2010 23:04:05 +0100 (CET)
npomarede at corp.free.fr wrote:

> On Tue, 9 Mar 2010, Eero Tamminen wrote:
> 
> > Hi,
> >
> > Nicolas:
> >
> > http://hg.berlios.de/repos/hatari/rev/c784976559db
> > -HOSTCC = $(CC)
> > +HOSTCC = gcc
> >
> >
> > However, in Makefile-default.cnf this is done like this:
> > CC = gcc
> > HOSTCC ?= $(CC)
> >
> > This way it's still overridable from command line.
> 
> Hello, I agree with the ?= syntax, I committed a change for this.
> 
> >
> >
> > Btw. I don't understand this change/comment from Thomas:
> > 	http://hg.berlios.de/repos/hatari/rev/58a6b35826e5
> 
> It's true that using ?= shouldn't be a problem ; thomas, any reason
> for this ?

Make always pre-defines CC.
"?=" only sets the variable if it is not initialized yet.
So when you use "?=" in the Makefile, you can not change the compiler in
the Makefile anymore.

For example, when I set "CC ?= gcc-4.3" in my Makefile.cnf, and then
type "make", I get these outputs:

cc -g -Wmissing-prototypes -Wstrict-prototypes -Wsign-compare -Wbad-function-cast -Wcast-qual  -Wpointer-arith -Wall -Wwrite-strings  -O2 -I. -I../.. -I../includes -I../debug -I../falcon  -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT   -c -o hatari-glue.o hatari-glue.c
cc -g -Wmissing-prototypes -Wstrict-prototypes -Wsign-compare -Wbad-function-cast -Wcast-qual  -Wpointer-arith -Wall -Wwrite-strings  -O2 -I. -I../.. -I../includes -I../debug -I../falcon  -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT   -c -o memory.o memory.c
...

So we've got to use "=" instead of "?=" there.

To override this setting on the command line, you've got to specify the
compiler like this:

make CC=gcc-4.4

 Thomas



More information about the hatari-devel mailing list