* Uncommented SetupIncludes in Addon. Same reason as with the others.

* Reintroduced Axel's fix to the public header dirs.
* Pulled the functionality to set the headers on object files out of
  Use*Headers and put it into new rules Use*ObjectHeaders. The usage differed
  too much.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@42 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2002-07-10 16:35:13 +00:00
parent acea35dd63
commit 7d7f280ed3
+98 -58
View File
@@ -187,7 +187,7 @@ rule UnitTest
DEPENDS $(target) : libcppunit.so ; DEPENDS $(target) : libcppunit.so ;
DEPENDS obostests : $(target) ; DEPENDS obostests : $(target) ;
LinkSharedOSLibs $(target) : libcppunit.so $(libraries) ; LinkSharedOSLibs $(target) : libcppunit.so $(libraries) ;
UsePublicHeaders $(headerDirs) : $(sources) ; UsePublicObjectHeaders $(sources) : $(headerDirs) ;
ObjectDefines $(sources) : TEST_OBOS ; ObjectDefines $(sources) : TEST_OBOS ;
# Turn debugging on. That is usually desired for test code. # Turn debugging on. That is usually desired for test code.
@@ -259,7 +259,7 @@ rule Addon
{ {
# Addon <name> : <relpath> : <sources> ; # Addon <name> : <relpath> : <sources> ;
SetupIncludes ; # SetupIncludes ;
SetupObjectsDir ; SetupObjectsDir ;
Main $(1) : $(3) ; Main $(1) : $(3) ;
@@ -367,98 +367,138 @@ rule AddResources
} }
} }
rule UsePublicHeaders rule PublicHeaders
{ {
# UsePublicHeaders <group list> [ <sources_or_objects> ] ; # PublicHeaders <group list>
# #
# Adds the public C header dirs given by <group list> to the header search # Returns the directory names for the public header dirs identified by
# dirs of the subdirectory or of <sources_or_objects>, if given. # <group list>.
# NOTE: Currently the latter doesn't work, since Cc seems to be
# buggy: It sets the HDRS variable to $(SUBDIRHDRS) instead of adding it.
local list = $(1) ; local list = $(1) ;
local targets = $(2) ; local dirs ;
local headers ;
for i in $(list) { for i in $(list) {
headers += [ FDirName $(OBOS_TOP) headers $(i) ] ; dirs += [ FDirName $(OBOS_TOP) headers os $(i) ] ;
} }
return $(dirs) ;
}
UseHeaders $(headers) : $(targets) ; rule PrivateHeaders
{
# PrivateHeaders <group list>
#
# Returns the directory names for the private header dirs identified by
# <group list>.
local list = $(1) ;
local dirs ;
for i in $(list) {
dirs += [ FDirName $(OBOS_TOP) headers private $(i) ] ;
}
return $(dirs) ;
}
rule ArchHeaders
{
# usage: ArchHeaders <arch> ;
#
# <arch> specifies the architecture (e.g. x86).
return [ FDirName $(OBOS_TOP) headers private kernel arch $(1) ] ;
}
rule UsePublicHeaders
{
# UsePublicHeaders <group list> ;
#
# Adds the public C header dirs given by <group list> to the header search
# dirs of the subdirectory.
# NOTE: This rule must be invoked *before* the rule that builds the objects.
UseHeaders [ PublicHeaders $(1) ] ;
}
rule UsePublicObjectHeaders
{
# UsePublicObjectHeaders <sources_or_objects> : <group list> ;
#
# Adds the public C header dirs given by <group list> to the header search
# dirs of <sources_or_objects>.
# NOTE: This rule must be invoked *after* the rule that builds the objects.
ObjectHdrs $(1) : [ PublicHeaders $(2) ] ;
} }
rule UsePrivateHeaders rule UsePrivateHeaders
{ {
# UsePrivateHeaders <group list> [ <sources_or_objects> ] ; # UsePrivateHeaders <group list> ;
# #
# Adds the private C header dirs given by <group list> to the header search # Adds the private C header dirs given by <group list> to the header search
# dirs of the subdirectory or of <sources_or_objects>, if given. # dirs of the subdirectory.
# NOTE: Currently the latter doesn't work, since Cc seems to be # NOTE: This rule must be invoked *before* the rule that builds the objects.
# buggy: It sets the HDRS variable to $(SUBDIRHDRS) instead of adding it.
local list = $(1) ; UseHeaders [ PrivateHeaders $(1) ] ;
local targets = $(2) ; }
local headers ; rule UsePrivateObjectHeaders
{
# UsePrivateObjectHeaders <sources_or_objects> : <group list> ;
#
# Adds the private C header dirs given by <group list> to the header search
# dirs of <sources_or_objects>.
# NOTE: This rule must be invoked *after* the rule that builds the objects.
for i in $(list) { ObjectHdrs $(1) : [ PrivateHeaders $(2) ] ;
headers += [ FDirName $(OBOS_TOP) headers private $(i) ] ;
}
UseHeaders $(headers) : $(targets) ;
} }
rule UseHeaders rule UseHeaders
{ {
# UseHeaders <headers> [ <sources_or_objects> ] ; # UseHeaders <headers> ;
# #
# Adds the C header dirs <headers> to the header search # Adds the C header dirs <headers> to the header search
# dirs of the subdirectory or of <sources_or_objects>, if given. # dirs of the subdirectory.
# NOTE: Currently the latter doesn't work, since Cc seems to be # NOTE: This rule must be invoked *before* the rule that builds the objects.
# buggy: It sets the HDRS variable to $(SUBDIRHDRS) instead of adding it.
local headers = $(1) ; local header ;
local targets = $(2) ; for header in $(1) {
SubDirHdrs $(header) ;
if $(targets) {
ObjectHdrs $(targets) : $(headers) ;
} else {
# Note: Unlike ObjectHdrs SubDirHdrs expects only one dir given as
# path component list.
for header in $(headers) {
SubDirHdrs $(header) ;
}
} }
} }
rule UseCppUnitHeaders rule UseCppUnitHeaders
{ {
local opt = -I [ FDirName $(OBOS_TOP) headers tools cppunit ] ; SubDirHdrs [ FDirName $(OBOS_TOP) headers tools cppunit ] ;
SubDirCcFlags $(opt) ;
SubDirC++Flags $(opt) ;
} }
rule UseArchHeaders rule UseArchHeaders
{ {
# usage: UseArchHeaders <arch> : [ <sources_or_objects> ] ; # usage: UseArchHeaders <arch> ;
#
# <arch> specifies the architecture (e.g. x86). # <arch> specifies the architecture (e.g. x86).
# <sources_or_objects> Source or object files. # NOTE: This rule must be invoked *before* the rule that builds the objects.
local headers = [ FDirName $(OBOS_TOP) headers private kernel arch $(1) ] ;
local targets = $(2) ; local headers = [ ArchHeaders $(1) ] ;
local opt = -D$(OBOS_TARGET_DEFINE) ; local opt = -D$(OBOS_TARGET_DEFINE) ;
if $(targets) { SubDirCcFlags $(opt) ;
ObjectCcFlags $(targets) : $(opt) ; SubDirC++Flags $(opt) ;
ObjectC++Flags $(targets) : $(opt) ; SubDirHdrs $(headers) ;
ObjectHdrs $(targets) : $(headers) ; }
} else {
SubDirCcFlags $(opt) ;
SubDirC++Flags $(opt) ;
SubDirHdrs $(headers) ;
}
rule UseArchObjectHeaders
{
# usage: UseArchObjectHeaders <sources_or_objects> : <arch> ;
#
# <arch> specifies the architecture (e.g. x86).
# <sources_or_objects> Source or object files.
# NOTE: This rule must be invoked *after* the rule that builds the objects.
local targets = $(1) ;
local headers = [ ArchHeaders $(2) ] ;
local opt = -D$(OBOS_TARGET_DEFINE) ;
ObjectCcFlags $(targets) : $(opt) ;
ObjectC++Flags $(targets) : $(opt) ;
ObjectHdrs $(targets) : $(headers) ;
} }
rule SplitPath rule SplitPath