Subject: Re: Turning off optimization on selected files.
To: Eduardo Horvath <eeh@turbolinux.com>
From: Simon J. Gerraty <sjg@quick.com.au>
List: tech-kern
Date: 06/09/2000 17:00:22
>If I know that a small set of MI source files will break the compiler if
>compiled with optimization on, is there some easy way to turn it off in,
>say, sys/${ARCH}/conf/Makefile.${ARCH}?
Yes. That's one of the reasons I added ODE's :U modifier.
sys.mk should not have
CFLAGS?= -O
I ususall make that
DBG?= -O
CFLAGS?= ${DBG}
but anyway, if you made it something like:
DEF_COPT?= -O
CFLAGS?= ${${.TARGET}_COPT:U${DEF_COPT}}
you could have
fred.o_COPT=-O0
and -O0 would be used when .TARGET is fred.o
Change it around to suit your tastes, COPT_fred.o might look better.
--sjg