summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPikalaxALT <PikalaxALT@users.noreply.github.com>2021-06-16 10:49:41 -0400
committerGitHub <noreply@github.com>2021-06-16 10:49:41 -0400
commitb15cc8eead04d70dc5493aab729b82529bc24b32 (patch)
tree92c18b1a336b5f8f3e5eb47fae05962fc1a11012 /Makefile
parent5acfde358a3a9a99d580f151f739545eba950001 (diff)
parent7993823ca51b539f31551f6e0cef0c84794dcd3c (diff)
Merge pull request #439 from PikalaxALT/push_symbols
Create symfiles on build
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 13 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 7e40a375d..a5fe77f23 100644
--- a/Makefile
+++ b/Makefile
@@ -24,6 +24,7 @@ export AS := $(PREFIX)as
endif
export CPP := $(PREFIX)cpp
export LD := $(PREFIX)ld
+OBJDUMP := $(PREFIX)objdump
ifeq ($(OS),Windows_NT)
EXE := .exe
@@ -57,6 +58,7 @@ OBJ_DIR := build/$(BUILD_NAME)
ELF = $(ROM:.gba=.elf)
MAP = $(ROM:.gba=.map)
+SYM = $(ROM:.gba=.sym)
C_SUBDIR = src
DATA_C_SUBDIR = src/data
@@ -112,7 +114,7 @@ infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst
# Build tools when building the rom
# Disable dependency scanning for clean/tidy/tools
-ifeq (,$(filter-out all compare,$(MAKECMDGOALS)))
+ifeq (,$(filter-out all compare syms modern,$(MAKECMDGOALS)))
$(call infoshell, $(MAKE) tools)
else
NODEP := 1
@@ -149,7 +151,7 @@ TOOLS = $(foreach tool,$(TOOLBASE),tools/$(tool)/$(tool)$(EXE))
ALL_BUILDS := firered firered_rev1 leafgreen leafgreen_rev1
ALL_BUILDS += $(ALL_BUILDS:%=%_modern)
-.PHONY: all rom tools clean-tools mostlyclean clean compare tidy berry_fix $(TOOLDIRS) $(ALL_BUILDS) $(ALL_BUILDS:%=compare_%) modern
+.PHONY: all rom tools clean-tools mostlyclean clean compare tidy berry_fix syms $(TOOLDIRS) $(ALL_BUILDS) $(ALL_BUILDS:%=compare_%) modern
MAKEFLAGS += --no-print-directory
@@ -157,6 +159,8 @@ AUTO_GEN_TARGETS :=
all: tools rom
+syms: $(SYM)
+
rom: $(ROM)
ifeq ($(COMPARE),1)
@$(SHA1) $(BUILD_NAME).sha1
@@ -344,3 +348,10 @@ leafgreen_modern: ; @$(MAKE) GAME_VERSION=LEAFGREEN MODERN=1
leafgreen_rev1_modern: ; @$(MAKE) GAME_VERSION=LEAFGREEN GAME_REVISION=1 MODERN=1
modern: ; @$(MAKE) MODERN=1
+
+###################
+### Symbol file ###
+###################
+
+$(SYM): $(ELF)
+ $(OBJDUMP) -t $< | sort -u | grep -E "^0[2389]" > $@ \ No newline at end of file