a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# -*- makefile -*- : Force emacs to use Makefile mode
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# The i386 linker script
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Stop ld from complaining about our customised linker script
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncLDFLAGS += -N --no-check-sections
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# pcbios specific drivers
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Media types.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncMEDIA += rom
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncMEDIA += mrom
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncMEDIA += pxe
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncMEDIA += kpxe
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncMEDIA += kkpxe
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncMEDIA += kkkpxe
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncMEDIA += lkrn
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncMEDIA += dsk
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncMEDIA += nbi
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncMEDIA += raw
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncMEDIA += exe
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Padding rules
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncPAD_rom = $(PERL) $(PADIMG) --blksize=512 --byte=0xff $@
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncPAD_mrom = $(PAD_rom)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncPAD_dsk = $(PERL) $(PADIMG) --blksize=512 $@
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncPAD_hd = $(PERL) $(PADIMG) --blksize=32768 $@
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncPAD_exe = $(PERL) $(PADIMG) --blksize=512 $@
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Finalisation rules
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncFINALISE_rom = $(PERL) $(FIXROM) $@
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncFINALISE_mrom = $(FINALISE_rom)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# rule to make a non-emulation ISO boot image
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncNON_AUTO_MEDIA += iso
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(QM)$(ECHO) " [GENISO] $@"
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(Q)ISOLINUX_BIN=$(ISOLINUX_BIN) bash util/geniso $@ $<
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# rule to make a floppy emulation ISO boot image
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncNON_AUTO_MEDIA += liso
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(QM)$(ECHO) " [GENLISO] $@"
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(Q)bash util/genliso $@ $<
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# rule to make a syslinux floppy image (mountable, bootable)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncNON_AUTO_MEDIA += sdsk
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(QM)$(ECHO) " [GENSDSK] $@"
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(Q)bash util/gensdsk $@ $<
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# rule to write disk images to /dev/fd0
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncNON_AUTO_MEDIA += fd0
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(QM)$(ECHO) " [DD] $@"
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(Q)dd if=$< bs=512 conv=sync of=/dev/fd0
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Special target for building Master Boot Record binary
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(QM)$(ECHO) " [OBJCOPY] $@"
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(Q)$(OBJCOPY) -O binary $< $@
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# rule to make a USB disk image
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(QM)$(ECHO) " [OBJCOPY] $@"
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(Q)$(OBJCOPY) -O binary $< $@
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncNON_AUTO_MEDIA += usb
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync%usb: $(BIN)/usbdisk.bin %hd
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(QM)$(ECHO) " [FINISH] $@"
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(Q)cat $^ > $@
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync# Padded floppy image (e.g. for iLO)
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncNON_AUTO_MEDIA += pdsk
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync%pdsk : %dsk
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(Q)cp $< $@
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync $(Q)$(PADIMG) --blksize=1474560 $@