Miguel Young de la Sota | 3c8ab3b | 2019-11-21 13:59:09 -0600 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # Copyright lowRISC contributors. |
| 3 | # Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| 4 | # SPDX-License-Identifier: Apache-2.0 |
| 5 | |
| 6 | set -e |
| 7 | |
| 8 | # export_target.sh is intended to be invoked by Meson, to work around Meson's |
| 9 | # limitations for custom_target() (it is not possible to specify more than one |
| 10 | # command) and limitations on string handling (Meson does not provide |
| 11 | # standard string manipulation functions like trim_prefix()). |
| 12 | # |
| 13 | # This script does not use build_consts.sh, but relies on Meson to supply that |
| 14 | # information. |
| 15 | |
| 16 | platform_bin_dir="$1"; shift |
| 17 | meson_src_dir_prefix="$1"; shift |
| 18 | meson_src_dir="$1"; shift |
| 19 | |
| 20 | target_bin_dir="$platform_bin_dir/${meson_src_dir#"$meson_src_dir_prefix"}" |
| 21 | |
| 22 | mkdir -p "$target_bin_dir" |
| 23 | cp $@ "$target_bin_dir" |