diff options
| author | Derek Hensley <hensley.derek58@gmail.com> | 2025-09-04 17:56:01 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-04 17:56:01 -0700 |
| commit | 61a38830b94c28b3fcead3e22161c3dd621d25c9 (patch) | |
| tree | 8ae9664d2feae319bb7da12ddd7cc7e06751f1ae /tools/asm-processor/compile-test.sh | |
| parent | a4d5910cdb9bed05fa5aea4476a3cf4ef178be06 (diff) | |
* git subrepo pull tools/asm-processor
subrepo:
subdir: "tools/asm-processor"
merged: "5c3984fc"
upstream:
origin: "git@github.com:simonlindholm/asm-processor.git"
branch: "main"
commit: "5c3984fc"
git-subrepo:
version: "0.4.9"
origin: "git@github.com:ingydotnet/git-subrepo.git"
commit: "ea10886"
* Fix things needed for new spimdisasm release
Diffstat (limited to 'tools/asm-processor/compile-test.sh')
| -rwxr-xr-x | tools/asm-processor/compile-test.sh | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/tools/asm-processor/compile-test.sh b/tools/asm-processor/compile-test.sh index 6551662..3039f8a 100755 --- a/tools/asm-processor/compile-test.sh +++ b/tools/asm-processor/compile-test.sh @@ -1,8 +1,12 @@ #!/bin/bash set -o pipefail -INPUT="$1" -OUTPUT="${INPUT%.*}.o" +INPUT=$(readlink -f "$1") + +cd -- "$(dirname -- "${BASH_SOURCE[0]}")" +WD=$(pwd) +INPUT=${INPUT#"$WD"/} +OUTPUT="${INPUT%.*}.o" rm -f "$OUTPUT" CC="$MIPS_CC" # ido 7.1 via recomp or qemu-irix @@ -23,4 +27,15 @@ if [[ "$OPTFLAGS" != *-KPIC* ]]; then fi set -e -python3 build.py --drop-mdebug-gptab $ASMPFLAGS $CC -- $AS $ASFLAGS -- $CFLAGS $OPTFLAGS $ISET -o "$OUTPUT" "$INPUT" + +if [[ "$2" == "python" ]]; then + PROG="python3 ./build.py" +elif [[ "$2" == "rust-release" ]]; then + PROG="./rust/target/release/asm-processor" +elif [[ "$2" == "rust-debug" ]]; then + PROG="./rust/target/debug/asm-processor" +else + echo "Usage: $0 input.c (python|rust-release|rust-debug)" +fi + +$PROG --drop-mdebug-gptab $ASMPFLAGS $CC -- $AS $ASFLAGS -- $CFLAGS $OPTFLAGS $ISET -o "$OUTPUT" "$INPUT" |
