mirror of
https://review.haiku-os.org/haiku
synced 2025-02-01 19:26:13 +01:00
3f2a43554a
* Added new rule HaikuSubInclude for more comfortable subdirectory inclusion. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20352 a95241bf-73f2-0310-859d-f6bbb57e9c96
130 lines
3.0 KiB
Plaintext
130 lines
3.0 KiB
Plaintext
|
|
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 <subdir tokens> ;
|
|
#
|
|
# Takes the same parameter as SubInclude. The the subdirectory referred to
|
|
# by <subdir tokens> 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 <tokens> ;
|
|
#
|
|
# Current subdir relative SubInclude.
|
|
# <tokens> - 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 = ;
|