diff --git a/Makefile b/Makefile index 2adb2f3..651ad7e 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ FLOPPY = 360 -PROGRAMS = $(patsubst %.asm,%.com,$(wildcard programs/*.asm)) +PROGRAMS = $(patsubst %.asm,%.com,$(wildcard com/*.asm)) DISTFILES = rdos.bin $(PROGRAMS) ROMS = @@ -30,18 +30,22 @@ endif default: fdimage.img +# Kernel image rdos.bin: kernel/*.asm lib/*.asm $(NASM) $(NASM_ARGS) -o $@ -I kernel kernel/main.asm +# Boot sectors boot/%.bs: boot/%.asm $(NASM) $(NASM_ARGS) -DFLOPPY=$(FLOPPY) -o $@ $< -programs/%.com: programs/%.asm - $(NASM) $(NASM_ARGS) -o $@ $< - +# BIOS option roms rom/%.rom: rom/%.asm $(NASM) $(NASM_ARGS) -o $@ $< && utils/fix-rom.sh $@ +# Regular COM programs +com/%.com: com/%.asm + $(NASM) $(NASM_ARGS) -o $@ $< + fdimage.img: boot/fat.bs $(DISTFILES) mformat -C -i $@ -f $(FLOPPY) -B boot/fat.bs :: mcopy -i $@ $(DISTFILES) :: @@ -51,7 +55,7 @@ hdimage.img: boot/mbr.bs fdimage.img clean: find -name '*.lst' -delete - rm -f $$(cat .gitignore) programs/*.com boot/*.bs rom/*.rom utils/emul + rm -f $$(cat .gitignore) boot/*.bs com/*.com rom/*.rom utils/emul qemu-floppy: fdimage.img $(ROMS) $(QEMU) $(QEMU_ARGS) -boot c -fda fdimage.img diff --git a/programs/asm86.asm b/com/asm86.asm similarity index 100% rename from programs/asm86.asm rename to com/asm86.asm diff --git a/programs/hello.asm b/com/hello.asm similarity index 100% rename from programs/hello.asm rename to com/hello.asm