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 extras ] ;
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	SEARCH on $(chrpscript) = [ FDirName $(HAIKU_TOP) data boot openfirmware ] ;
28	SEARCH on $(hfsmaps) = [ FDirName $(HAIKU_TOP) data boot openfirmware ] ;
29
30	BuildCDBootPPCImage $(HAIKU_CD_BOOT_IMAGE) : $(hfsmaps)
31		: $(elfloader) : $(coffloader) : $(chrpscript) : $(extras) ;
32} else {
33	# For other platforms, we have to check which bootloader is used. There
34	# can be multiple ones, making this a bit confusing.
35	for platform in [ MultiBootSubDirSetup ] {
36		on $(platform) {
37			if $(TARGET_BOOT_PLATFORM) = efi {
38				local efiLoader = haiku_loader.efi ;
39				local efiPartition = esp.image ;
40				MakeLocateDebug $(efiPartition) : system boot ;
41				BuildEfiSystemPartition $(efiPartition) : $(efiLoader) ;
42
43				BuildCDBootImageEFI $(HAIKU_CD_BOOT_IMAGE) : $(HAIKU_BOOT_FLOPPY)
44					: $(efiPartition) : $(extras) ;
45			}
46		}
47	}
48}
49
50NotFile haiku-boot-cd ;
51Depends haiku-boot-cd : $(HAIKU_CD_BOOT_IMAGE) ;
52