From c0395c9a7efef4d4f235f694b72c25766eceea79 Mon Sep 17 00:00:00 2001 From: Zack Buhman Date: Mon, 2 Sep 2024 23:02:38 -0500 Subject: [PATCH] Makefile: add arm9/arm7 rules --- Makefile | 8 ++++++++ cartridge.lds | 11 ++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 0639b66..918c5d9 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,12 @@ OBJ = \ all: cartridge.bin +arm9/arm9.bin: + make -C arm9/ + +arm7/arm7.bin: + make -C arm7/ + cartridge.elf: $(OBJ) TARGET = arm-none-eabi- @@ -14,3 +20,5 @@ AARCH = -march=armv4t -mlittle-endian OBJARCH = -O elf32-littlearm -B armv4t LDSCRIPT = cartridge.lds include common.mk + +.PHONY: arm9/arm9.bin arm7/arm7.bin diff --git a/cartridge.lds b/cartridge.lds index 6b5d256..ec36204 100644 --- a/cartridge.lds +++ b/cartridge.lds @@ -17,23 +17,28 @@ SECTIONS . = 0x02000000; + _arm9 = .; + .text.arm9 ALIGN(4) : { - KEEP(arm9/arm9.bin.o(*)) + KEEP(*(.data.arm9/arm9.bin)) } AT>rom . = 0x02000000 + 0x8000; + _arm7 = .; + .text.arm7 ALIGN(4) : { - KEEP(arm7/arm7.bin.o(*)) + KEEP(*(.data.arm7/arm7.bin)) } AT>rom /DISCARD/ : { *(.glue_7) *(.glue_7t) *(.vfp11_veneer) *(.v4_bx) - *(.ARM.attributes) *(.iplt) *(.rel.iplt) *(.igot.plt) } + + INCLUDE "debug.lds" } /* header symbols */