blob: 9d3019956a74b79fbef644889a7b3830ee82fe49 [file] [log] [blame]
Sasha Smundaka3be7922021-06-14 10:56:24 -07001#! /bin/bash
2# Convert and run one configuration
Cole Faust057828d2021-10-01 17:51:23 -07003# Args: a product/board makefile optionally followed by additional arguments
4# that will be passed to rbcrun.
5[[ $# -gt 0 && -f "$1" ]] || { echo "Usage: ${0##*/} product.mk [Additional rbcrun arguments]" >&2; exit 1; }
Sasha Smundaka3be7922021-06-14 10:56:24 -07006set -eu
Lukacs T. Berki90b43342021-11-02 14:42:04 +01007
8case $(uname -s) in
9 Linux)
10 declare -r os="linux-x86";
11 ;;
12 Darwin)
13 declare -r os="darwin-x86";
14 ;;
15 *)
16 echo "Unknown OS: $(uname -s)" >&2;
17 exit 1;
18 ;;
19esac
20
21declare -r output_root="${OUT_DIR:-out}"
22declare -r runner="${output_root}/soong/host/${os}/bin/rbcrun"
23declare -r converter="${output_root}/soong/host/${os}/bin/mk2rbc"
24declare -r launcher="$output_root/launchers/run.rbc"
25declare -r makefile="$1"
Cole Faust057828d2021-10-01 17:51:23 -070026shift
Lukacs T. Berki90b43342021-11-02 14:42:04 +010027"$converter" -mode=write -r --outdir "$output_root" --launcher="$launcher" "$makefile"
28"$runner" RBC_OUT="make,global" RBC_DEBUG="${RBC_DEBUG:-}" $@ "$launcher"
Sasha Smundaka3be7922021-06-14 10:56:24 -070029