Cargo build script to compile binaries as static library to be linked with an external linker

I have been programming in rust on the PS3 with no_std.
As part of my build process I do the following.

cargo +nightly build -Zbuild-std --lib --target powerpc64-unknown-linux-gnu
cp target/powerpc64-unknown-linux-gnu/debug/libmain.a /opt/blackbox
make -C /opt/blackbox
cp /opt/main.self .

I would prefer to be able to just run

cargo +nightly build -Zbuild-std --target powerpc64-unknown-linux-gnu
cargo +nightly run -Zbuild-std --target powerpc64-unknown-linux-gnu

I am very unfamiliar with build scripts, and building a static library as a build script is an uncommon one.

build scripts are run before the actual crate is built, it was intended to "prepare" the build.

you probably want a runner, not a build script: