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"