Generate lst files for every binary when in debug mode

This commit is contained in:
Nero 2019-09-28 13:37:47 +00:00
parent cc28b42897
commit f75cc3b620

View File

@ -6,15 +6,18 @@ ROMS =
QEMU_ARCH = $(shell uname -m) QEMU_ARCH = $(shell uname -m)
QEMU = qemu-system-$(QEMU_ARCH) QEMU = qemu-system-$(QEMU_ARCH)
QEMU_ARGS = $(addprefix --option-rom ,$(ROMS)) QEMU_ARGS = $(addprefix --option-rom ,$(ROMS))
NASM = nasm
NASM_ARGS = -s -I lib
ifdef KVM ifdef KVM
QEMU_ARGS += --enable-kvm QEMU_ARGS += --enable-kvm
endif endif
ifdef DEBUG ifdef DEBUG
ROMS += debug.rom ROMS += debug.rom
NASM_ARGS += -l $(basename $@).lst
endif endif
ifndef DISPLAY ifndef DISPLAY
@ -23,22 +26,22 @@ endif
.PHONY: default clean qemu-rom qemu-floppy .PHONY: default clean qemu-rom qemu-floppy
default: rdos.sys default: fdimage.img
rdos.sys: kernel/*.asm lib/*.asm 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 rconfig.sys: config.txt
cp $< $@ cp $< $@
debug.rom: debug/*.asm lib/*.asm 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 boot/%.bs: boot/%.asm
nasm -s -DFLOPPY=$(FLOPPY) -o $@ $< $(NASM) $(NASM_ARGS) -DFLOPPY=$(FLOPPY) -o $@ $<
programs/%.com: programs/%.asm programs/%.com: programs/%.asm
nasm -s -I lib -o $@ $< $(NASM) $(NASM_ARGS) -o $@ $<
fdimage.img: boot/fat.bs $(DISTFILES) fdimage.img: boot/fat.bs $(DISTFILES)
mformat -C -i $@ -f $(FLOPPY) -B boot/fat.bs :: 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 >$@ cat boot/mbr.bs fdimage.img >$@
clean: clean:
find -name '*.lst' -delete
rm -f $$(cat .gitignore) programs/*.com boot/*.bs rm -f $$(cat .gitignore) programs/*.com boot/*.bs
qemu-floppy: fdimage.img $(ROMS) qemu-floppy: fdimage.img $(ROMS)