# ---------------------------------------------------------------------------
# Makefile for creating bootable CD-Rom's           Version 1.5
#
# Created by Bart Lagerweij                         http://www.nu2.nu/bootcd
# ---------------------------------------------------------------------------
#
#
# Custom variables below, you can change them, but don't disabled them
# ---------------------------------------------------------------------------
cdrdevice     :=0,5,0
isofile       :=c:/tmp/mycd.iso
#
#
# Custom variables below, you can change them,
# you can disable by putting a '#' in front of it.
# ---------------------------------------------------------------------------
verbose       :=on
systemid      :="PC with 'el-torito' BIOS"
volumeid      :="Bootable CD"
volsetid      :="Set 1"
preparer      :="Prepared by Bart Lagerweij"
publisher     :="NU2 Productions - http://www.nu2.nu"
applicationid :="Created 'Barts way' using MKISOFS/MKBOOTCD/CDRECORD"
#
# Description of "standard custom variables"
# ---------------------------------------------------------------------------
# cdrdevice:=host,targetid,lun
#   Set the device for cdrecord. Run cdrecord -scanbus for devicelist.
# isofile:=file
#   Filename for the (temporarily) ISO image to be used. Use forward 
#   slashes!
# verbose:=[on|off]
#   Puts mkisofs and cdrecord in verbose mode (talk more).
# systemid:=string
#   What system is this CD-ROM meant for. Use double quote's. Max. 32 char.
# volumeid:=string
#   Set volume ID. Use double quote's. Max. 32 char.
# volsetid:=string
#   Set volume set ID. Use double quote's. Max. 128 char.
# preparer:=string
#   Set volume preparer. Use double quote's. Max. 128 char.
# publisher:=string
#   Set volume publisher. Use double quote's. Max. 128 char.
# applicationid:=string
#   Set application ID. Use double quote's. Max. 128 char.
#
# Advanced custom variables are below
# ---------------------------------------------------------------------------
#
# mkisofs command-line arguments
mkisofsargs:=-N -l -no-iso-translate -relaxed-filenames
#
# cdrecord command-line arguments
cdrecordargs:=-data -eject speed=4
#
# You should not mess around with the lines below here !
# ---------------------------------------------------------------------------
#
# To prevent "/bin/sh.exe: Command not found" errors
# when files are not on the first HD...
# we'll set the shell to "sh", this way make.exe will search the
# path environment variable (the right way...)
SHELL:=sh.exe
#
ifdef verbose
	ifeq ($(verbose),on)
		mkisofsargs+= -v
		cdrecordargs+= -v
	endif
endif

ifdef systemid
	mkisofsargs+= -sysid $(systemid)
endif

ifdef volumeid
	mkisofsargs+= -volid $(volumeid)
endif

ifdef volsetid
	mkisofsargs+= -volset $(volsetid)
endif

ifdef preparer
	mkisofsargs+= -p $(preparer)
endif

ifdef publisher
	mkisofsargs+= -P $(publisher)
endif

ifdef applicationid
	mkisofsargs+= -A $(applicationid)
endif

.PHONY : bootcd

bootcd:
#
# For "auto-blank" before burning on a CDRW, uncomment the line below !
#	cdrecord.exe dev=$(cdrdevice) blank=fast
#
	mkisofs.exe $(mkisofsargs) -o $(isofile) disk1
	mkbootcd.exe $(isofile) - < mkbootcd.txt
	cdrecord.exe dev=$(cdrdevice) $(cdrecordargs) $(isofile)
#
# END of makefile
