From 9e30997676c4fb49812c74b8580ec63a9b3d890e Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Fri, 11 May 2018 15:13:10 -0700 Subject: Clean up the Makefile for recovery and tests. Reorder librecovery and librecovery_ui, so that librecovery stays closer to recovery (in preparation for later changes that move more files between the two). For the libraries in LOCAL_STATIC_LIBRARIES, reorder them based on the dependency - local modules coming first, with external libraries near the end. Sort the local / external modules, unless a specific order is needed. In tests/Android.mk, split the monolithic list of LOCAL_STATIC_LIBRARIES based on modules. This makes adding / finding libraries easier. There's no functionality in this CL. Test: mmma -j bootable/recovery Change-Id: I6836be574df565001ae9cd3d466a2b6460d90d08 --- Android.mk | 95 +++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 51 insertions(+), 44 deletions(-) (limited to 'Android.mk') diff --git a/Android.mk b/Android.mk index a9631bf41..214d028da 100644 --- a/Android.mk +++ b/Android.mk @@ -28,32 +28,6 @@ recovery_common_cflags := \ -Werror \ -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION) -# librecovery (static library) -# =============================== -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ - install.cpp - -LOCAL_CFLAGS := $(recovery_common_cflags) - -ifeq ($(AB_OTA_UPDATER),true) - LOCAL_CFLAGS += -DAB_OTA_UPDATER=1 -endif - -LOCAL_MODULE := librecovery - -LOCAL_STATIC_LIBRARIES := \ - libminui \ - libotautil \ - libvintf_recovery \ - libcrypto_utils \ - libcrypto \ - libbase \ - libziparchive \ - -include $(BUILD_STATIC_LIBRARY) - # librecovery_ui (static library) # =============================== include $(CLEAR_VARS) @@ -123,6 +97,32 @@ endif include $(BUILD_STATIC_LIBRARY) +# librecovery (static library) +# =============================== +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := \ + install.cpp + +LOCAL_CFLAGS := $(recovery_common_cflags) + +ifeq ($(AB_OTA_UPDATER),true) + LOCAL_CFLAGS += -DAB_OTA_UPDATER=1 +endif + +LOCAL_MODULE := librecovery + +LOCAL_STATIC_LIBRARIES := \ + libminui \ + libotautil \ + libvintf_recovery \ + libcrypto_utils \ + libcrypto \ + libbase \ + libziparchive \ + +include $(BUILD_STATIC_LIBRARY) + # recovery (static executable) # =============================== include $(CLEAR_VARS) @@ -139,18 +139,12 @@ LOCAL_MODULE := recovery LOCAL_FORCE_STATIC_EXECUTABLE := true +LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin + # Cannot link with LLD: undefined symbol: UsbNoPermissionsLongHelpText # http://b/77543887, lld does not handle -Wl,--gc-sections as well as ld. LOCAL_USE_CLANG_LLD := false -LOCAL_REQUIRED_MODULES := e2fsdroid_static mke2fs_static mke2fs.conf - -ifeq ($(TARGET_USERIMAGES_USE_F2FS),true) -ifeq ($(HOST_OS),linux) -LOCAL_REQUIRED_MODULES += sload.f2fs mkfs.f2fs -endif -endif - LOCAL_CFLAGS := $(recovery_common_cflags) LOCAL_C_INCLUDES += \ @@ -159,39 +153,52 @@ LOCAL_C_INCLUDES += \ LOCAL_STATIC_LIBRARIES := \ librecovery \ $(TARGET_RECOVERY_UI_LIB) \ - librecovery_ui \ - libminui \ - libverifier \ libbootloader_message \ libfusesideload \ libminadbd \ + librecovery_ui \ + libminui \ + libverifier \ libotautil \ libasyncio \ libbatterymonitor \ - libfs_mgr \ + libcrypto_utils \ + libcrypto \ libext4_utils \ + libfs_mgr \ libpng \ libsparse \ - libziparchive \ - libcrypto_utils \ - libcrypto \ libvintf_recovery \ libvintf \ libhidl-gen-utils \ libtinyxml2 \ + libziparchive \ libbase \ libcutils \ libutils \ liblog \ libselinux \ - libz + libz \ LOCAL_HAL_STATIC_LIBRARIES := libhealthd -LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin +LOCAL_REQUIRED_MODULES := \ + e2fsdroid_static \ + mke2fs_static \ + mke2fs.conf + +ifeq ($(TARGET_USERIMAGES_USE_F2FS),true) +ifeq ($(HOST_OS),linux) +LOCAL_REQUIRED_MODULES += \ + sload.f2fs \ + mkfs.f2fs +endif +endif ifeq ($(BOARD_CACHEIMAGE_PARTITION_SIZE),) -LOCAL_REQUIRED_MODULES += recovery-persist recovery-refresh +LOCAL_REQUIRED_MODULES += \ + recovery-persist \ + recovery-refresh endif include $(BUILD_EXECUTABLE) -- cgit v1.2.3