[haiku-commits] r35668 - in haiku/trunk: . build/jam

  • From: mmlr@xxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 28 Feb 2010 19:54:16 +0100 (CET)

Author: mmlr
Date: 2010-02-28 19:54:16 +0100 (Sun, 28 Feb 2010)
New Revision: 35668
Changeset: http://dev.haiku-os.org/changeset/35668/haiku

Added:
   haiku/trunk/build/jam/AnybootImage
Modified:
   haiku/trunk/Jamfile
Log:
Adding buildsystem support for the "anyboot" images. They can be built using
the haiku-anyboot-image pseudo target. As I'm not too much at home with Jam I'd
appreciate any input. Especially for the TODO where removing the MBR using
RmTemps seems to cause a failure to get it built again every other time.


Modified: haiku/trunk/Jamfile
===================================================================
--- haiku/trunk/Jamfile 2010-02-28 18:51:16 UTC (rev 35667)
+++ haiku/trunk/Jamfile 2010-02-28 18:54:16 UTC (rev 35668)
@@ -191,6 +191,7 @@
 include [ FDirName $(HAIKU_BUILD_RULES_DIR) CDBootImage ] ;
 include [ FDirName $(HAIKU_BUILD_RULES_DIR) CDBootPPCImage ] ;
 include [ FDirName $(HAIKU_BUILD_RULES_DIR) HaikuCD ] ;
+include [ FDirName $(HAIKU_BUILD_RULES_DIR) AnybootImage ] ;
 
 # Check whether all requested optional packages do actually exist.
 local package ;

Added: haiku/trunk/build/jam/AnybootImage
===================================================================
--- haiku/trunk/build/jam/AnybootImage                          (rev 0)
+++ haiku/trunk/build/jam/AnybootImage  2010-02-28 18:54:16 UTC (rev 35668)
@@ -0,0 +1,45 @@
+rule BuildAnybootMBR binary : source {
+       MBR_SOURCE on $(binary) = $(source) ;
+
+       BuildAnybootMBR1 $(binary) ;
+}
+
+actions BuildAnybootMBR1 {
+       $(RM) $(1)
+       $(TARGET_CC) $(MBR_SOURCE) -o $(1) -nostdlib -Xlinker --oformat=binary 
-Xlinker -S -Xlinker -N -Xlinker "-e start" -Xlinker "-Ttext=0x600"
+}
+
+local baseMBR = base_mbr.bin ;
+local mbrSource = [ FDirName $(HAIKU_TOP) src bin writembr mbr.S ] ;
+
+BuildAnybootMBR $(baseMBR) : $(mbrSource) ;
+
+MakeLocate $(baseMBR) : $(HAIKU_OUTPUT_DIR) ;
+
+
+rule BuildAnybootImage anybootImage : mbrPart : isoPart : imageFile {
+       local anyboot = <build>anyboot ;
+
+       Depends $(anybootImage) : $(anyboot) ;
+       Depends $(anybootImage) : $(isoPart) ;
+       Depends $(anybootImage) : $(mbrPart) ;
+       Depends $(anybootImage) : $(imageFile) ;
+
+       BuildAnybootImage1 $(anybootImage) : $(anyboot) $(isoPart) $(mbrPart) 
$(imageFile) ;
+}
+
+actions BuildAnybootImage1 {
+       $(2[1]) $(1) $(2[2]) $(2[3]) $(2[4])
+}
+
+HAIKU_ANYBOOT_IMAGE = haiku-anyboot.image ;
+MakeLocate $(HAIKU_ANYBOOT_IMAGE) : $(HAIKU_OUTPUT_DIR) ;
+
+BuildAnybootImage $(HAIKU_ANYBOOT_IMAGE) : $(baseMBR) : $(HAIKU_CD_BOOT_IMAGE)
+       : $(HAIKU_IMAGE_NAME) ;
+
+# TODO: this one seems to cause the build to fail each other run (caching?)
+#RmTemps $(HAIKU_ANYBOOT_IMAGE) : $(baseMBR) ;
+
+NotFile haiku-anyboot-image ;
+Depends haiku-anyboot-image : $(HAIKU_ANYBOOT_IMAGE) ;


Other related posts:

  • » [haiku-commits] r35668 - in haiku/trunk: . build/jam - mmlr