* 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
This commit is contained in:
+39
-3
@@ -216,10 +216,46 @@ rule ResComp
|
|||||||
ResComp1 $(1) : <build>rc $(2) ;
|
ResComp1 $(1) : <build>rc $(2) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Note: We pipe the file into the preprocessor, since *.rdef files are
|
# Note: We pipe the input files into the preprocessor, since *.rdef files are
|
||||||
# considered linker scripts.
|
# considered linker scripts, and thus we can use preprocessor features.
|
||||||
actions ResComp1
|
actions ResComp1
|
||||||
{
|
{
|
||||||
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
|
$(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 <attribute file> : <resource files> ;
|
||||||
|
#
|
||||||
|
# <attribute file> and <resource files> must be gristed.
|
||||||
|
# <resource files> 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) <build>resattr ;
|
||||||
|
LocalClean clean : $(attributeFile) ;
|
||||||
|
ResAttr1 $(attributeFile) : <build>resattr $(resourceFiles) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
actions ResAttr1
|
||||||
|
{
|
||||||
|
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
|
||||||
|
rm -f $(1)
|
||||||
|
$(2[1]) -o $(1) $(2[2-])
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user