Added small tool source_to_data, which takes an arbitrary data file and

generates a C source file defining an array variable containing the file's
data. DataFileToSourceFile is the respective jam rule.

The idea is to directly built the boot archive into the boot loader for
network booting (and thus avoiding to download it from somewhere). In
case of PXE this doesn't work, though, due to restrictions to the size
of the NBP. Maybe Open Firmware is less restrictive.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21602 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2007-07-15 00:04:27 +00:00
parent b9fcbf7c74
commit 1485d7a2d7
3 changed files with 142 additions and 0 deletions
+20
View File
@@ -253,3 +253,23 @@ actions CopySetHaikuRevision1
$(2[2]) $(1) ${revision}
}
rule DataFileToSourceFile sourceFile : dataFile : dataVariable : sizeVariable
{
sourceFile = [ FGristFiles $(sourceFile) ] ;
MakeLocateCommonPlatform $(sourceFile) ;
sizeVariable ?= $(dataVariable)Size ;
DATA_VARIABLE on $(sourceFile) = $(dataVariable) ;
SIZE_VARIABLE on $(sourceFile) = $(sizeVariable) ;
Depends $(sourceFile) : <build>data_to_source $(dataFile) ;
DataFileToSourceFile1 $(sourceFile) : <build>data_to_source $(dataFile) ;
LocalClean clean : $(sourceFile) ;
}
actions DataFileToSourceFile1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
$(2[1]) $(DATA_VARIABLE) $(SIZE_VARIABLE) $(2[2]) $(1)
}