diff --git a/Jamfile b/Jamfile index e9a41f273c..1b4c8da18b 100644 --- a/Jamfile +++ b/Jamfile @@ -145,6 +145,9 @@ if $(HAIKU_INCLUDE_3RDPARTY) { SubInclude HAIKU_TOP 3rdparty ; } +# Perform deferred SubIncludes. +ExecuteDeferredSubIncludes ; + # reset subdir SubDir HAIKU_TOP ; @@ -153,6 +156,3 @@ include [ FDirName $(HAIKU_BUILD_RULES_DIR) HaikuImage ] ; include [ FDirName $(HAIKU_BUILD_RULES_DIR) NetBootArchive ] ; include [ FDirName $(HAIKU_BUILD_RULES_DIR) FloppyBootImage ] ; include [ FDirName $(HAIKU_BUILD_RULES_DIR) CDBootImage ] ; - -# Perform deferred SubIncludes. -ExecuteDeferredSubIncludes ; diff --git a/build/jam/ConfigRules b/build/jam/ConfigRules index 6e9429852a..2f33a8106d 100644 --- a/build/jam/ConfigRules +++ b/build/jam/ConfigRules @@ -163,6 +163,6 @@ rule PrepareConfigVariables # Some config variables that should be set up automatically for subdirs. AUTO_SET_UP_CONFIG_VARIABLES += - CCFLAGS C++FLAGS DEBUG DEFINES HDRS LINKFLAGS OPTIM OPTIMIZE + CCFLAGS C++FLAGS DEBUG DEFINES HDRS JAMFILE LINKFLAGS OPTIM OPTIMIZE SYSHDRS WARNINGS ; diff --git a/build/jam/MiscRules b/build/jam/MiscRules index 625899e66c..5c1645b64c 100644 --- a/build/jam/MiscRules +++ b/build/jam/MiscRules @@ -90,15 +90,22 @@ rule MakeLocateDebug # The variable used to collect the deferred SubIncludes. HAIKU_DEFERRED_SUB_INCLUDES = ; -rule DeferredSubInclude params +rule DeferredSubInclude params : jamfile : scope { - # DeferredSubInclude ; + # DeferredSubInclude [ : [ : ] ] ; # - # Takes the same parameter as SubInclude. The the subdirectory referred to - # by will be included when ExecuteDeferredSubIncludes is - # invoked, i.e. at the end of the root Jamfile. + # Takes the same directory tokens parameter as SubInclude plus an optional + # alternative Jamfile name. The the subdirectory referred to by + # will be included when ExecuteDeferredSubIncludes is + # invoked, i.e. at the end of the root Jamfile. The parameter + # specifies the name of the Jamfile to include. By default it is "Jamfile". + # The parameter can be "global" (default) or "local", specifying + # whether the alternative Jamfile name shall also be used for subdirectories. HAIKU_DEFERRED_SUB_INCLUDES += "/" $(params) ; + if $(jamfile) { + SetConfigVar JAMFILE : $(params) : $(jamfile) : $(scope) ; + } } rule ExecuteDeferredSubIncludes diff --git a/build/jam/UserBuildConfig.ReadMe b/build/jam/UserBuildConfig.ReadMe index 4786ffa3c8..5f440341a2 100644 --- a/build/jam/UserBuildConfig.ReadMe +++ b/build/jam/UserBuildConfig.ReadMe @@ -158,7 +158,7 @@ AddTargetVariableToScript test.inc : fs_shell_command : fsShellCommand ; AddTargetVariableToScript test.inc : rc ; -# Optimizing Jamfile Parsing Times +# Optimizing Jamfile Parsing Times / Third Party Inclusion # Setting this variable will prevent the root Jamfile to include the Jamfile # in the src directory. Instead only the directories required for building the @@ -172,6 +172,13 @@ HAIKU_DONT_INCLUDE_SRC = 1 ; DeferredSubInclude HAIKU_TOP src tests add-ons kernel file_systems userlandfs ; +# Schedule src/3rdparty/myproject/Jamfile.haiku for later inclusion. The "local" +# parameter specifies that the alternative Jamfile name shall not be used for +# any subdirectory of the given directory (i.e. "Jamfile" will be used as +# usual). Omitting this parameter or specifying "global" will cause the given +# name to be used recursively. +DeferredSubInclude HAIKU_TOP src 3rdparty myproject : Jamfile.haiku : local ; + # Copy the posix test suite onto the image (or on the installation) into # "home/posixtestsuite" directory, including the run script.