| Sasha Smundak | a3be792 | 2021-06-14 10:56:24 -0700 | [diff] [blame] | 1 | #! /bin/bash | 
|  | 2 | # Convert and run one configuration | 
| Cole Faust | 057828d | 2021-10-01 17:51:23 -0700 | [diff] [blame] | 3 | # 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 Smundak | a3be792 | 2021-06-14 10:56:24 -0700 | [diff] [blame] | 6 | set -eu | 
| Lukacs T. Berki | 90b4334 | 2021-11-02 14:42:04 +0100 | [diff] [blame] | 7 |  | 
|  | 8 | case $(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 | ;; | 
|  | 19 | esac | 
|  | 20 |  | 
|  | 21 | declare -r output_root="${OUT_DIR:-out}" | 
|  | 22 | declare -r runner="${output_root}/soong/host/${os}/bin/rbcrun" | 
|  | 23 | declare -r converter="${output_root}/soong/host/${os}/bin/mk2rbc" | 
|  | 24 | declare -r launcher="$output_root/launchers/run.rbc" | 
|  | 25 | declare -r makefile="$1" | 
| Cole Faust | 057828d | 2021-10-01 17:51:23 -0700 | [diff] [blame] | 26 | shift | 
| Lukacs T. Berki | 90b4334 | 2021-11-02 14:42:04 +0100 | [diff] [blame] | 27 | "$converter" -mode=write -r --outdir "$output_root" --launcher="$launcher" "$makefile" | 
|  | 28 | "$runner" RBC_OUT="make,global" RBC_DEBUG="${RBC_DEBUG:-}" $@ "$launcher" | 
| Sasha Smundak | a3be792 | 2021-06-14 10:56:24 -0700 | [diff] [blame] | 29 |  |