From 35d0aeac70aec6db30a71870f0afe613e66cb9b4 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 8 Apr 2009 09:51:01 +0000 Subject: [PATCH] Added rule SetupFeatureObjectsDir that simplifies using different output directories when a certain feature is enabled/disabled/configured a certain way. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30019 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/jam/MiscRules | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/build/jam/MiscRules b/build/jam/MiscRules index 8ff0b5044f..a144c649cb 100644 --- a/build/jam/MiscRules +++ b/build/jam/MiscRules @@ -1,6 +1,11 @@ rule SetupObjectsDir { + # SetupObjectsDir + # + # Internal rule used to set up the *{LOCATE,SEARCH}*_{TARGET,SOURCE} + # variables for the current directory. + local relPath = [ FDirName $(SUBDIR_TOKENS[2-]) ] ; if $(relPath) = . { relPath = ; @@ -24,6 +29,35 @@ rule SetupObjectsDir ; } +rule SetupFeatureObjectsDir feature +{ + # SetupFeatureObjectsDir + # + # Updates the *{LOCATE,SEARCH}*_{TARGET,SOURCE} variables for the current + # directory appending a to each of them. Note that it resets + # the LOCATE_TARGET, LOCATE_SOURCE, SEARCH_SOURCE (!) variables. I.e. it + # should be invoked before customizing these variables further (e.g. like + # adding additional source directories to SEARCH_SOURCE). + + COMMON_PLATFORM_LOCATE_TARGET + = [ FDirName $(COMMON_PLATFORM_LOCATE_TARGET) $(feature) ] ; + + local var ; + for var in COMMON_ARCH COMMON_DEBUG DEBUG_$(HAIKU_DEBUG_LEVELS) { + HOST_$(var)_LOCATE_TARGET + = [ FDirName $(HOST_$(var)_LOCATE_TARGET) $(feature) ] ; + TARGET_$(var)_LOCATE_TARGET + = [ FDirName $(TARGET_$(var)_LOCATE_TARGET) $(feature) ] ; + } + + LOCATE_TARGET = [ FDirName $(LOCATE_TARGET) $(feature) ] ; + 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