all: bootfloppy

bootfloppy: bootsect
	dd if=/dev/zero of=/tmp/blocks bs=512 count=2879
	cat bootsect /tmp/blocks > bootfloppy
	rm /tmp/blocks
clean distclean::
	rm -f bootfloppy

bootsect: bootsect.o
	$(LD) -Ttext 0x0 -s --oformat binary -o $@ $<
clean distclean::
	rm -f bootsect

bootsect.o: bootsect.s
	$(AS) -o $@ $<
clean distclean::
	rm -f bootsect.o

bootsect.s: bootsect.S Makefile
	$(CPP) -traditional $< -o $@
clean distclean::
	rm -f bootsect.s
