blob: b8a6c0c73746c74a8713105987c2f075d50df7d1 [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.
Cole Faust864028a2021-12-01 13:43:17 -08005[[ $# -gt 1 && -f "$1" && -f "$2" ]] || { echo "Usage: ${0##*/} product.mk input_variables.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
Lukacs T. Berki90b43342021-11-02 14:42:04 +01008declare -r output_root="${OUT_DIR:-out}"
Lukacs T. Berki04bd17e2021-11-04 18:02:22 +01009declare -r runner="${output_root}/soong/rbcrun"
10declare -r converter="${output_root}/soong/mk2rbc"
Cole Faust943ac412021-11-04 16:39:59 -070011declare -r launcher="${output_root}/rbc/launcher.rbc"
Cole Faust8d47c482022-01-26 14:27:44 -080012declare -r makefile_list="${output_root}/.module_paths/configuration.list"
Lukacs T. Berki90b43342021-11-02 14:42:04 +010013declare -r makefile="$1"
Cole Faust864028a2021-12-01 13:43:17 -080014declare -r input_variables="$2"
15shift 2
Cole Faust8d47c482022-01-26 14:27:44 -080016"${converter}" -mode=write -r --outdir "${output_root}/rbc" --input_variables "${input_variables}" --launcher="${launcher}" --makefile_list="${makefile_list}" "${makefile}"
Lukacs T. Berki04bd17e2021-11-04 18:02:22 +010017"${runner}" RBC_OUT="make,global" RBC_DEBUG="${RBC_DEBUG:-}" $@ "${launcher}"
Sasha Smundaka3be7922021-06-14 10:56:24 -070018