summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPikalaxALT <PikalaxALT@users.noreply.github.com>2021-06-15 08:57:25 -0400
committerGitHub <noreply@github.com>2021-06-15 08:57:25 -0400
commit8ccfa170781ed38f7ccf653fa6cab6c2aea607fe (patch)
tree705b0e5f320cd8be6218069c8537a70a21e343fe
parent6bb16d44745f760a8bbeacbcbd5dec1ce274d60b (diff)
parent606a4c96c13344e7a028cecab725c6be26ba356b (diff)
Merge pull request #824 from PikalaxALT/push_symbols
Fix issues with GH Actions
-rw-r--r--.github/workflows/build.yml54
-rw-r--r--Makefile64
2 files changed, 73 insertions, 45 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 5ea79be17..67e49fc5b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -7,7 +7,7 @@ on:
jobs:
build:
- runs-on: ubuntu-18.04
+ runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
@@ -23,6 +23,12 @@ jobs:
path: 'symbols'
ref: symbols
+ - name: Checkout agbcc
+ uses: actions/checkout@master
+ with:
+ repository: 'pret/agbcc'
+ path: 'agbcc'
+
- name: Install binutils
run: sudo apt install gcc-arm-none-eabi binutils-arm-none-eabi
# build-essential, git, and libpng-dev are already installed
@@ -31,62 +37,36 @@ jobs:
- name: Install agbcc
run: |
- git clone https://github.com/pret/agbcc.git
- cd agbcc
./build.sh
./install.sh ../
./install.sh ../build_de
+ working-directory: ./agbcc
- name: Compare
run: |
make -j${nproc} compare_ruby
- make -j${nproc} compare_ruby_debug
make -j${nproc} compare_ruby_rev1
make -j${nproc} compare_ruby_rev2
make -j${nproc} compare_sapphire
- make -j${nproc} compare_sapphire_debug
make -j${nproc} compare_sapphire_rev1
make -j${nproc} compare_sapphire_rev2
- mv *.sym symbols
+ make -j${nproc} modern
- - name: Modern
+ - name: Nonmatching
run: |
- make -j${nproc} ruby_modern
- make -j${nproc} ruby_debug_modern
- make -j${nproc} ruby_rev1_modern
- make -j${nproc} ruby_rev2_modern
- make -j${nproc} sapphire_modern
- make -j${nproc} sapphire_debug_modern
- make -j${nproc} sapphire_rev1_modern
- make -j${nproc} sapphire_rev2_modern
- mv *.sym symbols
-
- - name: German Before
- run: |
- cd build_de
- sh de_before.sh
+ make clean
+ make -j${nproc} ruby NONMATCHING=1
- name: German
run: |
- cd build_de
+ sh de_before.sh
make -j${nproc} compare_ruby_de
make -j${nproc} compare_ruby_de_debug
make -j${nproc} compare_ruby_de_rev1
make -j${nproc} compare_sapphire_de
make -j${nproc} compare_sapphire_de_debug
make -j${nproc} compare_sapphire_de_rev1
- mv *.sym ../symbols
-
- - name: German Modern
- run: |
- cd build_de
- make -j${nproc} ruby_de_modern
- make -j${nproc} ruby_de_debug_modern
- make -j${nproc} ruby_de_rev1_modern
- make -j${nproc} sapphire_de_modern
- make -j${nproc} sapphire_de_debug_modern
- make -j${nproc} sapphire_de_rev1_modern
- mv *.sym ../symbols
+ working-directory: ./build_de
- name: Webhook
if: ${{ github.event_name == 'push' }}
@@ -96,6 +76,12 @@ jobs:
CALCROM_DISCORD_WEBHOOK_URL: ${{ secrets.CALCROM_DISCORD_WEBHOOK_URL }}
run: sh .github/calcrom/webhook.sh pokeruby
+ - name: Move symfiles
+ if: ${{ github.event_name == 'push' }}
+ run: |
+ cp *.sym symbols/
+ cp build_de/*.sym symbols/
+
- name: Update symfiles
if: ${{ github.event_name == 'push' }}
uses: EndBug/add-and-commit@v7
diff --git a/Makefile b/Makefile
index 135d5227f..66338cb67 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,35 @@
-TOOLCHAIN ?= $(DEVKITARM)
-ifneq (,$(wildcard $(TOOLCHAIN)/base_tools))
-include $(DEVKITARM)/base_tools
-else
-PREFIX := $(TOOLCHAIN)/bin/arm-none-eabi-
+TOOLCHAIN := $(DEVKITARM)
+COMPARE ?= 0
+
+ifeq (compare,$(MAKECMDGOALS))
+ COMPARE := 1
+endif
+
+# don't use dkP's base_tools anymore
+# because the redefinition of $(CC) conflicts
+# with when we want to use $(CC) to preprocess files
+# thus, manually create the variables for the bin
+# files, or use arm-none-eabi binaries on the system
+# if dkP is not installed on this system
+
+ifneq (,$(TOOLCHAIN))
+ifneq ($(wildcard $(TOOLCHAIN)/bin),)
+export PATH := $(TOOLCHAIN)/bin:$(PATH)
+endif
+endif
+
+PREFIX := arm-none-eabi-
OBJCOPY := $(PREFIX)objcopy
-CC := $(PREFIX)gcc
AS := $(PREFIX)as
-endif
+
+LD := $(PREFIX)ld
NM := $(PREFIX)nm
OBJDUMP := $(PREFIX)objdump
+
+# note: the makefile must be set up so MODERNCC is never called
+# if MODERN=0
+MODERNCC := $(PREFIX)gcc
+
include config.mk
ifeq ($(OS),Windows_NT)
@@ -17,17 +38,38 @@ else
EXE :=
endif
+ifeq (modern,$(MAKECMDGOALS))
+ MODERN := 1
+endif
+
+# use arm-none-eabi-cpp for macOS
+# as macOS's default compiler is clang
+# and clang's preprocessor will warn on \u
+# when preprocessing asm files, expecting a unicode literal
+# we can't unconditionally use arm-none-eabi-cpp
+# as installations which install binutils-arm-none-eabi
+# don't come with it
+ifneq ($(MODERN),1)
+ ifeq ($(shell uname -s),Darwin)
+ CPP := $(PREFIX)cpp
+ else
+ CPP := $(CC) -E
+ endif
+else
+ CPP := $(PREFIX)cpp
+endif
#### Tools ####
SHELL := /bin/bash -o pipefail
ifeq ($(MODERN),0)
CC1 := tools/agbcc/bin/agbcc$(EXE)
else
-CC1 = $(shell $(CC) --print-prog-name=cc1) -quiet
+CC1 = $(shell $(MODERNCC) --print-prog-name=cc1) -quiet
endif
CPP := $(PREFIX)cpp
LD := $(PREFIX)ld
OBJCOPY := $(PREFIX)objcopy
+
SHA1SUM := $(shell { command -v sha1sum || command -v shasum; } 2>/dev/null) -c
GBAGFX := tools/gbagfx/gbagfx$(EXE)
RSFONT := tools/rsfont/rsfont$(EXE)
@@ -46,7 +88,7 @@ ifeq ($(MODERN),0)
CPPFLAGS += -I tools/agbcc/include -nostdinc -undef
CC1FLAGS := -mthumb-interwork -Wimplicit -Wparentheses -Wunused -Werror -O2 -fhex-asm
else
-CC1FLAGS := -mthumb -mthumb-interwork -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -O2 -fno-toplevel-reorder -fno-aggressive-loop-optimizations -Wno-pointer-to-int-cast
+CC1FLAGS := -mthumb -mthumb-interwork -mabi=apcs-gnu -mcpu=arm7tdmi -O2 -fno-toplevel-reorder -fno-aggressive-loop-optimizations -Wno-pointer-to-int-cast
endif
ifneq (,$(DINFO))
@@ -78,12 +120,12 @@ OBJS_REL := $(ALL_OBJECTS:$(BUILD_DIR)/%=%)
SUBDIRS := $(sort $(dir $(ALL_OBJECTS)))
DATA_SRC_SUBDIR = src/data
-GCC_VER = $(shell $(CC) -dumpversion)
+GCC_VER = $(shell $(MODERNCC) -dumpversion)
ifeq ($(MODERN),0)
LIBDIRS := ../../tools/agbcc/lib
else
-LIBDIRS := -L $(shell dirname $(shell $(CC) --print-file-name=libgcc.a)) -L $(shell dirname $(shell $(CC) --print-file-name=libc.a))
+LIBDIRS := -L $(shell dirname $(shell $(MODERNCC) --print-file-name=libgcc.a)) -L $(shell dirname $(shell $(MODERNCC) --print-file-name=libc.a))
endif
LDFLAGS := $(LIBDIRS:%=-L %) -lgcc -lc