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 */