Re: [cc65] Building with custom CC and CFLAGS

From: Ullrich von Bassewitz <>
Date: 2009-09-10 23:18:03
On Thu, Sep 10, 2009 at 10:32:05PM +0200, Per Olofsson wrote:
> Currently the gcc.mak files contain this:
> CFLAGS = -O4 -Wall -W -std=c89 -I$(COMMON)

It's -O2 but I see your point.

> This can be replaced by:
> CFLAGS = -O4 -Wall -W -std=c89
> in the top level makefile, and:
> in the "child" makefiles.

Maybe I'm not understanding this completely, but as already described in
another mail, I'm not using the top level makefile when working on one of the
tools (actually, the top level makefile is mostly used by the nightly build
script). If the "normal" makefiles just contain "CFLAGS += -I$(COMMON)" how do
they get "-O4 -Wall -W -std=c89" when called directly (which is their main

> CC does not need to be set at all, as the
> system default is probably what you want. If you want to use an
> alternate compiler, set CC yourself.

Maybe, but I don't like the idea. If I would just compile the stuff for
myself, this is acceptable. But you can think of my box as something like a
production environment. And I don't like the idea that nightly builds or even
stable versions depend on the settings someone "installs" on my system by
means of an RPM of whatever. I'm developing software for a living (among other
things) and I've learned that it is absolutely critical that I can tell
exactly how a software was built. I have written commercial software that - on
request - not only outputs the SVN version number, but also the compiler
version that was used to compile it, and the SVN release of the compiler
sources! Using "whatever compiler is installed on my system today" makes my
toenails roll up.

Is it possible to do something like "if it's defined on the command line, then
use it, else use what the makefile says" for a variable? If this is possible,
then I can change the makefiles accordingly. You would then have to define
your own variables on the command line when calling make.



Ullrich von Bassewitz                        
To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Sep 10 23:21:13 2009

This archive was generated by hypermail 2.1.8 : 2009-09-10 23:21:15 CEST