ring/mk/package.sh
Brian Smith badca90d14 Simplify assembly pre-generation mechanism.
Eliminate the extra Cargo.toml that was used just for this feature. It was
too error-prone to keep it in sync with the real Cargo.toml. Having one
Cargo.toml will allow us to reliably use the `CARGO_MANIFEST_LINKS` value
to keep the symbol prefix in sync with the `links` field in Cargo.toml in
the near future.
2021-05-03 13:36:20 -07:00

15 lines
400 B
Bash

# This only works on Windows, using MinGW.
set -eux -o pipefail
IFS=$'\n\t'
# Make sure the current tree isn't dirty.
# https://stackoverflow.com/a/5737794
if [[ $(git status --porcelain | wc -c) -ne 0 ]]; then
echo Repository is dirty.
exit 1
fi
cargo clean --target-dir=target/pregenerate_asm
RING_PREGENERATE_ASM=1 cargo build --target-dir=target/pregenerate_asm
cargo package --allow-dirty