summaryrefslogtreecommitdiffstats
path: root/updater/Android.mk
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2019-05-29 19:48:39 +0200
committerandroid-build-merger <android-build-merger@google.com>2019-05-29 19:48:39 +0200
commit36ca5abd94b3990c7e2308e2825033c73da4fc52 (patch)
tree6ddd2652430c5b4e04616deb76f67f77baa6cc1b /updater/Android.mk
parentMerge "recovery: report compliant reboot reason (Part Deux)" am: c0a51a01ce am: 7d0545f14a (diff)
parentMerge "Implement an update simulator to verify BB OTA packages on host" am: 65d7d5b8cf (diff)
downloadandroid_bootable_recovery-36ca5abd94b3990c7e2308e2825033c73da4fc52.tar
android_bootable_recovery-36ca5abd94b3990c7e2308e2825033c73da4fc52.tar.gz
android_bootable_recovery-36ca5abd94b3990c7e2308e2825033c73da4fc52.tar.bz2
android_bootable_recovery-36ca5abd94b3990c7e2308e2825033c73da4fc52.tar.lz
android_bootable_recovery-36ca5abd94b3990c7e2308e2825033c73da4fc52.tar.xz
android_bootable_recovery-36ca5abd94b3990c7e2308e2825033c73da4fc52.tar.zst
android_bootable_recovery-36ca5abd94b3990c7e2308e2825033c73da4fc52.zip
Diffstat (limited to 'updater/Android.mk')
-rw-r--r--updater/Android.mk85
1 files changed, 65 insertions, 20 deletions
diff --git a/updater/Android.mk b/updater/Android.mk
index 0178239e0..b8b5e5a70 100644
--- a/updater/Android.mk
+++ b/updater/Android.mk
@@ -33,7 +33,6 @@ updater_common_static_libraries := \
libfec \
libfec_rs \
libverity_tree \
- libfs_mgr \
libgtest_prod \
liblog \
liblp \
@@ -48,9 +47,24 @@ updater_common_static_libraries := \
libcrypto \
libcrypto_utils \
libcutils \
- libutils \
- libtune2fs \
- $(tune2fs_static_libraries)
+ libutils
+
+
+# Each library in TARGET_RECOVERY_UPDATER_LIBS should have a function
+# named "Register_<libname>()". Here we emit a little C function that
+# gets #included by updater.cpp. It calls all those registration
+# functions.
+# $(1): the path to the register.inc file
+# $(2): a list of TARGET_RECOVERY_UPDATER_LIBS
+define generate-register-inc
+ $(hide) mkdir -p $(dir $(1))
+ $(hide) echo "" > $(1)
+ $(hide) $(foreach lib,$(2),echo "extern void Register_$(lib)(void);" >> $(1);)
+ $(hide) echo "void RegisterDeviceExtensions() {" >> $(1)
+ $(hide) $(foreach lib,$(2),echo " Register_$(lib)();" >> $(1);)
+ $(hide) echo "}" >> $(1)
+endef
+
# updater (static executable)
# ===============================
@@ -69,33 +83,26 @@ LOCAL_CFLAGS := \
-Werror
LOCAL_STATIC_LIBRARIES := \
- libupdater \
+ libupdater_device \
+ libupdater_core \
$(TARGET_RECOVERY_UPDATER_LIBS) \
$(TARGET_RECOVERY_UPDATER_EXTRA_LIBS) \
- $(updater_common_static_libraries)
+ $(updater_common_static_libraries) \
+ libfs_mgr \
+ libtune2fs \
+ $(tune2fs_static_libraries)
-# Each library in TARGET_RECOVERY_UPDATER_LIBS should have a function
-# named "Register_<libname>()". Here we emit a little C function that
-# gets #included by updater.c. It calls all those registration
-# functions.
+LOCAL_MODULE_CLASS := EXECUTABLES
+inc := $(call local-generated-sources-dir)/register.inc
# Devices can also add libraries to TARGET_RECOVERY_UPDATER_EXTRA_LIBS.
# These libs are also linked in with updater, but we don't try to call
# any sort of registration function for these. Use this variable for
# any subsidiary static libraries required for your registered
# extension libs.
-
-LOCAL_MODULE_CLASS := EXECUTABLES
-inc := $(call local-generated-sources-dir)/register.inc
-
$(inc) : libs := $(TARGET_RECOVERY_UPDATER_LIBS)
$(inc) :
- $(hide) mkdir -p $(dir $@)
- $(hide) echo "" > $@
- $(hide) $(foreach lib,$(libs),echo "extern void Register_$(lib)(void);" >> $@;)
- $(hide) echo "void RegisterDeviceExtensions() {" >> $@
- $(hide) $(foreach lib,$(libs),echo " Register_$(lib)();" >> $@;)
- $(hide) echo "}" >> $@
+ $(call generate-register-inc,$@,$(libs))
LOCAL_GENERATED_SOURCES := $(inc)
@@ -104,3 +111,41 @@ inc :=
LOCAL_FORCE_STATIC_EXECUTABLE := true
include $(BUILD_EXECUTABLE)
+
+
+# update_host_simulator (static executable)
+# ===============================
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := update_host_simulator
+
+LOCAL_SRC_FILES := \
+ update_simulator_main.cpp
+
+LOCAL_C_INCLUDES := \
+ $(LOCAL_PATH)/include
+
+LOCAL_CFLAGS := \
+ -Wall \
+ -Werror
+
+LOCAL_STATIC_LIBRARIES := \
+ libupdater_host \
+ libupdater_core \
+ $(TARGET_RECOVERY_UPDATER_HOST_LIBS) \
+ $(TARGET_RECOVERY_UPDATER_HOST_EXTRA_LIBS) \
+ $(updater_common_static_libraries) \
+ libfstab
+
+LOCAL_MODULE_CLASS := EXECUTABLES
+inc := $(call local-generated-sources-dir)/register.inc
+
+$(inc) : libs := $(TARGET_RECOVERY_UPDATER_HOST_LIBS)
+$(inc) :
+ $(call generate-register-inc,$@,$(libs))
+
+LOCAL_GENERATED_SOURCES := $(inc)
+
+inc :=
+
+include $(BUILD_HOST_EXECUTABLE)