From dc1a4a6c9f5b2938ad110363ac5a83c44b48f811 Mon Sep 17 00:00:00 2001 From: Wayne Warthen Date: Tue, 13 Jan 2026 18:55:08 -0800 Subject: [PATCH] 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> --- Source/MSX/MakeMsxDsk.mk | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Source/MSX/MakeMsxDsk.mk diff --git a/Source/MSX/MakeMsxDsk.mk b/Source/MSX/MakeMsxDsk.mk new file mode 100644 index 00000000..066afb68 --- /dev/null +++ b/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