[avb]Add sdk build rule

Add sdk build rule to for libavb and libavb_atx to prepare integration
into the firmware sdk.

Bug: 54894
Change-Id: Ifa6495252b912c1dea3c3a0ead1d94e35512306e
diff --git a/BUILD.gn b/BUILD.gn
new file mode 100644
index 0000000..d9d7bb5
--- /dev/null
+++ b/BUILD.gn
@@ -0,0 +1,66 @@
+# 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/unification/zx_library.gni")
+
+# SDK library.
+zx_library("avb") {
+  sdk_publishable = true
+  sdk = "source"
+
+  # Headers of this library live with the source directly instead of in
+  # a "include" folder. Therefore we use |public| directly to specify the
+  # paths of the public header files.
+  public = [
+    "libavb/libavb.h",
+    "libavb_atx/libavb_atx.h",
+  ]
+  sources = [
+    "libavb/avb_chain_partition_descriptor.c",
+    "libavb/avb_chain_partition_descriptor.h",
+    "libavb/avb_cmdline.c",
+    "libavb/avb_cmdline.h",
+    "libavb/avb_crc32.c",
+    "libavb/avb_crypto.c",
+    "libavb/avb_crypto.h",
+    "libavb/avb_descriptor.c",
+    "libavb/avb_descriptor.h",
+    "libavb/avb_footer.c",
+    "libavb/avb_footer.h",
+    "libavb/avb_hash_descriptor.c",
+    "libavb/avb_hash_descriptor.h",
+    "libavb/avb_hashtree_descriptor.c",
+    "libavb/avb_hashtree_descriptor.h",
+    "libavb/avb_kernel_cmdline_descriptor.c",
+    "libavb/avb_kernel_cmdline_descriptor.h",
+    "libavb/avb_ops.h",
+    "libavb/avb_property_descriptor.c",
+    "libavb/avb_property_descriptor.h",
+    "libavb/avb_rsa.c",
+    "libavb/avb_rsa.h",
+    "libavb/avb_sha.h",
+    "libavb/avb_sha256.c",
+    "libavb/avb_sha512.c",
+    "libavb/avb_slot_verify.c",
+    "libavb/avb_slot_verify.h",
+    "libavb/avb_sysdeps.h",
+    "libavb/avb_sysdeps_posix.c",
+    "libavb/avb_util.c",
+    "libavb/avb_util.h",
+    "libavb/avb_vbmeta_image.c",
+    "libavb/avb_vbmeta_image.h",
+    "libavb/avb_version.c",
+    "libavb/avb_version.h",
+    "libavb_atx/avb_atx_ops.h",
+    "libavb_atx/avb_atx_types.h",
+    "libavb_atx/avb_atx_validate.c",
+    "libavb_atx/avb_atx_validate.h",
+  ]
+  include_dirs = [ "." ]
+  cflags_c = [
+    "-DAVB_COMPILATION",
+    "-Wno-implicit-int-conversion",
+    "-Wno-shorten-64-to-32",
+  ]
+}