xref: /haiku/build/jam/images/CDBootImage (revision 21258e2674226d6aa732321b6f8494841895af5f)
1# This file defines what ends up in the CD boot image and it executes the
2# rules building the image.
3
4#HAIKU_BOOT_FLOPPY = haiku-boot-floppy.image ;
5#MakeLocate $(HAIKU_BOOT_FLOPPY) : $(HAIKU_OUTPUT_DIR) ;
6
7# CD image target
8HAIKU_CD_BOOT_IMAGE = haiku-boot-cd.iso ;
9MakeLocate $(HAIKU_CD_BOOT_IMAGE) : $(HAIKU_OUTPUT_DIR) ;
10
11# the pseudo target all archive contents is attached to
12NotFile $(HAIKU_CD_BOOT_IMAGE_CONTAINER_NAME) ;
13
14# common extra files to put on the boot iso
15local extras = README.html ;
16SEARCH on $(extras) = [ FDirName $(HAIKU_TOP) data boot_cd ] ;
17
18if $(TARGET_ARCH) = ppc {
19	local elfloader = boot_loader_openfirmware ;
20	local coffloader = haiku_loader.openfirmware ;
21
22	# OpenFirmware / Mac boot support files:
23	# CHRP script
24	local chrpscript = ofboot.chrp ;
25	# HFS creator and application type mapping for mkisofs
26	local hfsmaps = hfs.map ;
27
28	SEARCH on $(chrpscript) $(hfsmaps) $(extras)
29		= [ FDirName $(HAIKU_TOP) data boot_cd ] ;
30
31	BuildCDBootPPCImage $(HAIKU_CD_BOOT_IMAGE) : $(hfsmaps)
32		: $(elfloader) : $(coffloader) : $(chrpscript) : $(extras) ;
33} else {
34	# For other platforms, we have to check which bootloader is used. There
35	# can be multiple ones, making this a bit confusing.
36	for platform in [ MultiBootSubDirSetup ] {
37		on $(platform) {
38			if $(TARGET_BOOT_PLATFORM) = efi {
39				local efiLoader = haiku_loader.efi ;
40				local efiPartition = esp.image ;
41				MakeLocate $(efiPartition) : $(HAIKU_OUTPUT_DIR) ;
42				BuildEfiSystemPartition $(efiPartition) : $(efiLoader) ;
43
44				BuildCDBootImage $(HAIKU_CD_BOOT_IMAGE) : $(HAIKU_BOOT_FLOPPY)
45					: $(efiPartition) : $(extras) ;
46
47			} else if $(HAIKU_ANYBOOT_LEGACY) = 1 {
48				BuildCDBootImage $(HAIKU_CD_BOOT_IMAGE) : $(HAIKU_BOOT_FLOPPY) :
49					: $(extras) ;
50			}
51		}
52	}
53}
54
55NotFile haiku-boot-cd ;
56Depends haiku-boot-cd : $(HAIKU_CD_BOOT_IMAGE) ;
57