From e1659ecd41dfac70eb021c0f5fe983ed6f043433 Mon Sep 17 00:00:00 2001 From: luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com> Date: Tue, 3 Jul 2018 17:07:05 -0400 Subject: Introduce linkerscript. Addresses of sections will now be added to the linkerscript via `org`, and the section name will be the path/to/file. If there is more than one section in the file, then add a @SectionName after the path/to/file to describe the section. --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index dd6c27a..129ea09 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,8 @@ sort_sym := tools/sort_symfile.sh RGBASMFLAGS := -h -E -i $(BUILD)/ -DGOLD -DDEBUG=1 tools/gfx := -ROM := pokegold-spaceworld.gb +ROMNAME := pokegold-spaceworld +ROM := $(ROMNAME).gb BASEROM := baserom.gb SHIM := shim.sym CORRECTEDROM := $(ROM:%.gb=%-correctheader.gb) @@ -55,7 +56,7 @@ coverage: $(ROM:.gb=.map) tools/disasm_coverage.py $(PYTHON) tools/disasm_coverage.py -m $< -b 0x40 .PHONY: linkerscript -linkerscript: $(ROM:.gb=.link) +linkerscript: $(ROMNAME)-gen.link %.link: %.map tools/map2link.py $(PYTHON3) tools/map2link.py $< $@ @@ -68,7 +69,7 @@ $(CORRECTEDROM): %-correctheader.gb: %.gb $(RGBFIX) -f hg -m 0x10 $@ $(ROM): poke%-spaceworld.gb: $(OBJS) | $(BASEROM) - $(RGBLINK) -d -n $(@:.gb=.sym) -m $(@:.gb=.map) -O $(BASEROM) -o $@ $^ + $(RGBLINK) -d -n $(@:.gb=.sym) -m $(@:.gb=.map) -l $(ROMNAME).link -O $(BASEROM) -o $@ $^ $(RGBFIX) -f lh -k 01 -l 0x33 -m 0x03 -p 0 -r 3 -t "POKEMON2$(shell echo $* | cut -d _ -f 1 | tr '[:lower:]' '[:upper:]')" $@ $(sort_sym) $(@:.gb=.sym) -- cgit v1.2.3