blob: 1032649824962d08dab3cf6612ca7dae029a6d27 [file] [log] [blame]
# Copyright 2022 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/board.gni")
import("//build/images/tools/fastboot.gni")
_board_tools_deps = []
foreach(tool_path, board_tools) {
basename = get_path_info(tool_path, "file")
copy("board_tool_$basename") {
sources = [ tool_path ]
outputs = [ "$root_out_dir/board_tools/$basename" ]
metadata = {
images = [
{
label =
get_label_info(":board_tool_$basename", "label_with_toolchain")
archive = true
name = "$basename"
path = "board_tools/$basename"
type = "script"
},
]
}
}
_board_tools_deps += [ ":board_tool_$basename" ]
}
# Copy any board-specific tools.
group("board_tools") {
deps = _board_tools_deps
}
group("bootserver") {
deps = [ "//tools/bootserver_old:bootserver($host_toolchain)" ]
host_out_dir = get_label_info(":anything($host_toolchain)", "root_out_dir")
metadata = {
images = [
{
label = get_label_info(":$target_name", "label_with_toolchain")
archive = true
name = "bootserver"
path = rebase_path("$host_out_dir/bootserver", root_build_dir)
type = "exe.$host_platform"
},
]
}
}
if (is_host) {
copy("fastboot") {
sources = [ "${prebuilt_fastboot}" ]
host_out_dir = get_label_info(":anything($host_toolchain)", "root_out_dir")
outputs = [ "$host_out_dir/fastboot" ]
metadata = {
tool_paths = [
{
cpu = host_cpu
label = get_label_info(":fastboot", "label_with_toolchain")
name = "fastboot"
os = host_os
path = rebase_path(outputs[0], root_build_dir)
},
]
images = [
{
label = get_label_info(":fastboot", "label_with_toolchain")
archive = true
name = "fastboot"
path = rebase_path(outputs[0], root_build_dir)
type = "exe.$host_platform"
},
]
}
}
}