blob: d178a0be0870adb5c0050f577c02a18b199bd550 [file] [log] [blame]
Miguel Young de la Sota3c8ab3b2019-11-21 13:59:09 -06001#!/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
6set -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
16platform_bin_dir="$1"; shift
17meson_src_dir_prefix="$1"; shift
18meson_src_dir="$1"; shift
19
20target_bin_dir="$platform_bin_dir/${meson_src_dir#"$meson_src_dir_prefix"}"
21
22mkdir -p "$target_bin_dir"
23cp $@ "$target_bin_dir"