Subject: Re: another makefile mystery: COPTS
To: Todd Whitesel <toddpw@best.com>
From: Bill Studenmund <wrstuden@nas.nasa.gov>
List: tech-toolchain
Date: 01/18/2000 13:59:23
On Tue, 18 Jan 2000, Todd Whitesel wrote:

> Why do kernel makefiles put things like -O2 and warning flags in COPTS?
> Worse, the default contents appear to vary by arch.

Because that's where it belongs? ;-) COPTS is for things for cc1, and is
passed to the c compiler when it's compiling.

CPPFLAGS are the for-pre-processor flags.

> I tried adding -pipe by setting COPTS; it works great for userland but
> isn't a good idea for kernels.
> 
> I found that I can set DEBUG for kernels, but that's cheesy and I'd rather
> have my top-level stuff not need to know which of those it has to use.
> 
> Is there some overriding reason why kernel makefiles don't keep COPTS free
> for users to set without impacting any other default options?

??

What defaults get blown away?

Part of the idea (I thought) of how the kernel make files worked is that
you config a kernel, and then make it. They don't include any other make
files (except for kernel ones, like libkern and friends) - they are fairly
independent of the normal build process (much more self contained than
userland builds).

Take care,

Bill