rdos/Makefile

47 lines
1009 B
Makefile
Raw Normal View History

2019-09-16 12:26:48 +02:00
FLOPPY = 360
2019-03-31 15:22:24 +02:00
PROGRAMS = $(patsubst %.asm,%.com,$(wildcard programs/*.asm))
DISTFILES = kernel.com $(PROGRAMS)
QEMU_ARCH = $(shell uname -m)
QEMU = qemu-system-$(QEMU_ARCH)
ifdef KVM
QEMU_ARGS += --enable-kvm
endif
ifdef DEBUG
2019-09-07 01:42:39 +02:00
QEMU_ARGS += -option-rom debug.rom
DEBUGROM = debug.rom
endif
ifndef DISPLAY
QEMU_ARGS += --display curses
endif
.PHONY: default clean qemu-rom qemu-floppy
default: kernel.rom
kernel.com: kernel/*.asm lib/*.inc
nasm -s -o $@ -l kernel.lst -I lib -I kernel kernel/main.asm
2019-03-25 09:51:37 +01:00
2019-09-07 01:42:39 +02:00
debug.rom: debug/*.asm lib/*.inc
nasm -s -o $@ -I lib -I debug debug/main.asm && scripts/fix-rom.sh $@
floppy.bs: boot/fatvbr.asm
nasm -s -DCMDLINE='"KERNEL.COM"' -o $@ $<
2019-03-25 09:51:37 +01:00
programs/%.com: programs/%.asm
nasm -s -I lib -o $@ $<
fdimage.img: floppy.bs $(DISTFILES)
2019-09-16 12:26:48 +02:00
mformat -C -i $@ -f $(FLOPPY) -B floppy.bs ::
mcopy -i $@ $(DISTFILES) ::
clean:
rm -f *.com *.bin *.rom *.img *.log *.bs *.lst programs/*.com
2019-09-07 01:42:39 +02:00
qemu-floppy: fdimage.img $(DEBUGROM)
$(QEMU) $(QEMU_ARGS) -boot c -fda fdimage.img