From 96d2746579648d29cfd4d91a48f47bbc4b89540e Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Mon, 16 Sep 2002 22:21:37 +0000 Subject: [PATCH] Now the environment variable NO_TEST_DEBUG can be set to make the rules that build the tests NOT override the global optimization and debug settings. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1065 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- Jamrules | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/Jamrules b/Jamrules index c8ca5911d6..116ab83930 100644 --- a/Jamrules +++ b/Jamrules @@ -57,7 +57,7 @@ if $(METROWERKS) { # Enable warnings only if WARNINGS is defined # Should be enabled by default later - +# if $(WARNINGS) { # For an explanation of the different warning options, see: # http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html @@ -83,6 +83,9 @@ if $(DEBUG) { } else { OPTIM ?= -O2 ; } +# +# To disable for the tests OPTIM and DEBUG are overridden, set the environment +# variable NO_TEST_DEBUG. KERNEL_CCFLAGS ?= "-Wall -Wno-multichar -Wmissing-prototypes -finline -nostdinc" ; KERNEL_CCFLAGS += "-fno-builtin -D$(OBOS_TARGET_DEFINE) " ; @@ -418,8 +421,10 @@ rule TestObjects local objects ; # Turn optimization off. - local optim = $(OPTIM) ; - OPTIM = ; + if ! $(NO_TEST_DEBUG) { + local optim = $(OPTIM) ; + OPTIM = ; + } SetupObjectsDir ; @@ -441,12 +446,14 @@ rule TestObjects ObjectDefines $(objects) : TEST_OBOS ; } - # Turn debugging on. That is usually desired for test code. - ObjectCcFlags $(objects) : "-g" ; - ObjectC++Flags $(objects) : "-g" ; + if ! $(NO_TEST_DEBUG) { + # Turn debugging on. That is usually desired for test code. + ObjectCcFlags $(objects) : "-g" ; + ObjectC++Flags $(objects) : "-g" ; - # Turn optimization on again. - OPTIM = $(optim) ; + # Turn optimization on again. + OPTIM = $(optim) ; + } } rule R5SharedLibraryNames @@ -475,8 +482,10 @@ rule SimpleTest local relPath = [ FRelPath src tests : $(SUBDIR_TOKENS) ] ; # Turn optimization off. - local optim = $(OPTIM) ; - OPTIM = ; + if ! $(NO_TEST_DEBUG) { + local optim = $(OPTIM) ; + OPTIM = ; + } # SetupIncludes ; SetupObjectsDir ; @@ -487,12 +496,14 @@ rule SimpleTest LinkSharedOSLibs $(target) : $(libraries) ; ObjectDefines $(sources) : TEST_OBOS ; - # Turn debugging on. That is usually desired for test code. - ObjectCcFlags $(sources) : "-g" ; - ObjectC++Flags $(sources) : "-g" ; + if ! $(NO_TEST_DEBUG) { + # Turn debugging on. That is usually desired for test code. + ObjectCcFlags $(sources) : "-g" ; + ObjectC++Flags $(sources) : "-g" ; - # Turn optimization on again. - OPTIM = $(optim) ; + # Turn optimization on again. + OPTIM = $(optim) ; + } } rule Addon