* Removed invocations of SetupIncludes for the unit tests and removed the
`-nostdinc' flag from the CCFLAGS and C++FLAGS in R5Objects. The R5 tests must be compiled with the system header. * Introduced SetupR5Includes which simply clears HDRS. * Fixed rule Filter. * Removed some unnecessary `""' in CCFLAGS and C++FLAGS assignments. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1948 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -39,8 +39,8 @@ if ! $(INVOCATION_SUBDIR_SET) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# We do not include any local BeOS system headers by default
|
# We do not include any local BeOS system headers by default
|
||||||
CCFLAGS += " -nostdinc" ;
|
CCFLAGS += -nostdinc ;
|
||||||
C++FLAGS += " -nostdinc" ;
|
C++FLAGS += -nostdinc ;
|
||||||
|
|
||||||
# Determine if we're building on PPC or x86
|
# Determine if we're building on PPC or x86
|
||||||
# Determine mimetype of executable
|
# Determine mimetype of executable
|
||||||
@@ -70,10 +70,10 @@ if $(WARNINGS) {
|
|||||||
# -Wundef (dito)
|
# -Wundef (dito)
|
||||||
# -Wconversion (gets you many warnings about implicit conversions)
|
# -Wconversion (gets you many warnings about implicit conversions)
|
||||||
# -W (gets you even more warnigs)
|
# -W (gets you even more warnigs)
|
||||||
CCFLAGS += "-Wall -Wno-multichar -Wmissing-prototypes" ;
|
CCFLAGS += -Wall -Wno-multichar -Wmissing-prototypes ;
|
||||||
CCFLAGS += "-Wpointer-arith -Wcast-align -Wsign-compare" ;
|
CCFLAGS += -Wpointer-arith -Wcast-align -Wsign-compare ;
|
||||||
C++FLAGS += "-Wall -Wno-multichar -Wmissing-prototypes -Wno-ctor-dtor-privacy -Woverloaded-virtual" ;
|
C++FLAGS += -Wall -Wno-multichar -Wmissing-prototypes -Wno-ctor-dtor-privacy -Woverloaded-virtual ;
|
||||||
C++FLAGS += "-Wpointer-arith -Wcast-align -Wsign-compare" ;
|
C++FLAGS += -Wpointer-arith -Wcast-align -Wsign-compare ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# We might later want to introduce debug levels or handle the whole issue
|
# We might later want to introduce debug levels or handle the whole issue
|
||||||
@@ -91,9 +91,9 @@ if $(DEBUG) {
|
|||||||
# To disable for the tests OPTIM and DEBUG are overridden, set the environment
|
# To disable for the tests OPTIM and DEBUG are overridden, set the environment
|
||||||
# variable NO_TEST_DEBUG.
|
# 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) ;
|
||||||
KERNEL_CCFLAGS += "-DBOCHS_DEBUG_HACK=$(BOCHS_DEBUG_HACK) " ;
|
KERNEL_CCFLAGS += -DBOCHS_DEBUG_HACK=$(BOCHS_DEBUG_HACK) ;
|
||||||
|
|
||||||
# Instructs the Library rule to not make its object files temporary.
|
# Instructs the Library rule to not make its object files temporary.
|
||||||
# This is need as some objects are used in a static library and for an
|
# This is need as some objects are used in a static library and for an
|
||||||
@@ -163,6 +163,12 @@ rule SetupIncludes
|
|||||||
HDRS += /boot/develop/headers/posix /boot/develop/headers/cpp ;
|
HDRS += /boot/develop/headers/posix /boot/develop/headers/cpp ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rule SetupR5Includes
|
||||||
|
{
|
||||||
|
# Unsets HDRS, so that the OBOS headers do not `shadow' the system headers.
|
||||||
|
HDRS = ;
|
||||||
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Things Jam needs in order to work :)
|
# Things Jam needs in order to work :)
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
@@ -290,8 +296,6 @@ rule TestLib
|
|||||||
local headerDirs = $(5) ;
|
local headerDirs = $(5) ;
|
||||||
local objects = [ FGristFiles $(sources:S=$(SUFOBJ)) ] ;
|
local objects = [ FGristFiles $(sources:S=$(SUFOBJ)) ] ;
|
||||||
|
|
||||||
SetupIncludes ;
|
|
||||||
|
|
||||||
# Our Main replacement.
|
# Our Main replacement.
|
||||||
MainFromObjects $(target) : $(objects) ;
|
MainFromObjects $(target) : $(objects) ;
|
||||||
TestObjects $(sources) : $(headerDirs) ;
|
TestObjects $(sources) : $(headerDirs) ;
|
||||||
@@ -319,8 +323,6 @@ rule R5TestLib
|
|||||||
local libraries = $(4) ;
|
local libraries = $(4) ;
|
||||||
local objects = [ R5ObjectNames $(sources) ] ;
|
local objects = [ R5ObjectNames $(sources) ] ;
|
||||||
|
|
||||||
SetupIncludes ;
|
|
||||||
|
|
||||||
# Our Main replacement.
|
# Our Main replacement.
|
||||||
MainFromObjects $(target) : $(objects) ;
|
MainFromObjects $(target) : $(objects) ;
|
||||||
TestObjects $(sources) : : true ;
|
TestObjects $(sources) : : true ;
|
||||||
@@ -369,8 +371,6 @@ rule UnitTest
|
|||||||
local headerDirs = $(5) ;
|
local headerDirs = $(5) ;
|
||||||
local objects = [ FGristFiles $(sources:S=$(SUFOBJ)) ] ;
|
local objects = [ FGristFiles $(sources:S=$(SUFOBJ)) ] ;
|
||||||
|
|
||||||
SetupIncludes ;
|
|
||||||
|
|
||||||
# Our Main replacement.
|
# Our Main replacement.
|
||||||
MainFromObjects $(target) : $(objects) ;
|
MainFromObjects $(target) : $(objects) ;
|
||||||
TestObjects $(sources) : $(headerDirs) ;
|
TestObjects $(sources) : $(headerDirs) ;
|
||||||
@@ -397,8 +397,6 @@ rule R5UnitTest
|
|||||||
local libraries = $(4) ;
|
local libraries = $(4) ;
|
||||||
local objects = [ R5ObjectNames $(sources) ] ;
|
local objects = [ R5ObjectNames $(sources) ] ;
|
||||||
|
|
||||||
SetupIncludes ;
|
|
||||||
|
|
||||||
# Our Main replacement.
|
# Our Main replacement.
|
||||||
MainFromObjects $(target) : $(objects) ;
|
MainFromObjects $(target) : $(objects) ;
|
||||||
TestObjects $(sources) : : true ;
|
TestObjects $(sources) : : true ;
|
||||||
@@ -421,9 +419,16 @@ rule R5ObjectNames
|
|||||||
rule R5Objects
|
rule R5Objects
|
||||||
{
|
{
|
||||||
# R5Objects <sources>
|
# R5Objects <sources>
|
||||||
# Similar to Objects, but appends "_r5" to the object file names.
|
# Similar to Objects, but appends "_r5" to the object file names and
|
||||||
|
# removes `-nostdinc' from the CC and C++ flags to enable system headers.
|
||||||
# <sources> The source files.
|
# <sources> The source files.
|
||||||
|
|
||||||
|
# Remove `-nostdinc' from CCFLAGS and C++FLAGS.
|
||||||
|
local oldCCFLAGS = $(CCFLAGS) ;
|
||||||
|
local oldC++FLAGS = $(C++FLAGS) ;
|
||||||
|
CCFLAGS = [ Filter $(CCFLAGS) : -nostdinc ] ;
|
||||||
|
C++FLAGS = [ Filter $(C++FLAGS) : -nostdinc ] ;
|
||||||
|
|
||||||
local sources = $(1) ;
|
local sources = $(1) ;
|
||||||
local source ;
|
local source ;
|
||||||
for source in [ FGristFiles $(sources) ]
|
for source in [ FGristFiles $(sources) ]
|
||||||
@@ -432,6 +437,10 @@ rule R5Objects
|
|||||||
Object $(object) : $(source) ;
|
Object $(object) : $(source) ;
|
||||||
LocalDepends obj : $(object) ;
|
LocalDepends obj : $(object) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Reset CCFLAGS and C++FLAGS to original values.
|
||||||
|
CCFLAGS = $(oldCCFLAGS) ;
|
||||||
|
C++FLAGS = $(oldC++FLAGS) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
rule TestObjects
|
rule TestObjects
|
||||||
@@ -456,14 +465,15 @@ rule TestObjects
|
|||||||
OPTIM = ;
|
OPTIM = ;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetupIncludes ;
|
|
||||||
SetupObjectsDir ;
|
SetupObjectsDir ;
|
||||||
|
|
||||||
# compile
|
# compile
|
||||||
if $(r5) {
|
if $(r5) {
|
||||||
|
SetupR5Includes ;
|
||||||
objects = [ R5ObjectNames $(sources) ] ;
|
objects = [ R5ObjectNames $(sources) ] ;
|
||||||
R5Objects $(sources) ;
|
R5Objects $(sources) ;
|
||||||
} else {
|
} else {
|
||||||
|
SetupIncludes ;
|
||||||
objects = [ FGristFiles $(sources:S=$(SUFOBJ)) ] ;
|
objects = [ FGristFiles $(sources:S=$(SUFOBJ)) ] ;
|
||||||
Objects $(sources) ;
|
Objects $(sources) ;
|
||||||
}
|
}
|
||||||
@@ -1123,7 +1133,7 @@ rule Filter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ! $(skip) {
|
if ! $(skip) {
|
||||||
newList += item ;
|
newList += $(item) ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $(newList) ;
|
return $(newList) ;
|
||||||
|
|||||||
Reference in New Issue
Block a user