| # Copyright 2020 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/zircon/zx_library.gni") |
| |
| # Common variables for our SDK and in-tree targets. |
| common_vars = { |
| sdk = "source" |
| sdk_headers = [ |
| "lib/zircon_boot/android_boot_image.h", |
| "lib/zircon_boot/zbi_utils.h", |
| "lib/zircon_boot/zircon_boot.h", |
| ] |
| sources = [ |
| "android_boot_image.c", |
| "utils.h", |
| "zbi_utils.c", |
| "zircon_boot.c", |
| "zircon_ramboot.c", |
| "zircon_ramboot.h", |
| "zircon_vboot.c", |
| "zircon_vboot.h", |
| ] |
| public_deps = [ "//sdk/lib/zbi-format" ] |
| } |
| |
| # SDK library. |
| zx_library("zircon_boot") { |
| forward_variables_from(common_vars, "*") |
| public_deps += [ |
| "//src/firmware/lib/abr", |
| "//src/firmware/lib/zbi", |
| "//third_party/android/platform/external/avb", |
| ] |
| sdk_publishable = "excluded" |
| } |
| |
| # In-tree library. |
| # This is necessary because in-tree targets use //zircon/system/public |
| # as the sysroot dependency, which is not available to sdk_publishable |
| # targets. |
| zx_library("in_tree") { |
| forward_variables_from(common_vars, "*") |
| public_deps += [ |
| "//src/firmware/lib/abr:in_tree", |
| "//src/firmware/lib/zbi:in_tree", |
| ] |
| |
| # For in-tree build, use the library target without sysdeps. Final |
| # executable target or toolchain need to provide the implementation |
| # accordingly. |
| public_deps += [ "//third_party/android/platform/external/avb:lib" ] |
| deps = [ "//zircon/system/public" ] |
| } |
| |
| source_set("gpt_boot_demo_lib") { |
| sources = [ |
| "gpt_boot_demo.cc", |
| "gpt_boot_reference.c", |
| ] |
| deps = [ |
| ":in_tree", |
| "//src/firmware/lib/storage", |
| "//third_party/android/platform/external/avb:sysdeps-posix", |
| ] |
| } |
| |
| executable("gpt_boot_demo_exe") { |
| output_name = "gpt_boot_demo" |
| deps = [ ":gpt_boot_demo_lib" ] |
| } |
| |
| group("gpt_boot_demo") { |
| deps = [ ":gpt_boot_demo_exe($host_toolchain)" ] |
| } |