summaryrefslogtreecommitdiffstats
path: root/updater/Android.mk
diff options
context:
space:
mode:
Diffstat (limited to 'updater/Android.mk')
-rw-r--r--updater/Android.mk117
1 files changed, 76 insertions, 41 deletions
diff --git a/updater/Android.mk b/updater/Android.mk
index d7aa613e9..5d328a3fa 100644
--- a/updater/Android.mk
+++ b/updater/Android.mk
@@ -14,52 +14,89 @@
LOCAL_PATH := $(call my-dir)
-updater_src_files := \
- install.cpp \
- blockimg.cpp \
- updater.cpp
-
-#
-# Build a statically-linked binary to include in OTA packages
-#
+tune2fs_static_libraries := \
+ libext2_com_err \
+ libext2_blkid \
+ libext2_quota \
+ libext2_uuid_static \
+ libext2_e2p \
+ libext2fs
+
+updater_common_static_libraries := \
+ libapplypatch \
+ libedify \
+ libziparchive \
+ libotautil \
+ libbootloader_message \
+ libutils \
+ libmounts \
+ libotafault \
+ libext4_utils_static \
+ libfec \
+ libfec_rs \
+ libfs_mgr \
+ liblog \
+ libselinux \
+ libsparse_static \
+ libsquashfs_utils \
+ libbz \
+ libz \
+ libbase \
+ libcrypto \
+ libcrypto_utils \
+ libcutils \
+ libtune2fs \
+ $(tune2fs_static_libraries)
+
+# libupdater (static library)
+# ===============================
include $(CLEAR_VARS)
-# Build only in eng, so we don't end up with a copy of this in /system
-# on user builds. (TODO: find a better way to build device binaries
-# needed only for OTA packages.)
-LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE := libupdater
-LOCAL_CLANG := true
+LOCAL_SRC_FILES := \
+ install.cpp \
+ blockimg.cpp
-LOCAL_SRC_FILES := $(updater_src_files)
+LOCAL_C_INCLUDES := \
+ $(LOCAL_PATH)/.. \
+ $(LOCAL_PATH)/include \
+ external/e2fsprogs/misc
-LOCAL_STATIC_LIBRARIES += libfec libfec_rs libext4_utils_static libsquashfs_utils libcrypto_static
+LOCAL_CFLAGS := \
+ -Wno-unused-parameter \
+ -Werror
-ifeq ($(TARGET_USERIMAGES_USE_EXT4), true)
-LOCAL_CFLAGS += -DUSE_EXT4
-LOCAL_CFLAGS += -Wno-unused-parameter
-LOCAL_C_INCLUDES += system/extras/ext4_utils
-LOCAL_STATIC_LIBRARIES += \
- libsparse_static \
- libz
-endif
-
-LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UPDATER_LIBS) $(TARGET_RECOVERY_UPDATER_EXTRA_LIBS)
-LOCAL_STATIC_LIBRARIES += libapplypatch libbase libotafault libedify libmtdutils libminzip libz
-LOCAL_STATIC_LIBRARIES += libbz
-LOCAL_STATIC_LIBRARIES += libcutils liblog libc
-LOCAL_STATIC_LIBRARIES += libselinux
-tune2fs_static_libraries := \
- libext2_com_err \
- libext2_blkid \
- libext2_quota \
- libext2_uuid_static \
- libext2_e2p \
- libext2fs
-LOCAL_STATIC_LIBRARIES += libtune2fs $(tune2fs_static_libraries)
+LOCAL_EXPORT_C_INCLUDE_DIRS := \
+ $(LOCAL_PATH)/include
+
+LOCAL_STATIC_LIBRARIES := \
+ $(updater_common_static_libraries)
+
+include $(BUILD_STATIC_LIBRARY)
-LOCAL_C_INCLUDES += external/e2fsprogs/misc
-LOCAL_C_INCLUDES += $(LOCAL_PATH)/..
+# updater (static executable)
+# ===============================
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := updater
+
+LOCAL_SRC_FILES := \
+ updater.cpp
+
+LOCAL_C_INCLUDES := \
+ $(LOCAL_PATH)/.. \
+ $(LOCAL_PATH)/include
+
+LOCAL_CFLAGS := \
+ -Wno-unused-parameter \
+ -Werror
+
+LOCAL_STATIC_LIBRARIES := \
+ libupdater \
+ $(TARGET_RECOVERY_UPDATER_LIBS) \
+ $(TARGET_RECOVERY_UPDATER_EXTRA_LIBS) \
+ $(updater_common_static_libraries)
# Each library in TARGET_RECOVERY_UPDATER_LIBS should have a function
# named "Register_<libname>()". Here we emit a little C function that
@@ -100,8 +137,6 @@ LOCAL_C_INCLUDES += $(dir $(inc))
inc :=
inc_dep_file :=
-LOCAL_MODULE := updater
-
LOCAL_FORCE_STATIC_EXECUTABLE := true
include $(BUILD_EXECUTABLE)