Skip to content

Commit

Permalink
Added rule AddFileDataAttribute to add an attribute to a file. The
Browse files Browse the repository at this point in the history
attribute value is read from another file.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21166 a95241bf-73f2-0310-859d-f6bbb57e9c96
  • Loading branch information
weinhold committed May 18, 2007
1 parent 6dcd0cc commit b696213
Showing 1 changed file with 43 additions and 1 deletion.
44 changes: 43 additions & 1 deletion build/jam/BeOSRules
Original file line number Diff line number Diff line change
@@ -1,5 +1,48 @@
# BeOS specific rules

rule AddFileDataAttribute target : attrName : attrType : dataFile
{
# AddFileAttribute <target> : <attrName> : <attrType> : <dataFile> ;
# Adds a single attribute to a file, retrieving the attribute data from
# a separate file.
# <target>: The file to which the attribute shall be added.
# <attrName>: The name of the attribute.
# <attrType>: Attribute type as supported by addattr (string, int, etc.)
# <dataFile>: 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) : <build>addattr $(attrMetaFile) $(dataFile) ;
AddFileDataAttribute1 $(target)
: <build>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
{
Expand Down Expand Up @@ -37,7 +80,6 @@ actions together AddStringDataResource1
$(2[1]) -o "$(1)" $(RESOURCE_STRINGS)
}


rule AddFileDataResource
{
# AddFileDataResource <target> : <resourceID> : [ <dataFile> ]
Expand Down

0 comments on commit b696213

Please sign in to comment.