From e0d3dddf63cf12f8a33cc8b96c4b93c06018df66 Mon Sep 17 00:00:00 2001 From: GBA bot Date: Sat, 1 Jan 2022 19:27:31 +0000 Subject: [PATCH] Handle the fact that the output might not be in `target/` --- .github/scripts/build-example-gba-files.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/scripts/build-example-gba-files.sh b/.github/scripts/build-example-gba-files.sh index 737240ff..e2322295 100755 --- a/.github/scripts/build-example-gba-files.sh +++ b/.github/scripts/build-example-gba-files.sh @@ -9,14 +9,13 @@ function build_rom() { local GAME_NAME="$1" local INTERNAL_NAME="$2" - local GBA_FILE="target/$GAME_NAME.gba" + local TARGET_FOLDER="${CARGO_TARGET_DIR:-target}" + local GBA_FILE="$TARGET_FOLDER/$GAME_NAME.gba" pushd "examples/$GAME_NAME" cargo build --release --verbose --target thumbv4t-none-eabi - find . - - arm-none-eabi-objcopy -O binary "target/thumbv4t-none-eabi/release/$GAME_NAME" "$GBA_FILE" + arm-none-eabi-objcopy -O binary "$TARGET_FOLDER/thumbv4t-none-eabi/release/$GAME_NAME" "$GBA_FILE" gbafix -p "-t${INTERNAL_NAME:0:12}" "-c${INTERNAL_NAME:0:4}" -mGC "$GBA_FILE" cp -v "$GBA_FILE" "../$GAME_NAME.gba"