Added FSplitString helper rule, which splits a string at a given delimiter

character, returning a component list.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30872 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-05-27 00:26:29 +00:00
parent 5348460789
commit d3e1c27d6b
+22 -8
View File
@@ -13,7 +13,7 @@ if ! $(INVOCATION_SUBDIR_SET) {
a = $(a[2-]) ; a = $(a[2-]) ;
b = $(b[2-]) ; b = $(b[2-]) ;
} }
if $(a) { if $(a) {
return ; return ;
} else { } else {
@@ -65,6 +65,20 @@ rule FGetGrist
return [ Match <(.*)> : $(grist) ] ; return [ Match <(.*)> : $(grist) ] ;
} }
rule FSplitString string : delimiterChar
{
local result ;
while $(string) {
local split = [ Match $(delimiterChar)*([^$(delimiterChar)]+)(.*)
: $(string) ] ;
result += $(split[1]) ;
string = $(split[2-]) ;
}
return $(result) ;
}
rule FSplitPath rule FSplitPath
{ {
# SplitPath <path> ; # SplitPath <path> ;
@@ -87,9 +101,9 @@ rule FTimeZoneBinaries
local sources = $(1:G=timezone-source) ; local sources = $(1:G=timezone-source) ;
local locate = $(2) ; local locate = $(2) ;
local setRelativeTimezoneDir = $(3) ; local setRelativeTimezoneDir = $(3) ;
local gristedBinaries ; local gristedBinaries ;
local source ; local source ;
for source in $(sources) { for source in $(sources) {
local binaries = [ on $(source) return $(TZ_OBJECTS) ] ; local binaries = [ on $(source) return $(TZ_OBJECTS) ] ;
@@ -149,24 +163,24 @@ rule SetPlatformCompatibilityFlagVariables
$(varPrefix)_PLATFORM_BONE_COMPATIBLE = ; $(varPrefix)_PLATFORM_BONE_COMPATIBLE = ;
$(varPrefix)_PLATFORM_DANO_COMPATIBLE = ; $(varPrefix)_PLATFORM_DANO_COMPATIBLE = ;
$(varPrefix)_PLATFORM_HAIKU_COMPATIBLE = ; $(varPrefix)_PLATFORM_HAIKU_COMPATIBLE = ;
switch $(platform) switch $(platform)
{ {
case r5 : case r5 :
{ {
$(varPrefix)_PLATFORM_BEOS_COMPATIBLE = true ; $(varPrefix)_PLATFORM_BEOS_COMPATIBLE = true ;
} }
case bone : case bone :
{ {
$(varPrefix)_PLATFORM_BONE_COMPATIBLE = true ; $(varPrefix)_PLATFORM_BONE_COMPATIBLE = true ;
} }
case dano : case dano :
{ {
$(varPrefix)_PLATFORM_DANO_COMPATIBLE = true ; $(varPrefix)_PLATFORM_DANO_COMPATIBLE = true ;
} }
case haiku_host : case haiku_host :
{ {
$(varPrefix)_PLATFORM_HAIKU_COMPATIBLE = true ; $(varPrefix)_PLATFORM_HAIKU_COMPATIBLE = true ;