src = $(wildcard src/*.asm) data = data/sprsheet.inc bin = game QEMU_FLAGS = -fda floppy.img -serial file:serial.log -soundhw sb16 -d guest_errors .PHONY: all all: floppy.img bootldr: src/boot/boot.asm $(bin) nasm -o $@ -f bin -DBINSIZE=`ls -l $(bin) | awk '{print $$5}'` $< $(bin): $(src) $(data) nasm -o $@ -f bin -i src/ src/main.asm boot.img: bootldr $(bin) cat $^ >$@ floppy.img: boot.img dd of=$@ if=/dev/zero bs=512 count=2880 dd of=$@ if=$< bs=1 conv=notrunc data/sprsheet.inc: data/sprsheet.png img2tiles -o $@ -n -t 32x32 $< .PHONY: clean clean: rm -f $(bin) bootldr floppy.img boot.img .PHONY: disasm disasm: bootldr.disasm $(bin).disasm bootldr.disasm: bootldr ndisasm -b 16 -o 7c00h $< >$@ $(bin).disasm: $(bin) ndisasm -b 16 -o 7e00h $< >$@ .PHONY: run run: $(bin) qemu-system-i386 $(QEMU_FLAGS) .PHONY: debug debug: $(bin) qemu-system-i386 $(QEMU_FLAGS) -s -S