2020-06-22 04:10:31 +00:00
|
|
|
# path to RETRO68
|
|
|
|
RETRO68=/Users/zane/Retro68-build/toolchain
|
|
|
|
|
|
|
|
PREFIX=$(RETRO68)/m68k-apple-macos
|
|
|
|
CC=$(RETRO68)/bin/m68k-apple-macos-gcc
|
2020-06-24 16:46:30 +00:00
|
|
|
LD=$(RETRO68)/bin/m68k-apple-macos-ld
|
2020-06-22 04:10:31 +00:00
|
|
|
OBJCOPY=$(RETRO68)/bin/m68k-apple-macos-objcopy
|
2020-06-22 20:02:27 +00:00
|
|
|
OBJDUMP=$(RETRO68)/bin/m68k-apple-macos-objdump
|
2020-06-22 04:10:31 +00:00
|
|
|
|
2020-06-24 21:13:57 +00:00
|
|
|
all: bin/rom.bin obj/rdisk.s obj/rdisk_reloc.s obj/rdisk_rel.sym obj/rdisk_abs.sym bin/rdisk_nonreloc.bin bin/rom_braun.bin obj/rdisk_braun.s obj/rdisk_braun_reloc.s obj/rdisk_braun_rel.sym obj/rdisk_braun_abs.sym bin/rdisk_braun_nonreloc.bin bin/rom_braun_oldbin.bin
|
2020-06-22 04:10:31 +00:00
|
|
|
|
|
|
|
obj:
|
|
|
|
mkdir obj
|
|
|
|
|
|
|
|
bin:
|
|
|
|
mkdir bin
|
|
|
|
|
|
|
|
obj/rdisk.o: rdisk.c obj
|
|
|
|
$(CC) -c -O1 $< -o $@
|
|
|
|
|
2020-06-24 16:46:30 +00:00
|
|
|
obj/rdisk_reloc.o: obj obj/rdisk.o
|
2020-06-24 18:10:00 +00:00
|
|
|
$(LD) -Ttext=40851D70 -o $@ obj/rdisk.o
|
2020-06-24 16:46:30 +00:00
|
|
|
|
2020-06-22 20:02:27 +00:00
|
|
|
obj/rdisk.s: obj obj/rdisk.o
|
2020-06-24 16:46:30 +00:00
|
|
|
$(OBJDUMP) -d obj/rdisk.o > $@
|
|
|
|
|
|
|
|
obj/rdisk_reloc.s: obj obj/rdisk_reloc.o
|
|
|
|
$(OBJDUMP) -d obj/rdisk_reloc.o > $@
|
|
|
|
|
|
|
|
obj/rdisk_rel.sym: obj obj/rdisk.o
|
|
|
|
$(OBJDUMP) -t obj/rdisk.o > $@
|
|
|
|
|
|
|
|
obj/rdisk_abs.sym: obj obj/rdisk_reloc.o
|
|
|
|
$(OBJDUMP) -t obj/rdisk_reloc.o > $@
|
|
|
|
|
|
|
|
bin/rdisk.bin: bin obj/rdisk_reloc.o
|
|
|
|
$(OBJCOPY) -O binary obj/rdisk_reloc.o $@
|
2020-06-22 20:02:27 +00:00
|
|
|
|
2020-06-24 16:46:30 +00:00
|
|
|
bin/rdisk_nonreloc.bin: bin obj/rdisk.o
|
2020-06-22 04:10:31 +00:00
|
|
|
$(OBJCOPY) -O binary obj/rdisk.o $@
|
|
|
|
|
2020-06-24 20:58:40 +00:00
|
|
|
|
|
|
|
obj/rdisk_braun.o: rdisk_braun.c obj
|
|
|
|
$(CC) -c -O1 $< -o $@
|
|
|
|
|
|
|
|
obj/rdisk_braun_reloc.o: obj obj/rdisk_braun.o
|
|
|
|
$(LD) -Ttext=40851D70 -o $@ obj/rdisk_braun.o
|
|
|
|
|
|
|
|
obj/rdisk_braun.s: obj obj/rdisk_braun.o
|
|
|
|
$(OBJDUMP) -d obj/rdisk_braun.o > $@
|
|
|
|
|
|
|
|
obj/rdisk_braun_reloc.s: obj obj/rdisk_braun_reloc.o
|
|
|
|
$(OBJDUMP) -d obj/rdisk_braun_reloc.o > $@
|
|
|
|
|
|
|
|
obj/rdisk_braun_rel.sym: obj obj/rdisk_braun.o
|
|
|
|
$(OBJDUMP) -t obj/rdisk_braun.o > $@
|
|
|
|
|
|
|
|
obj/rdisk_braun_abs.sym: obj obj/rdisk_braun_reloc.o
|
|
|
|
$(OBJDUMP) -t obj/rdisk_braun_reloc.o > $@
|
|
|
|
|
|
|
|
bin/rdisk_braun.bin: bin obj/rdisk_braun_reloc.o
|
|
|
|
$(OBJCOPY) -O binary obj/rdisk_braun_reloc.o $@
|
|
|
|
|
|
|
|
bin/rdisk_braun_nonreloc.bin: bin obj/rdisk_braun.o
|
|
|
|
$(OBJCOPY) -O binary obj/rdisk_braun.o $@
|
|
|
|
|
|
|
|
|
2020-06-24 21:13:57 +00:00
|
|
|
bin/rom.bin: baserom.bin bin bin/rdisk.bin obj/rdisk_rel.sym
|
|
|
|
cp baserom.bin $@ # copy base rom
|
|
|
|
cat bin/rdisk.bin | dd of=$@ bs=1 seek=335266 skip=50 conv=notrunc # Copy driver code
|
|
|
|
printf '\x78' | dd of=$@ bs=1 seek=335168 count=1 conv=notrunc # Set resource flags
|
|
|
|
printf '\x4F' | dd of=$@ bs=1 seek=335216 count=1 conv=notrunc # Set driver flags
|
|
|
|
cat obj/rdisk_rel.sym | grep "Open" | cut -c5-8 | xxd -r -p - | dd of=$@ bs=1 seek=335224 count=2 conv=notrunc
|
|
|
|
cat obj/rdisk_rel.sym | grep "Prime" | cut -c5-8 | xxd -r -p - | dd of=$@ bs=1 seek=335226 count=2 conv=notrunc
|
|
|
|
cat obj/rdisk_rel.sym | grep "Control" | cut -c5-8 | xxd -r -p - | dd of=$@ bs=1 seek=335228 count=2 conv=notrunc
|
|
|
|
cat obj/rdisk_rel.sym | grep "Status" | cut -c5-8 | xxd -r -p - | dd of=$@ bs=1 seek=335230 count=2 conv=notrunc
|
|
|
|
cat obj/rdisk_rel.sym | grep "Close" | cut -c5-8 | xxd -r -p - | dd of=$@ bs=1 seek=335232 count=2 conv=notrunc
|
|
|
|
dd if=RDisk1M5 of=$@ bs=1024 seek=512 count=1536 conv=notrunc # copy disk image
|
2020-06-22 20:02:27 +00:00
|
|
|
|
2020-06-24 20:58:40 +00:00
|
|
|
bin/rom_braun.bin: bin bin/rdisk_braun.bin obj/rdisk_braun_rel.sym
|
2020-06-24 21:13:57 +00:00
|
|
|
cp baserom_braun_2m_0.9.bin $@ # copy base rom
|
|
|
|
cat bin/rdisk_braun.bin | dd of=$@ bs=1 seek=335266 skip=50 conv=notrunc # Copy driver code
|
|
|
|
printf '\x78' | dd of=$@ bs=1 seek=335168 count=1 conv=notrunc # Set resource flags
|
|
|
|
printf '\x4F' | dd of=$@ bs=1 seek=335216 count=1 conv=notrunc # Set driver flags
|
|
|
|
cat obj/rdisk_braun_rel.sym | grep "Open" | cut -c5-8 | xxd -r -p - | dd of=$@ bs=1 seek=335224 count=2 conv=notrunc
|
|
|
|
cat obj/rdisk_braun_rel.sym | grep "Prime" | cut -c5-8 | xxd -r -p - | dd of=$@ bs=1 seek=335226 count=2 conv=notrunc
|
|
|
|
cat obj/rdisk_braun_rel.sym | grep "Control" | cut -c5-8 | xxd -r -p - | dd of=$@ bs=1 seek=335228 count=2 conv=notrunc
|
|
|
|
cat obj/rdisk_braun_rel.sym | grep "Status" | cut -c5-8 | xxd -r -p - | dd of=$@ bs=1 seek=335230 count=2 conv=notrunc
|
|
|
|
cat obj/rdisk_braun_rel.sym | grep "Close" | cut -c5-8 | xxd -r -p - | dd of=$@ bs=1 seek=335232 count=2 conv=notrunc
|
|
|
|
dd if=RDisk1M5 of=$@ bs=1024 seek=512 count=1536 conv=notrunc # copy disk image
|
|
|
|
|
|
|
|
bin/rom_braun_oldbin.bin: bin bin/rdisk_braun.bin obj/rdisk_braun_rel.sym
|
|
|
|
cp baserom_braun_2m_0.9.bin $@ # copy base rom
|
|
|
|
dd if=RDisk1M5 of=$@ bs=1024 seek=512 count=1536 conv=notrunc # copy disk image
|
2020-06-24 20:58:40 +00:00
|
|
|
|
2020-06-22 04:10:31 +00:00
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -fr bin obj
|