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
+26 -15
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.
local optim = $(OPTIM) ; if ! $(NO_TEST_DEBUG) {
OPTIM = ; local optim = $(OPTIM) ;
OPTIM = ;
}
SetupObjectsDir ; SetupObjectsDir ;
@@ -441,12 +446,14 @@ rule TestObjects
ObjectDefines $(objects) : TEST_OBOS ; ObjectDefines $(objects) : TEST_OBOS ;
} }
# Turn debugging on. That is usually desired for test code. if ! $(NO_TEST_DEBUG) {
ObjectCcFlags $(objects) : "-g" ; # Turn debugging on. That is usually desired for test code.
ObjectC++Flags $(objects) : "-g" ; ObjectCcFlags $(objects) : "-g" ;
ObjectC++Flags $(objects) : "-g" ;
# 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.
local optim = $(OPTIM) ; if ! $(NO_TEST_DEBUG) {
OPTIM = ; local optim = $(OPTIM) ;
OPTIM = ;
}
# SetupIncludes ; # SetupIncludes ;
SetupObjectsDir ; SetupObjectsDir ;
@@ -487,12 +496,14 @@ rule SimpleTest
LinkSharedOSLibs $(target) : $(libraries) ; LinkSharedOSLibs $(target) : $(libraries) ;
ObjectDefines $(sources) : TEST_OBOS ; ObjectDefines $(sources) : TEST_OBOS ;
# Turn debugging on. That is usually desired for test code. if ! $(NO_TEST_DEBUG) {
ObjectCcFlags $(sources) : "-g" ; # Turn debugging on. That is usually desired for test code.
ObjectC++Flags $(sources) : "-g" ; ObjectCcFlags $(sources) : "-g" ;
ObjectC++Flags $(sources) : "-g" ;
# Turn optimization on again. # Turn optimization on again.
OPTIM = $(optim) ; OPTIM = $(optim) ;
}
} }
rule Addon rule Addon