From 250b53f85cecb7c46a2827272e868153d88f98fc Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 15 Jun 2021 10:27:16 -0400 Subject: Create symfiles on build --- .github/workflows/build.yml | 31 ++++++++++++++++++++++++++++--- Makefile | 15 +++++++++++++-- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f8ad97065..351d475f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,11 +7,23 @@ on: jobs: build: - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@master + - name: Checkout agbcc + uses: actions/checkout@master + with: + path: 'agbcc' + repository: 'pret/agbcc' + + - name: Checkout symbols + uses: actions/checkout@master + with: + path: 'symbols' + ref: 'symbols' + - name: Install binutils run: sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi # build-essential, git, and libpng-dev are already installed @@ -20,10 +32,9 @@ jobs: - name: Install agbcc run: | - git clone https://github.com/pret/agbcc.git - cd agbcc ./build.sh ./install.sh ../ + working-directory: ./agbcc - name: Compare FireRed run: | @@ -45,3 +56,17 @@ jobs: CALCROM_DISCORD_WEBHOOK_AVATAR_URL: https://i.imgur.com/38BQHdd.png CALCROM_DISCORD_WEBHOOK_URL: ${{ secrets.CALCROM_DISCORD_WEBHOOK_URL }} run: sh .github/calcrom/webhook.sh pokefirered + + - name: Move symfiles + if: ${{ github.event_name == 'push' }} + run: | + cp *.sym symbols/ + + - name: Update symfiles + if: ${{ github.event_name == 'push' }} + uses: EndBug/add-and-commit@v7 + with: + branch: symbols + cwd: "./symbols" + add: "*.sym" + message: ${{ github.event.commits[0].message }} diff --git a/Makefile b/Makefile index 7e40a375d..df89c3ef5 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 @@ -149,13 +151,15 @@ 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 AUTO_GEN_TARGETS := -all: tools rom +all: tools rom syms + +syms: $(SYM) rom: $(ROM) ifeq ($(COMPARE),1) @@ -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 -- cgit v1.2.3 From 784e7a150226ad9ea3fbb5ef6aad50cebf65548d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 15 Jun 2021 15:13:16 -0400 Subject: Symfile no longer part of all target --- .github/workflows/build.yml | 33 ++++++++++++++++++++++++++++----- Makefile | 2 +- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 351d475f6..df297b2d1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,6 +8,12 @@ on: jobs: build: runs-on: ubuntu-latest + env: + GAME_VERSION: FIRERED + GAME_LANGUAGE: ENGLISH + GAME_REVISION: 0 + MODERN: 0 + COMPARE: 1 steps: - name: Checkout uses: actions/checkout@master @@ -38,16 +44,33 @@ jobs: - name: Compare FireRed run: | - make -j${nproc} compare_firered - make -j${nproc} compare_firered_rev1 + make -j${nproc} all syms + + - name: Compare FireRed rev1 + env: + GAME_REVISION: 1 + run: | + make -j${nproc} all syms + + - name: Compare LeafGreen + env: + GAME_VERSION: LEAFGREEN + run: | + make -j${nproc} all syms - name: Compare LeafGreen + env: + GAME_VERSION: LEAFGREEN + GAME_REVISION: 1 run: | - make -j${nproc} compare_leafgreen - make -j${nproc} compare_leafgreen_rev1 + make -j${nproc} all syms - name: Modern - run: make -j${nproc} modern + env: + MODERN: 1 + COMPARE: 0 + run: | + make -j${nproc} all - name: Webhook if: ${{ github.event_name == 'push' }} diff --git a/Makefile b/Makefile index df89c3ef5..9e8c3a106 100644 --- a/Makefile +++ b/Makefile @@ -157,7 +157,7 @@ MAKEFLAGS += --no-print-directory AUTO_GEN_TARGETS := -all: tools rom syms +all: tools rom syms: $(SYM) -- cgit v1.2.3 From cc52b97294a6d113f2fbee34eacae3b25b76500f Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 15 Jun 2021 16:14:06 -0400 Subject: Force tools to build in GH Actions --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9e8c3a106..a5fe77f23 100644 --- a/Makefile +++ b/Makefile @@ -114,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 -- cgit v1.2.3 From 7993823ca51b539f31551f6e0cef0c84794dcd3c Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 15 Jun 2021 16:18:13 -0400 Subject: Fix yml step names --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index df297b2d1..091ae69b5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,14 +58,14 @@ jobs: run: | make -j${nproc} all syms - - name: Compare LeafGreen + - name: Compare LeafGreen rev1 env: GAME_VERSION: LEAFGREEN GAME_REVISION: 1 run: | make -j${nproc} all syms - - name: Modern + - name: Build Modern env: MODERN: 1 COMPARE: 0 -- cgit v1.2.3