rule SetupObjectsDir { local relPath = [ FDirName $(SUBDIR_TOKENS[2-]) ] ; COMMON_PLATFORM_LOCATE_TARGET = [ FDirName $(HAIKU_COMMON_PLATFORM_OBJECT_DIR) $(relPath) ] ; local var ; for var in COMMON_ARCH COMMON_DEBUG DEBUG_$(HAIKU_DEBUG_LEVELS) { HOST_$(var)_LOCATE_TARGET = [ FDirName $(HOST_$(var)_OBJECT_DIR) $(relPath) ] ; TARGET_$(var)_LOCATE_TARGET = [ FDirName $(TARGET_$(var)_OBJECT_DIR) $(relPath) ] ; } LOCATE_TARGET = $(COMMON_PLATFORM_LOCATE_TARGET) ; LOCATE_SOURCE = $(LOCATE_TARGET) ; SEARCH_SOURCE = $(SUBDIR) $(LOCATE_SOURCE) $(HOST_COMMON_DEBUG_LOCATE_TARGET) # Also add the standard output $(TARGET_COMMON_DEBUG_LOCATE_TARGET) # dirs for generated sources. ; } rule SubIncludeGPL { # SubInclude rule that can be used to conditionally include GPL licensed # add-ons if $(INCLUDE_GPL_ADDONS) = 1 { SubInclude $(1) ; } } rule MakeLocateCommonPlatform { MakeLocate $(1) : $(COMMON_PLATFORM_LOCATE_TARGET) ; } rule MakeLocatePlatform { local files = $(1) ; local file ; for file in $(files) { if [ on $(file) return $(PLATFORM) ] = host { MakeLocate $(file) : $(HOST_COMMON_ARCH_LOCATE_TARGET) ; } else { MakeLocate $(file) : $(TARGET_COMMON_ARCH_LOCATE_TARGET) ; } } } rule MakeLocateArch { local files = $(1) ; local file ; for file in $(files) { if [ on $(file) return $(PLATFORM) ] = host { MakeLocate $(file) : $(HOST_COMMON_DEBUG_LOCATE_TARGET) ; } else { MakeLocate $(file) : $(TARGET_COMMON_DEBUG_LOCATE_TARGET) ; } } } rule MakeLocateDebug { local files = $(1) ; local file ; for file in $(files) { on $(file) { if $(PLATFORM) = host { MakeLocate $(file) : $(HOST_DEBUG_$(DEBUG)_LOCATE_TARGET) ; } else { MakeLocate $(file) : $(TARGET_DEBUG_$(DEBUG)_LOCATE_TARGET) ; } } } } rule DeferredSubInclude params { # 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. HAIKU_DEFERRED_SUB_INCLUDES += "/" $(params) ; } rule ExecuteDeferredSubIncludes { # ExecuteDeferredSubIncludes ; # # Performs the deferred SubIncludes scheduled by DeferredSubInclude. local tokensList = $(HAIKU_DEFERRED_SUB_INCLUDES) ; while $(tokensList) { # chop off leading "/" tokensList = $(tokensList[2-]) ; # get the tokens for the next include local tokens ; while $(tokensList) && $(tokensList[1]) != "/" { tokens += $(tokensList[1]) ; tokensList = $(tokensList[2-]) ; } # perform the include if $(tokens) { SubInclude $(tokens) ; } } } rule HaikuSubInclude tokens { # HaikuSubInclude ; # # Current subdir relative SubInclude. # - subdir tokens specifying the subdirectory to be include # (relative to the current subdir) if $(tokens) { SubInclude HAIKU_TOP $(SUBDIR_TOKENS) $(tokens) ; } } # The variable used to collect the deferred SubIncludes. HAIKU_DEFERRED_SUB_INCLUDES = ;