18 lines
493 B
Bash
Executable file
18 lines
493 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Assemble the W65816 runtime library to runtime/libgcc.o.
|
|
# Run after editing runtime/src/*.s.
|
|
|
|
set -euo pipefail
|
|
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
LLVM_MC="$PROJECT_ROOT/tools/llvm-mos-build/bin/llvm-mc"
|
|
|
|
[ -x "$LLVM_MC" ] || {
|
|
echo "llvm-mc not found at $LLVM_MC" >&2
|
|
exit 1
|
|
}
|
|
|
|
"$LLVM_MC" -arch=w65816 -filetype=obj \
|
|
"$PROJECT_ROOT/runtime/src/libgcc.s" \
|
|
-o "$PROJECT_ROOT/runtime/libgcc.o"
|
|
|
|
echo "built runtime/libgcc.o"
|