summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2021-06-16 11:03:23 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2021-06-16 11:03:23 -0400
commit5ccac26f2685aed0f0374d5999ce5506d5a69693 (patch)
tree203ad7bee98f904bebe892f23ba83db315a846d5 /Makefile
parent69fb670955664f9f936f7b85667238546d43fa40 (diff)
Port symfile implementation from Ruby, FireRed
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 12 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index d7d4b9566..89d4b7c94 100644
--- a/Makefile
+++ b/Makefile
@@ -20,6 +20,7 @@ endif
PREFIX := arm-none-eabi-
OBJCOPY := $(PREFIX)objcopy
+OBJDUMP := $(PREFIX)objdump
AS := $(PREFIX)as
LD := $(PREFIX)ld
@@ -75,6 +76,7 @@ SHELL := /bin/bash -o pipefail
ELF = $(ROM:.gba=.elf)
MAP = $(ROM:.gba=.map)
+SYM = $(ROM:.gba=.sym)
C_SUBDIR = src
GFLIB_SUBDIR = gflib
@@ -153,7 +155,7 @@ infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst
# Disable dependency scanning for clean/tidy/tools
# Use a separate minimal makefile for speed
# Since we don't need to reload most of this makefile
-ifeq (,$(filter-out all rom compare modern berry_fix libagbsyscall,$(MAKECMDGOALS)))
+ifeq (,$(filter-out all rom compare modern berry_fix libagbsyscall syms,$(MAKECMDGOALS)))
$(call infoshell, $(MAKE) -f make_tools.mk)
else
NODEP ?= 1
@@ -211,6 +213,8 @@ all: rom
tools: $(TOOLDIRS)
+syms: $(SYM)
+
$(TOOLDIRS):
@$(MAKE) -C $@
@@ -428,3 +432,10 @@ berry_fix:
libagbsyscall:
@$(MAKE) -C libagbsyscall TOOLCHAIN=$(TOOLCHAIN) MODERN=$(MODERN)
+
+###################
+### Symbol file ###
+###################
+
+$(SYM): $(ELF)
+ $(OBJDUMP) -t $< | sort -u | grep -E "^0[2389]" > $@