From f75cc3b62016132b7cabb804d57d6655d17ce0f6 Mon Sep 17 00:00:00 2001 From: Ain <41307858+nero@users.noreply.github.com> Date: Sat, 28 Sep 2019 13:37:47 +0000 Subject: [PATCH] Generate lst files for every binary when in debug mode --- Makefile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index b953a09..c392dc5 100644 --- a/Makefile +++ b/Makefile @@ -6,15 +6,18 @@ ROMS = QEMU_ARCH = $(shell uname -m) QEMU = qemu-system-$(QEMU_ARCH) - QEMU_ARGS = $(addprefix --option-rom ,$(ROMS)) +NASM = nasm +NASM_ARGS = -s -I lib + ifdef KVM QEMU_ARGS += --enable-kvm endif ifdef DEBUG ROMS += debug.rom +NASM_ARGS += -l $(basename $@).lst endif ifndef DISPLAY @@ -23,22 +26,22 @@ endif .PHONY: default clean qemu-rom qemu-floppy -default: rdos.sys +default: fdimage.img rdos.sys: kernel/*.asm lib/*.asm - nasm -s -o $@ -l kernel.lst -I lib -I kernel kernel/main.asm + $(NASM) $(NASM_ARGS) -o $@ -I kernel kernel/main.asm rconfig.sys: config.txt cp $< $@ debug.rom: debug/*.asm lib/*.asm - nasm -s -o $@ -I lib -I debug debug/main.asm && scripts/fix-rom.sh $@ + $(NASM) $(NASM_ARGS) -o $@ -I debug debug/main.asm && scripts/fix-rom.sh $@ boot/%.bs: boot/%.asm - nasm -s -DFLOPPY=$(FLOPPY) -o $@ $< + $(NASM) $(NASM_ARGS) -DFLOPPY=$(FLOPPY) -o $@ $< programs/%.com: programs/%.asm - nasm -s -I lib -o $@ $< + $(NASM) $(NASM_ARGS) -o $@ $< fdimage.img: boot/fat.bs $(DISTFILES) mformat -C -i $@ -f $(FLOPPY) -B boot/fat.bs :: @@ -48,6 +51,7 @@ hdimage.img: boot/mbr.bs fdimage.img cat boot/mbr.bs fdimage.img >$@ clean: + find -name '*.lst' -delete rm -f $$(cat .gitignore) programs/*.com boot/*.bs qemu-floppy: fdimage.img $(ROMS)