Browse Source

Create MakeMsxDsk.mk, Issue #645

This makefile subsumes all the work done in BuildMsxDsk.cmd, BuildMsxDsk.ps1.

Thanks and credit to @b3rendsh.

Co-Authored-By: H.J.Berends <112617808+b3rendsh@users.noreply.github.com>
pull/653/head
Wayne Warthen 2 weeks ago
parent
commit
dc1a4a6c9f
No known key found for this signature in database GPG Key ID: 8B34ED29C07EEB0A
  1. 43
      Source/MSX/MakeMsxDsk.mk

43
Source/MSX/MakeMsxDsk.mk

@ -0,0 +1,43 @@
#
# this makefile subsumes all the work done in BuildMsxDsk.cmd, BuildMsxDsk.ps1
#
# You may need to install packages: unzip, mtools
#
# Variables
DEST = ../../Binary
OBJECTS = $(DEST)/msx_combo.dsk
MTOOLS = mtools
# mtools settings
export MTOOLS_SKIP_CHECK := 1
# Define the 16 slices required for the RomWBW partition
SLICES = cpm22 zsdos nzcom cpm3 zpm3 wp games msx \
blank blank blank blank blank blank blank blank
# Resolve full paths for the slice images
SLICE_FILES = $(foreach s,$(SLICES),$(DEST)/hd1k_$(s).img)
# Default target
all: $(OBJECTS)
# Rule to create the final .dsk file
$(OBJECTS): msximg/msx_sys.dsk
@echo "Generating $@..."
cat msximg/msx_mbr.dat $(SLICE_FILES) msximg/msx_sys.dsk msximg/msx_data.dsk > $@
# Rule to populate the FAT system partition
msximg/msx_sys.dsk: msximg.zip $(DEST)/MSX_std.rom
unzip -o msximg.zip -d msximg
$(MTOOLS) -c mcopy -i $@ -omv d_fat/* ::
$(MTOOLS) -c mcopy -i $@ -omv $(DEST)/MSX_std.rom ::MSX-STD.ROM
$(MTOOLS) -c mcopy -i $@ -omv $(DEST)/msx-ldr.com ::MSX-LDR.COM
$(MTOOLS) -c mcopy -i $@ -omv $(DEST)/Apps/reboot.com ::REBOOT.COM
# Cleanup build artifacts
clean:
rm -f $(OBJECTS)
rm -rf msximg
.PHONY: all clean
Loading…
Cancel
Save