From 3ddb7b1df483073c130b1231ddbbad1c3e36101d Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Thu, 26 Jul 2007 23:08:05 +0000 Subject: [PATCH] * ResComp can now deal with multiple input files at once. * Added ResAttr rule, which converts resource (or rdef) files to a file with attributes. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21708 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/jam/BeOSRules | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/build/jam/BeOSRules b/build/jam/BeOSRules index 61e6b5c331..1f5c1ceaa9 100644 --- a/build/jam/BeOSRules +++ b/build/jam/BeOSRules @@ -216,10 +216,46 @@ rule ResComp ResComp1 $(1) : rc $(2) ; } -# Note: We pipe the file into the preprocessor, since *.rdef files are -# considered linker scripts. +# Note: We pipe the input files into the preprocessor, since *.rdef files are +# considered linker scripts, and thus we can use preprocessor features. actions ResComp1 { $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) - cat $(2[2]) | $(CC) -E $(CCDEFS) $(HDRS) - | egrep -v '^#' | $(2[1]) $(RCHDRS) --auto-names -o $(1) - + cat $(2[2-]) | $(CC) -E $(CCDEFS) $(HDRS) - | egrep -v '^#' | $(2[1]) $(RCHDRS) --auto-names -o $(1) - +} + +rule ResAttr attributeFile : _resourceFiles +{ + # ResAttr : ; + # + # and must be gristed. + # can also be .rdef files -- they will be compiled first in + # this case. + + local resourceFiles ; + local resourceFile ; + for resourceFile in $(_resourceFiles) { + # if the specified resource file is an .rdef file, we compile it first + if $(resourceFile:S) = ".rdef" { + local rdefFile = $(resourceFile) ; + resourceFile = $(rdefFile:S=.rsrc) ; + ResComp $(resourceFile) : $(rdefFile) ; + } else { + SEARCH on $(resourceFile) += $(SEARCH_SOURCE) ; + } + + resourceFiles += $(resourceFile) ; + } + + MakeLocateArch $(attributeFile) ; + Depends $(attributeFile) : $(resourceFiles) resattr ; + LocalClean clean : $(attributeFile) ; + ResAttr1 $(attributeFile) : resattr $(resourceFiles) ; +} + +actions ResAttr1 +{ + $(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR) + rm -f $(1) + $(2[1]) -o $(1) $(2[2-]) }