summaryrefslogtreecommitdiffstats
path: root/debug/risc-v-gsp-rm-vm/rmharness/rmq.sh
blob: ce0670e1849338939923be87f14dc70af8f4b160 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash
# rmq.sh - build-if-needed wrapper for the existing tools/rmq host RM oracle.
# rmq itself is not modified by the harness; this only locates/builds it.
set -euo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT="$(cd "$HERE/../../.." && pwd)"
BIN="$ROOT/tools/rmq/rmq"
# rmq has no --help flag; answer it here so the smoke check never touches the
# device (see rmharness/README.md "Safe smoke checks").
case "${1:-}" in
-h | --help)
	echo "usage: $(basename "$0") [rmq-index options]   (read-only RM oracle)"
	echo "  rmq has no launcher of its own; see $ROOT/tools/rmq/."
	echo "  Built on first use from $ROOT/tools/rmq."
	exit 0
	;;
esac
if [[ ! -x "$BIN" ]]; then
	make -C "$ROOT/tools/rmq" >&2
fi
exec "$BIN" "$@"