From edae70d313968be316fa73162e3fec2d079d507a Mon Sep 17 00:00:00 2001 From: emma Date: Mon, 12 Dec 2022 22:20:44 -0500 Subject: [PATCH] better build script --- build.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index c01e26c..4bbbdd3 100755 --- a/build.sh +++ b/build.sh @@ -18,7 +18,18 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see https://www.gnu.org/licenses/. +if ! test -n "$1"; then + printf "Usage: %s [target]\n" "$0" 1>&2 + printf "For a list of targets, type 'rustc --print target-list'\n" 1>&2 + exit 64 # sysexits(3) EX_USAGE +fi + +if ! command -v cargo; then + printf "%s: Missing depenency: cargo(1)\n" "$0" 1>&2 + exit 69 # syexits(3) EX_UNAVAILABLE +fi + cargo build --release \ -Z build-std=std,panic_abort \ -Z build-std-features=panic_immediate_abort \ - --target x86_64-unknown-linux-gnu + --target "$1"