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
This commit is contained in:
Ingo Weinhold
2002-09-16 22:21:37 +00:00
parent 45ed7b19fd
commit 96d2746579
+12 -1
View File
@@ -57,7 +57,7 @@ if $(METROWERKS) {
# Enable warnings only if WARNINGS is defined # Enable warnings only if WARNINGS is defined
# Should be enabled by default later # Should be enabled by default later
#
if $(WARNINGS) { if $(WARNINGS) {
# For an explanation of the different warning options, see: # For an explanation of the different warning options, see:
# http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html # http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html
@@ -83,6 +83,9 @@ if $(DEBUG) {
} else { } else {
OPTIM ?= -O2 ; 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 ?= "-Wall -Wno-multichar -Wmissing-prototypes -finline -nostdinc" ;
KERNEL_CCFLAGS += "-fno-builtin -D$(OBOS_TARGET_DEFINE) " ; KERNEL_CCFLAGS += "-fno-builtin -D$(OBOS_TARGET_DEFINE) " ;
@@ -418,8 +421,10 @@ rule TestObjects
local objects ; local objects ;
# Turn optimization off. # Turn optimization off.
if ! $(NO_TEST_DEBUG) {
local optim = $(OPTIM) ; local optim = $(OPTIM) ;
OPTIM = ; OPTIM = ;
}
SetupObjectsDir ; SetupObjectsDir ;
@@ -441,6 +446,7 @@ rule TestObjects
ObjectDefines $(objects) : TEST_OBOS ; ObjectDefines $(objects) : TEST_OBOS ;
} }
if ! $(NO_TEST_DEBUG) {
# Turn debugging on. That is usually desired for test code. # Turn debugging on. That is usually desired for test code.
ObjectCcFlags $(objects) : "-g" ; ObjectCcFlags $(objects) : "-g" ;
ObjectC++Flags $(objects) : "-g" ; ObjectC++Flags $(objects) : "-g" ;
@@ -448,6 +454,7 @@ rule TestObjects
# Turn optimization on again. # Turn optimization on again.
OPTIM = $(optim) ; OPTIM = $(optim) ;
} }
}
rule R5SharedLibraryNames rule R5SharedLibraryNames
{ {
@@ -475,8 +482,10 @@ rule SimpleTest
local relPath = [ FRelPath src tests : $(SUBDIR_TOKENS) ] ; local relPath = [ FRelPath src tests : $(SUBDIR_TOKENS) ] ;
# Turn optimization off. # Turn optimization off.
if ! $(NO_TEST_DEBUG) {
local optim = $(OPTIM) ; local optim = $(OPTIM) ;
OPTIM = ; OPTIM = ;
}
# SetupIncludes ; # SetupIncludes ;
SetupObjectsDir ; SetupObjectsDir ;
@@ -487,6 +496,7 @@ rule SimpleTest
LinkSharedOSLibs $(target) : $(libraries) ; LinkSharedOSLibs $(target) : $(libraries) ;
ObjectDefines $(sources) : TEST_OBOS ; ObjectDefines $(sources) : TEST_OBOS ;
if ! $(NO_TEST_DEBUG) {
# Turn debugging on. That is usually desired for test code. # Turn debugging on. That is usually desired for test code.
ObjectCcFlags $(sources) : "-g" ; ObjectCcFlags $(sources) : "-g" ;
ObjectC++Flags $(sources) : "-g" ; ObjectC++Flags $(sources) : "-g" ;
@@ -494,6 +504,7 @@ rule SimpleTest
# Turn optimization on again. # Turn optimization on again.
OPTIM = $(optim) ; OPTIM = $(optim) ;
} }
}
rule Addon rule Addon
{ {