2020-10-20 17:50:20 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
here=$(dirname "$0")
|
2020-11-04 18:29:26 -08:00
|
|
|
|
2022-10-10 12:43:53 -07:00
|
|
|
maybe_sbf_sdk="--sbf-sdk $here/sdk/sbf"
|
2020-11-04 18:29:26 -08:00
|
|
|
for a in "$@"; do
|
2022-05-24 17:36:12 -07:00
|
|
|
if [[ $a = --sbf-sdk ]]; then
|
|
|
|
maybe_sbf_sdk=
|
2020-11-04 18:29:26 -08:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2021-12-14 11:27:54 -08:00
|
|
|
set -ex
|
2022-10-10 12:43:53 -07:00
|
|
|
if [[ ! -f "$here"/sdk/sbf/syscalls.txt ]]; then
|
2022-12-22 11:17:11 -08:00
|
|
|
cargo build --manifest-path "$here"/programs/bpf_loader/gen-syscall-list/Cargo.toml
|
2021-12-14 11:27:54 -08:00
|
|
|
fi
|
2022-12-22 11:17:11 -08:00
|
|
|
exec cargo run --manifest-path "$here"/sdk/cargo-build-sbf/Cargo.toml -- $maybe_sbf_sdk "$@"
|