From e49c2e20477359cfe0735183586ffbde371e240f Mon Sep 17 00:00:00 2001 From: pjht Date: Tue, 28 Mar 2023 10:44:29 -0500 Subject: [PATCH] Change to using tup build system --- .gitignore | 11 ++++++++--- Tupfile | 7 +++++++ Tupfile.ini | 0 build_rom.sh | 4 ---- rom.68k | 5 +++-- rom.ld | 4 +++- 6 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 Tupfile create mode 100644 Tupfile.ini delete mode 100755 build_rom.sh diff --git a/.gitignore b/.gitignore index 9cd5496..80a150d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ -*.bin -*.elf -*.o +##### TUP GITIGNORE ##### +##### Lines below automatically generated by Tup. +##### Do not edit. +.tup +/.gitignore +/rom.bin +/rom.elf +/rom.o diff --git a/Tupfile b/Tupfile new file mode 100644 index 0000000..f323c04 --- /dev/null +++ b/Tupfile @@ -0,0 +1,7 @@ +.gitignore +LDFLAGS = -z max-page-size=1 --orphan-handling=error -T rom.ld +ASFLAGS = -m68010 --register-prefix-optional + +: rom.68k |> m68k-elf-as $(ASFLAGS) -o %o %f |> rom.o +: rom.o |> m68k-elf-ld $(LDFLAGS) -o %o %f |> rom.elf +: rom.elf |> m68k-elf-objcopy -O binary %f %o |> rom.bin diff --git a/Tupfile.ini b/Tupfile.ini new file mode 100644 index 0000000..e69de29 diff --git a/build_rom.sh b/build_rom.sh deleted file mode 100755 index b6efc71..0000000 --- a/build_rom.sh +++ /dev/null @@ -1,4 +0,0 @@ -#! /bin/bash -x -m68k-elf-as -m68010 --register-prefix-optional -o rom.o rom.68k -m68k-elf-ld -z max-page-size=1 -T rom.ld -o rom.elf rom.o -m68k-elf-objcopy -O binary rom.elf rom.bin diff --git a/rom.68k b/rom.68k index 00b3261..db8ebd9 100644 --- a/rom.68k +++ b/rom.68k @@ -1,5 +1,6 @@ - .long fakestack, start -start: +.long fakestack, _start +.global _start +_start: move.w #0x1, d0 | Find the ROM card bra.b find_first_card romfindret: diff --git a/rom.ld b/rom.ld index 539193c..04fee54 100644 --- a/rom.ld +++ b/rom.ld @@ -1,5 +1,7 @@ +ENTRY(_start) + SECTIONS { . = 0x0; - _etext = .; .text : { *(.text) } + /DISCARD/ : { *(.data) *(.bss) } }