diff --git a/Makefile b/Makefile index c2c2836..f2cdc9a 100644 --- a/Makefile +++ b/Makefile @@ -2,17 +2,19 @@ FLOPPY = 360 PROGRAMS = $(patsubst %.asm,%.com,$(wildcard programs/*.asm)) DISTFILES = kernel.com $(PROGRAMS) +ROMS = QEMU_ARCH = $(shell uname -m) QEMU = qemu-system-$(QEMU_ARCH) +QEMU_ARGS = $(addprefix --option-rom ,$(ROMS)) + ifdef KVM QEMU_ARGS += --enable-kvm endif ifdef DEBUG -QEMU_ARGS += -option-rom debug.rom -DEBUGROM = debug.rom +ROMS += debug.rom endif ifndef DISPLAY @@ -48,8 +50,8 @@ hdimage.img: boot/mbr.bs fdimage.img clean: rm -f *.com *.bin *.rom *.img *.log *.bs *.lst programs/*.com -qemu-floppy: fdimage.img $(DEBUGROM) +qemu-floppy: fdimage.img $(ROMS) $(QEMU) $(QEMU_ARGS) -boot c -fda fdimage.img -qemu-hdd: hdimage.img $(DEBUGROM) +qemu-hdd: hdimage.img $(ROMS) $(QEMU) $(QEMU_ARGS) -boot c -hda hdimage.img