Build bootctrl.sdm845 using Android.bp
This is required to build a recovery variant of the
same to be used by fastbootd.
Bug: 78793464
Test: make
Change-Id: I2774c5cdb7013be2f59f10d84cfff94cb1a842c4
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..13d6821
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,34 @@
+soong_namespace {
+}
+
+filegroup {
+ name: "bootctrl_hal_src",
+ srcs: [
+ "boot_control.cpp",
+ ],
+}
+
+cc_defaults {
+ name: "bootctrl_hal_defaults",
+ proprietary: true,
+ recovery_available: true,
+ header_libs: [
+ "libhardware_headers",
+ "libsystem_headers",
+ ],
+ shared_libs: [
+ "libcutils",
+ "liblog",
+ "libz",
+ ],
+ owner: "qti",
+ relative_install_path: "hw",
+ cflags: [
+ "-Wall",
+ "-Werror",
+ ],
+ srcs: [
+ ":bootctrl_hal_src",
+ ],
+
+}
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index 191be1a..0000000
--- a/Android.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-ifeq ($(AB_OTA_UPDATER),true)
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-LOCAL_CFLAGS += -Wall -Werror
-LOCAL_SHARED_LIBRARIES += liblog libcutils
-LOCAL_HEADER_LIBRARIES += libhardware_headers
-LOCAL_SRC_FILES := boot_control.cpp
-LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_MODULE := bootctrl.$(TARGET_BOARD_PLATFORM)
-LOCAL_MODULE_OWNER := qti
-LOCAL_VENDOR_MODULE := true
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_CFLAGS += -Wall -Werror
-LOCAL_SHARED_LIBRARIES += liblog libcutils
-LOCAL_HEADER_LIBRARIES := libhardware_headers
-LOCAL_SRC_FILES := boot_control.cpp
-LOCAL_MODULE := bootctrl.$(TARGET_BOARD_PLATFORM)
-include $(BUILD_STATIC_LIBRARY)
-
-endif