summaryrefslogtreecommitdiffstats
path: root/applypatch/Android.mk
diff options
context:
space:
mode:
Diffstat (limited to 'applypatch/Android.mk')
-rw-r--r--applypatch/Android.mk50
1 files changed, 44 insertions, 6 deletions
diff --git a/applypatch/Android.mk b/applypatch/Android.mk
index a7412d238..9cbe3e2a9 100644
--- a/applypatch/Android.mk
+++ b/applypatch/Android.mk
@@ -14,6 +14,35 @@
LOCAL_PATH := $(call my-dir)
+ifdef project-path-for
+ RECOVERY_PATH := $(call project-path-for,recovery)
+else
+ RECOVERY_PATH := bootable/recovery
+endif
+
+include $(CLEAR_VARS)
+
+BOARD_RECOVERY_DEFINES := BOARD_BML_BOOT BOARD_BML_RECOVERY
+
+$(foreach board_define,$(BOARD_RECOVERY_DEFINES), \
+ $(if $($(board_define)), \
+ $(eval LOCAL_CFLAGS += -D$(board_define)=\"$($(board_define))\") \
+ ) \
+ )
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/include \
+ external/bzip2 \
+ external/zlib \
+ $(commands_recovery_local_path)
+
+LOCAL_CLANG := true
+LOCAL_SRC_FILES := applypatch.cpp bspatch.cpp freecache.cpp imgpatch.cpp utils.cpp
+LOCAL_MODULE := libapplypatch
+LOCAL_MODULE_TAGS := eng
+LOCAL_C_INCLUDES += $(RECOVERY_PATH)
+LOCAL_STATIC_LIBRARIES += libbase libotafault libmtdutils libcrypto_static libbz libz
+
# libapplypatch (static library)
# ===============================
include $(CLEAR_VARS)
@@ -24,10 +53,10 @@ LOCAL_SRC_FILES := \
imgpatch.cpp
LOCAL_MODULE := libapplypatch
LOCAL_MODULE_TAGS := eng
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include \
- bootable/recovery
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
+ $(commands_recovery_local_path)
LOCAL_STATIC_LIBRARIES := \
libotafault \
libbase \
@@ -35,6 +64,7 @@ LOCAL_STATIC_LIBRARIES := \
libbspatch \
libbz \
libz
+LOCAL_WHOLE_STATIC_LIBRARIES += libmtdutils
LOCAL_CFLAGS := \
-DZLIB_CONST \
-Werror
@@ -43,13 +73,14 @@ include $(BUILD_STATIC_LIBRARY)
# libimgpatch (static library)
# ===============================
include $(CLEAR_VARS)
+
LOCAL_SRC_FILES := \
bspatch.cpp \
imgpatch.cpp
LOCAL_MODULE := libimgpatch
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include \
- bootable/recovery
+ $(commands_recovery_local_path)
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
LOCAL_STATIC_LIBRARIES := \
libcrypto \
@@ -69,10 +100,11 @@ LOCAL_SRC_FILES := \
bspatch.cpp \
imgpatch.cpp
LOCAL_MODULE := libimgpatch
+LOCAL_C_INCLUDES += $(RECOVERY_PATH)
LOCAL_MODULE_HOST_OS := linux
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include \
- bootable/recovery
+ $(commands_recovery_local_path)
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
LOCAL_STATIC_LIBRARIES := \
libcrypto \
@@ -91,7 +123,7 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
applypatch_modes.cpp
LOCAL_MODULE := libapplypatch_modes
-LOCAL_C_INCLUDES := bootable/recovery
+LOCAL_C_INCLUDES := $(commands_recovery_local_path)
LOCAL_STATIC_LIBRARIES := \
libapplypatch \
libbase \
@@ -105,7 +137,13 @@ include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := applypatch_main.cpp
LOCAL_MODULE := applypatch
-LOCAL_C_INCLUDES := bootable/recovery
+LOCAL_C_INCLUDES += $(RECOVERY_PATH)
+LOCAL_STATIC_LIBRARIES += libapplypatch libbase libotafault libmtdutils libcrypto_static libbz \
+ libedify \
+
+LOCAL_SHARED_LIBRARIES += libz libcutils libc
+
+LOCAL_C_INCLUDES := $(commands_recovery_local_path)
LOCAL_STATIC_LIBRARIES := \
libapplypatch_modes \
libapplypatch \