diff --git a/build/jam/BeOSRules b/build/jam/BeOSRules index 0caba7c899..33ad59b287 100644 --- a/build/jam/BeOSRules +++ b/build/jam/BeOSRules @@ -1,5 +1,48 @@ # BeOS specific rules +rule AddFileDataAttribute target : attrName : attrType : dataFile +{ + # AddFileAttribute : : : ; + # Adds a single attribute to a file, retrieving the attribute data from + # a separate file. + # : The file to which the attribute shall be added. + # : The name of the attribute. + # : Attribute type as supported by addattr (string, int, etc.) + # : The data to be written to the attribute will be read from + # that file. + # Note that this is supposed to be a build target, not a path + # name - if you need to add a data file in a different path, + # you have to locate it first. + # + + # We need to create a temporary file in which we store the attribute name + # and type. Otherwise we wouldn't have these data available in the + # addattr actions. + local id = [ NextID ] ; + local attrMetaFile + = [ FGristFiles $(target:G=)-attr-$(attrName)-$(attrType)-$(id) ] ; + + ATTRIBUTE_NAME on $(attrMetaFile) = $(attrName) ; + ATTRIBUTE_TYPE on $(attrMetaFile) = $(attrType) ; + MakeLocateArch $(attrMetaFile) ; + CreateAttributeMetaFile $(attrMetaFile) ; + + Depends $(target) : addattr $(attrMetaFile) $(dataFile) ; + AddFileDataAttribute1 $(target) + : addattr $(attrMetaFile) $(dataFile) ; + + RmTemps $(target) : $(attrMetaFile) ; +} + +actions CreateAttributeMetaFile +{ + echo "-t $(ATTRIBUTE_TYPE)" "$(ATTRIBUTE_NAME)" > "$(1)" +} + +actions AddFileDataAttribute1 +{ + $(2[1]) -f $(2[3]) `cat $(2[2])` $(1) +} rule AddStringDataResource { @@ -37,7 +80,6 @@ actions together AddStringDataResource1 $(2[1]) -o "$(1)" $(RESOURCE_STRINGS) } - rule AddFileDataResource { # AddFileDataResource : : [ ]