xref: /haiku/build/jam/images/AnybootImage (revision ab4411e89a079bc0a40d901995f3418d998c51b3)
1# Set anyboot file name and directory defaults.
2HAIKU_ANYBOOT_NAME ?= $(HAIKU_DEFAULT_ANYBOOT_NAME) ;
3HAIKU_ANYBOOT_DIR ?= $(HAIKU_DEFAULT_ANYBOOT_DIR) ;
4HAIKU_ANYBOOT = $(HAIKU_ANYBOOT_NAME) ;
5HAIKU_ANYBOOT_LABEL ?= $(HAIKU_DEFAULT_ANYBOOT_LABEL) ;
6
7rule BuildAnybootMBR binary : source {
8	Depends $(binary) : $(source) ;
9
10	MBR_SOURCE on $(binary) = $(source) ;
11
12	BuildAnybootMBR1 $(binary) ;
13}
14
15actions BuildAnybootMBR1 {
16	$(RM) $(1)
17	$(HAIKU_NASM) -f bin $(MBR_SOURCE) -O5 -o $(1)
18}
19
20rule BuildAnybootImage anybootImage : mbrPart : isoPart : imageFile {
21	local anyboot = <build>anyboot ;
22
23	Depends $(anybootImage) : $(anyboot) ;
24	Depends $(anybootImage) : $(isoPart) ;
25	Depends $(anybootImage) : $(mbrPart) ;
26	Depends $(anybootImage) : $(imageFile) ;
27
28	BuildAnybootImage1 $(anybootImage) : $(anyboot) $(isoPart) $(mbrPart) $(imageFile) ;
29}
30
31actions BuildAnybootImage1 {
32	$(2[1]) $(1) $(2[2]) $(2[3]) $(2[4])
33}
34
35local baseMBR = base_mbr.bin ;
36local mbrSource = [ FDirName $(HAIKU_TOP) src bin writembr mbr.S ] ;
37BuildAnybootMBR $(baseMBR) : $(mbrSource) ;
38MakeLocate $(baseMBR) : $(HAIKU_OUTPUT_DIR) ;
39MakeLocate $(HAIKU_ANYBOOT) : $(HAIKU_ANYBOOT_DIR) ;
40BuildAnybootImage $(HAIKU_ANYBOOT) : $(baseMBR) : $(HAIKU_CD_BOOT_IMAGE)
41	: $(HAIKU_IMAGE_NAME) ;
42
43# TODO: this one seems to cause the build to fail each other run (caching?)
44#RmTemps $(HAIKU_ANYBOOT) : $(baseMBR) ;
45RmTemps $(HAIKU_ANYBOOT) : $(HAIKU_CD_BOOT_IMAGE) ;
46RmTemps $(HAIKU_ANYBOOT) : $(HAIKU_IMAGE_NAME) ;
47RmTemps $(HAIKU_ANYBOOT) : $(HAIKU_BOOT_FLOPPY) ;
48
49NotFile haiku-anyboot-image ;
50Depends haiku-anyboot-image : $(HAIKU_ANYBOOT) ;
51