#
# Makefile for building a Bacula Rescue CDROM or remastering
#   a CDROM or ISO image adding the Bacula files.
#

.PATH:		.


first_rule: all
dummy:

#-------------------------------------------------------------------------

# Make an iso boot image
iso:
	./build-iso

cdimage:
	makecdimage --type= --where=

# try booting it with qemu emulator
boot:
	qemu -cdrom bacula-knoppix.iso

initrd:
	./makeinitrd

kernel:
	./makekernel 

binaries:
	./makebinaries

static-bacula: dummy
	@(cd bacula; make copy-static-fd)

bacula: dummy
	@(cd bacula; make)

copy-bacula:
	cp -a bacula/ cdimage/

knoppix: environment fillknoppix iso

environment:
	./makeenv

fillknoppix:
	./copy-to-knoppix

#all:    kernel binaries bacula initrd iso
all:	bacula 

copy-static-fd: kernel binaries static-bacula initrd iso


# This needs to be customized for your burner.
burn:
	cdrecord dev=ATA:@CDSTL@ gracetime=2 fs=4096k driveropts=burnfree -v \
	 -useinfo speed=48 -dao -eject -pad -data "bacula-knoppix.iso"

# Blank the CDROM assuming it is +rw
blank:
	cdrecord dev=ATA:@CDSTL@ gracetime=2 -v blank=fast -useinfo speed=48

scan:
	cdrecord -scanbus

distclean:
clean:
#
# Clean out files that are rebuilt
#
	@rm -f bacula-knoppix.iso   
	@rm -rf roottree/bacula-*
	@(cd bacula; make distclean)
	@echo 
	@echo "   Please delete manually the REMASTER_PATH"
	@echo 
