2021-06-14 19:56:24 +02:00
|
|
|
#! /bin/bash
|
|
|
|
# Convert and run one configuration
|
2021-10-02 02:51:23 +02:00
|
|
|
# Args: a product/board makefile optionally followed by additional arguments
|
|
|
|
# that will be passed to rbcrun.
|
2021-12-01 22:43:17 +01:00
|
|
|
[[ $# -gt 1 && -f "$1" && -f "$2" ]] || { echo "Usage: ${0##*/} product.mk input_variables.mk [Additional rbcrun arguments]" >&2; exit 1; }
|
2021-06-14 19:56:24 +02:00
|
|
|
set -eu
|
2021-11-02 14:42:04 +01:00
|
|
|
|
|
|
|
declare -r output_root="${OUT_DIR:-out}"
|
2022-03-25 01:27:41 +01:00
|
|
|
declare -r runner="${output_root}/rbcrun"
|
|
|
|
declare -r converter="${output_root}/mk2rbc"
|
2021-11-05 00:39:59 +01:00
|
|
|
declare -r launcher="${output_root}/rbc/launcher.rbc"
|
2022-01-26 23:27:44 +01:00
|
|
|
declare -r makefile_list="${output_root}/.module_paths/configuration.list"
|
2021-11-02 14:42:04 +01:00
|
|
|
declare -r makefile="$1"
|
2021-12-01 22:43:17 +01:00
|
|
|
declare -r input_variables="$2"
|
|
|
|
shift 2
|
2022-01-26 23:27:44 +01:00
|
|
|
"${converter}" -mode=write -r --outdir "${output_root}/rbc" --input_variables "${input_variables}" --launcher="${launcher}" --makefile_list="${makefile_list}" "${makefile}"
|
2021-11-04 18:02:22 +01:00
|
|
|
"${runner}" RBC_OUT="make,global" RBC_DEBUG="${RBC_DEBUG:-}" $@ "${launcher}"
|
2021-06-14 19:56:24 +02:00
|
|
|
|