From 7d7f280ed3e93a3fb30660c6f5a349cf53d5cc2d Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 10 Jul 2002 16:35:13 +0000 Subject: [PATCH] * 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 --- Jamrules | 156 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 98 insertions(+), 58 deletions(-) diff --git a/Jamrules b/Jamrules index 21a16f6487..a1f4c5161c 100644 --- a/Jamrules +++ b/Jamrules @@ -187,7 +187,7 @@ rule UnitTest DEPENDS $(target) : libcppunit.so ; DEPENDS obostests : $(target) ; LinkSharedOSLibs $(target) : libcppunit.so $(libraries) ; - UsePublicHeaders $(headerDirs) : $(sources) ; + UsePublicObjectHeaders $(sources) : $(headerDirs) ; ObjectDefines $(sources) : TEST_OBOS ; # Turn debugging on. That is usually desired for test code. @@ -259,7 +259,7 @@ rule Addon { # Addon : : ; - SetupIncludes ; +# SetupIncludes ; SetupObjectsDir ; Main $(1) : $(3) ; @@ -367,98 +367,138 @@ rule AddResources } } -rule UsePublicHeaders +rule PublicHeaders { - # UsePublicHeaders [ ] ; + # PublicHeaders # - # Adds the public C header dirs given by to the header search - # dirs of the subdirectory or of , if given. - # NOTE: Currently the latter doesn't work, since Cc seems to be - # buggy: It sets the HDRS variable to $(SUBDIRHDRS) instead of adding it. + # Returns the directory names for the public header dirs identified by + # . local list = $(1) ; - local targets = $(2) ; - - local headers ; - + local dirs ; 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 + # + # Returns the directory names for the private header dirs identified by + # . + + local list = $(1) ; + local dirs ; + for i in $(list) { + dirs += [ FDirName $(OBOS_TOP) headers private $(i) ] ; + } + return $(dirs) ; +} + +rule ArchHeaders +{ + # usage: ArchHeaders ; + # + # specifies the architecture (e.g. x86). + + return [ FDirName $(OBOS_TOP) headers private kernel arch $(1) ] ; +} + +rule UsePublicHeaders +{ + # UsePublicHeaders ; + # + # Adds the public C header dirs given by 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 : ; + # + # Adds the public C header dirs given by to the header search + # dirs of . + # NOTE: This rule must be invoked *after* the rule that builds the objects. + + ObjectHdrs $(1) : [ PublicHeaders $(2) ] ; } rule UsePrivateHeaders { - # UsePrivateHeaders [ ] ; + # UsePrivateHeaders ; # # Adds the private C header dirs given by to the header search - # dirs of the subdirectory or of , if given. - # NOTE: Currently the latter doesn't work, since Cc seems to be - # buggy: It sets the HDRS variable to $(SUBDIRHDRS) instead of adding it. + # dirs of the subdirectory. + # NOTE: This rule must be invoked *before* the rule that builds the objects. - local list = $(1) ; - local targets = $(2) ; + UseHeaders [ PrivateHeaders $(1) ] ; +} - local headers ; +rule UsePrivateObjectHeaders +{ + # UsePrivateObjectHeaders : ; + # + # Adds the private C header dirs given by to the header search + # dirs of . + # NOTE: This rule must be invoked *after* the rule that builds the objects. - for i in $(list) { - headers += [ FDirName $(OBOS_TOP) headers private $(i) ] ; - } - - UseHeaders $(headers) : $(targets) ; + ObjectHdrs $(1) : [ PrivateHeaders $(2) ] ; } rule UseHeaders { - # UseHeaders [ ] ; + # UseHeaders ; # # Adds the C header dirs to the header search - # dirs of the subdirectory or of , if given. - # NOTE: Currently the latter doesn't work, since Cc seems to be - # buggy: It sets the HDRS variable to $(SUBDIRHDRS) instead of adding it. + # dirs of the subdirectory. + # NOTE: This rule must be invoked *before* the rule that builds the objects. - local headers = $(1) ; - local targets = $(2) ; - - 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) ; - } + local header ; + for header in $(1) { + SubDirHdrs $(header) ; } } rule UseCppUnitHeaders { - local opt = -I [ FDirName $(OBOS_TOP) headers tools cppunit ] ; - - SubDirCcFlags $(opt) ; - SubDirC++Flags $(opt) ; + SubDirHdrs [ FDirName $(OBOS_TOP) headers tools cppunit ] ; } rule UseArchHeaders { - # usage: UseArchHeaders : [ ] ; + # usage: UseArchHeaders ; + # # specifies the architecture (e.g. x86). - # Source or object files. - local headers = [ FDirName $(OBOS_TOP) headers private kernel arch $(1) ] ; - local targets = $(2) ; + # NOTE: This rule must be invoked *before* the rule that builds the objects. + + local headers = [ ArchHeaders $(1) ] ; local opt = -D$(OBOS_TARGET_DEFINE) ; - if $(targets) { - ObjectCcFlags $(targets) : $(opt) ; - ObjectC++Flags $(targets) : $(opt) ; - ObjectHdrs $(targets) : $(headers) ; - } else { - SubDirCcFlags $(opt) ; - SubDirC++Flags $(opt) ; - SubDirHdrs $(headers) ; - } + SubDirCcFlags $(opt) ; + SubDirC++Flags $(opt) ; + SubDirHdrs $(headers) ; +} +rule UseArchObjectHeaders +{ + # usage: UseArchObjectHeaders : ; + # + # specifies the architecture (e.g. x86). + # 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