From aad94c34334ee44f1298175df38f14dc27ae5fb8 Mon Sep 17 00:00:00 2001 From: luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com> Date: Wed, 16 Dec 2020 13:15:54 -0500 Subject: [PATCH] Fix asmdiff.sh to work without DKP, also improve the makefile command for recognizing a toolchain. The new command requires the toolchain binary path to exist in the file system before building using a toolchain (to handle the case where gba-dev is uninstalled but $(DEVKITARM) still exists)) --- Makefile | 2 +- asmdiff.sh | 7 ++++++- berry_fix/Makefile | 2 +- berry_fix/payload/Makefile | 2 +- libagbsyscall/Makefile | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index bffa4b560..de146726b 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ COMPARE ?= 0 # files, or use arm-none-eabi binaries on the system # if dkP is not installed on tihs system -ifneq ($(TOOLCHAIN),) +ifneq ($(wildcard $(TOOLCHAIN)/bin),) export PATH := $(TOOLCHAIN)/bin:$(PATH) endif diff --git a/asmdiff.sh b/asmdiff.sh index 9e8749acf..534281fdf 100755 --- a/asmdiff.sh +++ b/asmdiff.sh @@ -1,6 +1,11 @@ #!/bin/bash -OBJDUMP="$DEVKITARM/bin/arm-none-eabi-objdump -D -bbinary -marmv4t -Mforce-thumb" +if [[ -d "$DEVKITARM/bin/" ]]; then + OBJDUMP_BIN="$DEVKITARM/bin/arm-none-eabi-objdump" +else + OBJDUMP_BIN="arm-none-eabi-objdump" +fi +OBJDUMP="$OBJDUMP_BIN -D -bbinary -marmv4t -Mforce-thumb" OPTIONS="--start-address=$(($1)) --stop-address=$(($1 + $2))" $OBJDUMP $OPTIONS baserom.gba > baserom.dump $OBJDUMP $OPTIONS pokeemerald.gba > pokeemerald.dump diff --git a/berry_fix/Makefile b/berry_fix/Makefile index f7ce40504..6aab4ed62 100644 --- a/berry_fix/Makefile +++ b/berry_fix/Makefile @@ -8,7 +8,7 @@ COMPARE ?= 0 # files, or use arm-none-eabi binaries on the system # if dkP is not installed on tihs system -ifneq ($(TOOLCHAIN),) +ifneq ($(wildcard $(TOOLCHAIN)/bin),) export PATH := $(TOOLCHAIN)/bin:$(PATH) endif diff --git a/berry_fix/payload/Makefile b/berry_fix/payload/Makefile index 7a6a92396..ad8787c34 100644 --- a/berry_fix/payload/Makefile +++ b/berry_fix/payload/Makefile @@ -8,7 +8,7 @@ COMPARE ?= 0 # files, or use arm-none-eabi binaries on the system # if dkP is not installed on tihs system -ifneq ($(TOOLCHAIN),) +ifneq ($(wildcard $(TOOLCHAIN)/bin),) export PATH := $(TOOLCHAIN)/bin:$(PATH) endif diff --git a/libagbsyscall/Makefile b/libagbsyscall/Makefile index ba349e9eb..e1f502b2f 100644 --- a/libagbsyscall/Makefile +++ b/libagbsyscall/Makefile @@ -8,7 +8,7 @@ COMPARE ?= 0 # files, or use arm-none-eabi binaries on the system # if dkP is not installed on tihs system -ifneq ($(TOOLCHAIN),) +ifneq ($(wildcard $(TOOLCHAIN)/bin),) export PATH := $(TOOLCHAIN)/bin:$(PATH) endif