Fixes for makefile

This commit is contained in:
Nero 2020-03-01 17:08:25 +00:00
parent bc238a3bf9
commit 79bedd9013

View File

@ -31,32 +31,34 @@ endif
default: fdimage.img default: fdimage.img
# Host utils # Host utils
utils/%: src/utils/%.c utils/%: %.c
mkdir -p utils mkdir -p utils
$(CC) -o $@ $< $(CC) -o $@ $<
cp437.bin: src/cp437.bmp utils/bmp2font cp437.bin: cp437.bmp utils/bmp2font
utils/bmp2font $< $@ utils/bmp2font $< $@
# BIOS option roms vga11.com: cp437.bin
rom/%.rom: rom/%.asm utils/fix-rom
$(NASM) $(NASM_ARGS) -o $@ $< && utils/fix-rom $@
# COM programs # COM programs
%.com: %.asm %.com: %.asm
$(NASM) $(NASM_ARGS) -DCOM -DBASE=0x0100 -o $@ $< $(NASM) $(NASM_ARGS) -DBASE=0x0100 -DCOM -o $@ $<
# Bootloaders, first sector on partition # Bootloaders, first sector on partition
%.bs: %.asm %.bs: %.asm
$(NASM) $(NASM_ARGS) -DBOOT -DBASE=0x7C00 -o $@ $< $(NASM) $(NASM_ARGS) -DBASE=0x7C00 -DBOOT -o $@ $<
: check boot signature : check boot signature
test "$$(echo $$(xxd -p -l 2 -s 510 pxe.bs))" == 55aa test "$$(echo $$(xxd -p -l 2 -s 510 pxe.bs))" == 55aa
# Network bootstrap protocol as used for PXE # Network bootstrap protocol as used for PXE
%.0: %.asm %.0: %.asm
$(NASM) $(NASM_ARGS) -DNBP -DBASE=0x7C00 -o $@ $< $(NASM) $(NASM_ARGS) -DBASE=0x7C00 -DNBP -o $@ $<
fdimage.img: boot/fat.bs $(BDOSIMG) $(BIOSIMG) $(DISTFILES) # BIOS option roms
%.rom: %.asm utils/fix-rom
$(NASM) $(NASM_ARGS) -DBASE=0x0000 -DROM -o $@ $< && utils/fix-rom $@
fdimage.img: fat.bs $(BDOSIMG) $(BIOSIMG) $(DISTFILES)
mformat -R 9 -C -i $@ -f $(FLOPPY) -B boot/fat.bs :: mformat -R 9 -C -i $@ -f $(FLOPPY) -B boot/fat.bs ::
dd if=$(BDOSIMG) bs=512 seek=1 count=4 conv=notrunc of=$@ dd if=$(BDOSIMG) bs=512 seek=1 count=4 conv=notrunc of=$@
dd if=$(BIOSIMG) bs=512 seek=5 count=4 conv=notrunc of=$@ dd if=$(BIOSIMG) bs=512 seek=5 count=4 conv=notrunc of=$@
@ -67,6 +69,7 @@ hdimage.img: boot/mbr.bs fdimage.img
clean: clean:
rm -f *.com *.bs *.0 *.lst *.img *.bin *.rom rm -f *.com *.bs *.0 *.lst *.img *.bin *.rom
rm -rf utils
qemu-floppy: fdimage.img $(ROMS) qemu-floppy: fdimage.img $(ROMS)
$(QEMU) $(QEMU_ARGS) -boot a -fda fdimage.img $(QEMU) $(QEMU_ARGS) -boot a -fda fdimage.img