Commit 8373cfe2 authored by Ethan Yonker's avatar Ethan Yonker

Update to AOSP 8.0 base

Change-Id: I29fe722b4eb9718765327902779046840a01433e
parents 95e80075 43348a62
BasedOnStyle: Google
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: true
ColumnLimit: 100
CommentPragmas: NOLINT:.*
DerivePointerAlignment: false
IndentWidth: 2
PointerAlignment: Left
TabWidth: 2
UseTab: Never
PenaltyExcessCharacter: 32
Cpp11BracedListStyle: false
...@@ -104,24 +104,25 @@ LOCAL_CLANG := true ...@@ -104,24 +104,25 @@ LOCAL_CLANG := true
LOCAL_C_INCLUDES += \ LOCAL_C_INCLUDES += \
system/vold \ system/vold \
system/extras/ext4_utils \ system/extras \
system/core/adb \ system/core/adb \
system/core/libsparse \ system/core/libsparse \
external/zlib external/zlib \
$(LOCAL_PATH)/bootloader_message_twrp/include
LOCAL_C_INCLUDES += bionic LOCAL_C_INCLUDES += bionic
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0) ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
LOCAL_C_INCLUDES += external/stlport/stlport external/openssl/include LOCAL_C_INCLUDES += external/stlport/stlport external/openssl/include
else else
LOCAL_C_INCLUDES += external/boringssl/include LOCAL_C_INCLUDES += external/boringssl/include external/libcxx/include
endif endif
LOCAL_STATIC_LIBRARIES := LOCAL_STATIC_LIBRARIES :=
LOCAL_SHARED_LIBRARIES := LOCAL_SHARED_LIBRARIES :=
LOCAL_STATIC_LIBRARIES += libguitwrp LOCAL_STATIC_LIBRARIES += libguitwrp
LOCAL_SHARED_LIBRARIES += libaosprecovery libz libc libcutils libstdc++ libtar libblkid libminuitwrp libminadbd libmtdutils libminzip libtwadbbu libbootloader_message LOCAL_SHARED_LIBRARIES += libaosprecovery libz libc libcutils libstdc++ libtar libblkid libminuitwrp libminadbd libmtdutils libtwadbbu libbootloader_message_twrp
LOCAL_SHARED_LIBRARIES += libcrecovery libtwadbbu libtwrpdigest LOCAL_SHARED_LIBRARIES += libcrecovery libtwadbbu libtwrpdigest libc++
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0) ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
LOCAL_SHARED_LIBRARIES += libstlport LOCAL_SHARED_LIBRARIES += libstlport
...@@ -132,13 +133,20 @@ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 24; echo $$?),0) ...@@ -132,13 +133,20 @@ ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 24; echo $$?),0)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/libmincrypt/includes LOCAL_C_INCLUDES += $(LOCAL_PATH)/libmincrypt/includes
LOCAL_CFLAGS += -DUSE_OLD_VERIFIER LOCAL_CFLAGS += -DUSE_OLD_VERIFIER
else else
LOCAL_SHARED_LIBRARIES += libc++ libcrypto LOCAL_SHARED_LIBRARIES += libcrypto
endif endif
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 24; echo $$?),0) ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 24; echo $$?),0)
LOCAL_SHARED_LIBRARIES += libbase LOCAL_SHARED_LIBRARIES += libbase
endif endif
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26; echo $$?),0)
LOCAL_SHARED_LIBRARIES += libziparchive
else
LOCAL_SHARED_LIBRARIES += libminzip
LOCAL_CFLAGS += -DUSE_MINZIP
endif
ifneq ($(wildcard system/core/libsparse/Android.mk),) ifneq ($(wildcard system/core/libsparse/Android.mk),)
LOCAL_SHARED_LIBRARIES += libsparse LOCAL_SHARED_LIBRARIES += libsparse
endif endif
...@@ -161,14 +169,14 @@ ifeq ($(TARGET_USERIMAGES_USE_EXT4), true) ...@@ -161,14 +169,14 @@ ifeq ($(TARGET_USERIMAGES_USE_EXT4), true)
endif endif
LOCAL_C_INCLUDES += external/libselinux/include LOCAL_C_INCLUDES += external/libselinux/include
LOCAL_SHARED_LIBRARIES += libselinux LOCAL_SHARED_LIBRARIES += libselinux
ifneq ($(TARGET_USERIMAGES_USE_EXT4), true) #ifneq ($(TARGET_USERIMAGES_USE_EXT4), true)
LOCAL_CFLAGS += -DUSE_EXT4 # LOCAL_CFLAGS += -DUSE_EXT4
LOCAL_C_INCLUDES += system/extras/ext4_utils # LOCAL_C_INCLUDES += system/extras/ext4_utils
LOCAL_SHARED_LIBRARIES += libext4_utils # LOCAL_SHARED_LIBRARIES += libext4_utils
ifneq ($(wildcard external/lz4/Android.mk),) # ifneq ($(wildcard external/lz4/Android.mk),)
LOCAL_STATIC_LIBRARIES += liblz4 # LOCAL_STATIC_LIBRARIES += liblz4
endif # endif
endif #endif
ifeq ($(AB_OTA_UPDATER),true) ifeq ($(AB_OTA_UPDATER),true)
LOCAL_CFLAGS += -DAB_OTA_UPDATER=1 LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
...@@ -304,7 +312,7 @@ ifeq ($(TW_INCLUDE_CRYPTO), true) ...@@ -304,7 +312,7 @@ ifeq ($(TW_INCLUDE_CRYPTO), true)
endif endif
endif endif
WITH_CRYPTO_UTILS := \ WITH_CRYPTO_UTILS := \
$(if $(wildcard system/core/libcrypto_utils/Android.mk),true) $(if $(wildcard system/core/libcrypto_utils/android_pubkey.c),true)
ifeq ($(TW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID), true) ifeq ($(TW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID), true)
LOCAL_CFLAGS += -DTW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID LOCAL_CFLAGS += -DTW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID
endif endif
...@@ -370,7 +378,8 @@ LOCAL_ADDITIONAL_DEPENDENCIES += \ ...@@ -370,7 +378,8 @@ LOCAL_ADDITIONAL_DEPENDENCIES += \
mkfs.fat \ mkfs.fat \
permissive.sh \ permissive.sh \
simg2img_twrp \ simg2img_twrp \
libbootloader_message \ libbootloader_message_twrp \
init.recovery.hlthchrg.rc \
init.recovery.service.rc init.recovery.service.rc
ifneq ($(TARGET_ARCH), arm64) ifneq ($(TARGET_ARCH), arm64)
...@@ -589,6 +598,37 @@ else ...@@ -589,6 +598,37 @@ else
endif endif
include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY)
# libmounts (static library)
# ===============================
include $(CLEAR_VARS)
LOCAL_SRC_FILES := mounts.cpp
LOCAL_CLANG := true
LOCAL_CFLAGS := -Wall -Wno-unused-parameter -Werror
LOCAL_MODULE := libmounts
include $(BUILD_STATIC_LIBRARY)
# librecovery (static library)
# ===============================
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
install.cpp
LOCAL_CFLAGS := -Wno-unused-parameter -Werror
LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
ifeq ($(AB_OTA_UPDATER),true)
LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
endif
LOCAL_MODULE := librecovery
LOCAL_STATIC_LIBRARIES := \
libminui \
libvintf_recovery \
libcrypto_utils \
libcrypto \
libbase
include $(BUILD_STATIC_LIBRARY)
# shared libaosprecovery for Apache code # shared libaosprecovery for Apache code
# =============================== # ===============================
include $(CLEAR_VARS) include $(CLEAR_VARS)
...@@ -596,7 +636,7 @@ include $(CLEAR_VARS) ...@@ -596,7 +636,7 @@ include $(CLEAR_VARS)
LOCAL_MODULE := libaosprecovery LOCAL_MODULE := libaosprecovery
LOCAL_MODULE_TAGS := eng optional LOCAL_MODULE_TAGS := eng optional
LOCAL_CFLAGS := -std=gnu++0x LOCAL_CFLAGS := -std=gnu++0x
LOCAL_SRC_FILES := adb_install.cpp asn1_decoder.cpp legacy_property_service.cpp set_metadata.cpp tw_atomic.cpp installcommand.cpp LOCAL_SRC_FILES := adb_install.cpp legacy_property_service.cpp set_metadata.cpp tw_atomic.cpp installcommand.cpp zipwrap.cpp
LOCAL_SHARED_LIBRARIES += libc liblog libcutils libmtdutils libfusesideload libselinux libminzip LOCAL_SHARED_LIBRARIES += libc liblog libcutils libmtdutils libfusesideload libselinux libminzip
LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION) LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0) ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 23; echo $$?),0)
...@@ -608,15 +648,23 @@ endif ...@@ -608,15 +648,23 @@ endif
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 24; echo $$?),0) ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 24; echo $$?),0)
LOCAL_SHARED_LIBRARIES += libmincrypttwrp LOCAL_SHARED_LIBRARIES += libmincrypttwrp
LOCAL_C_INCLUDES += $(LOCAL_PATH)/libmincrypt/includes LOCAL_C_INCLUDES += $(LOCAL_PATH)/libmincrypt/includes
LOCAL_SRC_FILES += verifier24/verifier.cpp LOCAL_SRC_FILES += verifier24/verifier.cpp verifier24/asn1_decoder.cpp
LOCAL_CFLAGS += -DUSE_OLD_VERIFIER LOCAL_CFLAGS += -DUSE_OLD_VERIFIER
else else
LOCAL_SHARED_LIBRARIES += libcrypto libbase LOCAL_SHARED_LIBRARIES += libcrypto libbase
LOCAL_SRC_FILES += verifier.cpp LOCAL_SRC_FILES += verifier.cpp asn1_decoder.cpp
endif endif
ifeq ($(AB_OTA_UPDATER),true) ifeq ($(AB_OTA_UPDATER),true)
LOCAL_CFLAGS += -DAB_OTA_UPDATER=1 LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
endif endif
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 26; echo $$?),0)
LOCAL_SRC_FILES += otautil/ZipUtil.cpp otautil/SysUtil.cpp
LOCAL_SHARED_LIBRARIES += libziparchive libext4_utils libcrypto libcrypto_utils
LOCAL_STATIC_LIBRARIES += libvintf_recovery libfs_mgr liblogwrap libavb libvintf libtinyxml2 libz
LOCAL_WHOLE_STATIC_LIBRARIES +=
else
LOCAL_CFLAGS += -DUSE_MINZIP
endif
include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY)
...@@ -638,6 +686,7 @@ include $(LOCAL_PATH)/tests/Android.mk \ ...@@ -638,6 +686,7 @@ include $(LOCAL_PATH)/tests/Android.mk \
$(LOCAL_PATH)/edify/Android.mk \ $(LOCAL_PATH)/edify/Android.mk \
$(LOCAL_PATH)/otafault/Android.mk \ $(LOCAL_PATH)/otafault/Android.mk \
$(LOCAL_PATH)/bootloader_message/Android.mk \ $(LOCAL_PATH)/bootloader_message/Android.mk \
$(LOCAL_PATH)/bootloader_message_twrp/Android.mk \
$(LOCAL_PATH)/updater/Android.mk \ $(LOCAL_PATH)/updater/Android.mk \
$(LOCAL_PATH)/update_verifier/Android.mk \ $(LOCAL_PATH)/update_verifier/Android.mk \
$(LOCAL_PATH)/applypatch/Android.mk $(LOCAL_PATH)/applypatch/Android.mk
...@@ -647,6 +696,10 @@ ifeq ($(wildcard system/core/uncrypt/Android.mk),) ...@@ -647,6 +696,10 @@ ifeq ($(wildcard system/core/uncrypt/Android.mk),)
endif endif
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 22; echo $$?),0) ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 22; echo $$?),0)
ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 26; echo $$?),0)
TARGET_GLOBAL_CFLAGS += -DTW_USE_MINUI_WITH_DATA
CLANG_TARGET_GLOBAL_CFLAGS += -DTW_USE_MINUI_WITH_DATA
endif
include $(commands_recovery_local_path)/minadbd/Android.mk \ include $(commands_recovery_local_path)/minadbd/Android.mk \
$(commands_recovery_local_path)/minui/Android.mk $(commands_recovery_local_path)/minui/Android.mk
else else
...@@ -669,6 +722,7 @@ include $(commands_recovery_local_path)/injecttwrp/Android.mk \ ...@@ -669,6 +722,7 @@ include $(commands_recovery_local_path)/injecttwrp/Android.mk \
$(commands_recovery_local_path)/libcrecovery/Android.mk \ $(commands_recovery_local_path)/libcrecovery/Android.mk \
$(commands_recovery_local_path)/libblkid/Android.mk \ $(commands_recovery_local_path)/libblkid/Android.mk \
$(commands_recovery_local_path)/minuitwrp/Android.mk \ $(commands_recovery_local_path)/minuitwrp/Android.mk \
$(commands_recovery_local_path)/otautil/Android.mk \
$(commands_recovery_local_path)/openaes/Android.mk \ $(commands_recovery_local_path)/openaes/Android.mk \
$(commands_recovery_local_path)/toolbox/Android.mk \ $(commands_recovery_local_path)/toolbox/Android.mk \
$(commands_recovery_local_path)/twrpTarMain/Android.mk \ $(commands_recovery_local_path)/twrpTarMain/Android.mk \
......
**Team Win Recovery Project (TWRP)** **Team Win Recovery Project (TWRP)**
You can find a compiling guide [here](http://forum.xda-developers.com/showthread.php?t=1943625 "Guide"). You can find a compiling guide [here](http://forum.xda-developers.com/showthread.php?t=1943625 "Guide").
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#include "ui.h" #include "ui.h"
#include "cutils/properties.h" #include "cutils/properties.h"
#include "install.h"
#include "common.h"
#include "adb_install.h" #include "adb_install.h"
#include "minadbd/fuse_adb_provider.h" #include "minadbd/fuse_adb_provider.h"
#include "fuse_sideload.h" #include "fuse_sideload.h"
...@@ -37,10 +39,7 @@ ...@@ -37,10 +39,7 @@
#include "verifier.h" #include "verifier.h"
#endif #endif
static RecoveryUI* ui = NULL; static void set_usb_driver(bool enabled) {
void
set_usb_driver(bool enabled) {
int fd = open("/sys/class/android_usb/android0/enable", O_WRONLY); int fd = open("/sys/class/android_usb/android0/enable", O_WRONLY);
if (fd < 0) { if (fd < 0) {
/* These error messages show when built in older Android branches (e.g. Gingerbread) /* These error messages show when built in older Android branches (e.g. Gingerbread)
...@@ -65,20 +64,18 @@ set_usb_driver(bool enabled) { ...@@ -65,20 +64,18 @@ set_usb_driver(bool enabled) {
} }
} }
static void static void stop_adbd() {
stop_adbd() { printf("Stopping adbd...\n");
property_set("ctl.stop", "adbd"); property_set("ctl.stop", "adbd");
set_usb_driver(false); set_usb_driver(false);
} }
bool is_ro_debuggable() { static bool is_ro_debuggable() {
char value[PROPERTY_VALUE_MAX+1]; char value[PROPERTY_VALUE_MAX+1];
return (property_get("ro.debuggable", value, NULL) == 1 && value[0] == '1'); return (property_get("ro.debuggable", value, NULL) == 1 && value[0] == '1');
} }
void static void maybe_restart_adbd() {
maybe_restart_adbd() {
char value[PROPERTY_VALUE_MAX+1];
if (is_ro_debuggable()) { if (is_ro_debuggable()) {
printf("Restarting adbd...\n"); printf("Restarting adbd...\n");
set_usb_driver(true); set_usb_driver(true);
...@@ -96,6 +93,12 @@ apply_from_adb(const char* install_file, pid_t* child_pid) { ...@@ -96,6 +93,12 @@ apply_from_adb(const char* install_file, pid_t* child_pid) {
stop_adbd(); stop_adbd();
set_usb_driver(true); set_usb_driver(true);
/* /*
int apply_from_adb(RecoveryUI* ui, bool* wipe_cache, const char* install_file) {
modified_flash = true;
stop_adbd(ui);
set_usb_driver(ui, true);
ui->Print("\n\nNow send the package you want to apply\n" ui->Print("\n\nNow send the package you want to apply\n"
"to the device with \"adb sideload <filename>\"...\n"); "to the device with \"adb sideload <filename>\"...\n");
*/ */
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
//class RecoveryUI; //class RecoveryUI;
void set_usb_driver(bool enabled); static void set_usb_driver(bool enabled);
void maybe_restart_adbd(); static void maybe_restart_adbd();
int apply_from_adb(const char* install_file, pid_t* child_pid); int apply_from_adb(const char* install_file, pid_t* child_pid);
#endif #endif
...@@ -31,6 +31,7 @@ $(foreach board_define,$(BOARD_RECOVERY_DEFINES), \ ...@@ -31,6 +31,7 @@ $(foreach board_define,$(BOARD_RECOVERY_DEFINES), \
) )
LOCAL_C_INCLUDES += \ LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/include \
external/bzip2 \ external/bzip2 \
external/zlib \ external/zlib \
$(commands_recovery_local_path) $(commands_recovery_local_path)
...@@ -42,27 +43,99 @@ LOCAL_MODULE_TAGS := eng ...@@ -42,27 +43,99 @@ LOCAL_MODULE_TAGS := eng
LOCAL_C_INCLUDES += $(RECOVERY_PATH) LOCAL_C_INCLUDES += $(RECOVERY_PATH)
LOCAL_STATIC_LIBRARIES += libbase libotafault libmtdutils libcrypto_static libbz libz LOCAL_STATIC_LIBRARIES += libbase libotafault libmtdutils libcrypto_static libbz libz
# libapplypatch (static library)
# ===============================
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
applypatch.cpp \
bspatch.cpp \
freecache.cpp \
imgpatch.cpp
LOCAL_MODULE := libapplypatch
LOCAL_MODULE_TAGS := eng
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include \
$(commands_recovery_local_path)
LOCAL_STATIC_LIBRARIES := \
libotafault \
libbase \
libcrypto \
libbspatch \
libbz \
libz
LOCAL_WHOLE_STATIC_LIBRARIES += libmtdutils
LOCAL_CFLAGS := \
-DZLIB_CONST \
-Werror
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
# libimgpatch (static library)
# ===============================
include $(CLEAR_VARS) include $(CLEAR_VARS)
ifeq ($(HOST_OS),linux) LOCAL_SRC_FILES := \
include $(CLEAR_VARS) bspatch.cpp \
imgpatch.cpp
LOCAL_MODULE := libimgpatch
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include \
$(commands_recovery_local_path)
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
LOCAL_STATIC_LIBRARIES := \
libcrypto \
libbspatch \
libbase \
libbz \
libz
LOCAL_CFLAGS := \
-DZLIB_CONST \
-Werror
include $(BUILD_STATIC_LIBRARY)
LOCAL_CLANG := true # libimgpatch (host static library)
LOCAL_SRC_FILES := bspatch.cpp imgpatch.cpp utils.cpp # ===============================
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
bspatch.cpp \
imgpatch.cpp
LOCAL_MODULE := libimgpatch LOCAL_MODULE := libimgpatch
LOCAL_C_INCLUDES += $(RECOVERY_PATH) LOCAL_C_INCLUDES += $(RECOVERY_PATH)
LOCAL_MODULE_HOST_OS := linux
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include \
$(commands_recovery_local_path)
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
LOCAL_STATIC_LIBRARIES += libcrypto_static libbz libz LOCAL_STATIC_LIBRARIES := \
libcrypto \
libbspatch \
libbase \
libbz \
libz
LOCAL_CFLAGS := \
-DZLIB_CONST \
-Werror
include $(BUILD_HOST_STATIC_LIBRARY) include $(BUILD_HOST_STATIC_LIBRARY)
endif # HOST_OS == linux
# libapplypatch_modes (static library)
# ===============================
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
applypatch_modes.cpp
LOCAL_MODULE := libapplypatch_modes
LOCAL_C_INCLUDES := $(commands_recovery_local_path)
LOCAL_STATIC_LIBRARIES := \
libapplypatch \
libbase \
libedify \
libcrypto
LOCAL_CFLAGS := -Werror
include $(BUILD_STATIC_LIBRARY)
LOCAL_CLANG := true # applypatch (target executable)
LOCAL_SRC_FILES := main.cpp # ===============================
include $(CLEAR_VARS)
LOCAL_SRC_FILES := applypatch_main.cpp
LOCAL_MODULE := applypatch LOCAL_MODULE := applypatch
LOCAL_C_INCLUDES += $(RECOVERY_PATH) LOCAL_C_INCLUDES += $(RECOVERY_PATH)
LOCAL_STATIC_LIBRARIES += libapplypatch libbase libotafault libmtdutils libcrypto_static libbz \ LOCAL_STATIC_LIBRARIES += libapplypatch libbase libotafault libmtdutils libcrypto_static libbz \
...@@ -70,15 +143,78 @@ LOCAL_STATIC_LIBRARIES += libapplypatch libbase libotafault libmtdutils libcrypt ...@@ -70,15 +143,78 @@ LOCAL_STATIC_LIBRARIES += libapplypatch libbase libotafault libmtdutils libcrypt
LOCAL_SHARED_LIBRARIES += libz libcutils libc LOCAL_SHARED_LIBRARIES += libz libcutils libc
LOCAL_C_INCLUDES := $(commands_recovery_local_path)
LOCAL_STATIC_LIBRARIES := \
libapplypatch_modes \
libapplypatch \
libbase \
libedify \
libotafault \
libcrypto \
libbspatch \
libbz
LOCAL_SHARED_LIBRARIES := \
libbase \
libz \
libcutils
LOCAL_CFLAGS := -Werror
include $(BUILD_EXECUTABLE) include $(BUILD_EXECUTABLE)
libimgdiff_src_files := imgdiff.cpp
# libbsdiff is compiled with -D_FILE_OFFSET_BITS=64.
libimgdiff_cflags := \
-Werror \
-D_FILE_OFFSET_BITS=64
libimgdiff_static_libraries := \
libbsdiff \
libdivsufsort \
libdivsufsort64 \
libziparchive \
libutils \
liblog \
libbase \
libz
# libimgdiff (static library)
# ===============================
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(libimgdiff_src_files)
LOCAL_MODULE := libimgdiff
LOCAL_CFLAGS := \
$(libimgdiff_cflags)
LOCAL_STATIC_LIBRARIES := \
$(libimgdiff_static_libraries)
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
include $(BUILD_STATIC_LIBRARY)
LOCAL_CLANG := true # libimgdiff (host static library)
LOCAL_SRC_FILES := imgdiff.cpp utils.cpp bsdiff.cpp # ===============================
LOCAL_MODULE := imgdiff include $(CLEAR_VARS)
LOCAL_FORCE_STATIC_EXECUTABLE := true LOCAL_SRC_FILES := \
LOCAL_C_INCLUDES += external/zlib external/bzip2 $(libimgdiff_src_files)
LOCAL_STATIC_LIBRARIES += libz libbz LOCAL_MODULE := libimgdiff
LOCAL_CFLAGS := \
$(libimgdiff_cflags)
LOCAL_STATIC_LIBRARIES := \
$(libimgdiff_static_libraries)
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/include
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
include $(BUILD_HOST_STATIC_LIBRARY)
# imgdiff (host static executable)
# ===============================
include $(CLEAR_VARS)
LOCAL_SRC_FILES := imgdiff_main.cpp
LOCAL_MODULE := imgdiff
LOCAL_CFLAGS := -Werror
LOCAL_STATIC_LIBRARIES := \
libimgdiff \
$(libimgdiff_static_libraries) \
libbz
include $(BUILD_HOST_EXECUTABLE) include $(BUILD_HOST_EXECUTABLE)
# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This file is for building imgdiff in Chrome OS.
CPPFLAGS += -iquote.. -Iinclude
CXXFLAGS += -std=c++11 -O3 -Wall -Werror
LDLIBS += -lbz2 -lz
.PHONY: all clean
all: imgdiff libimgpatch.a
clean:
rm -f *.o imgdiff libimgpatch.a
imgdiff: imgdiff.o bsdiff.o utils.o
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDLIBS) -o $@ $^
libimgpatch.a utils.o: CXXFLAGS += -fPIC
libimgpatch.a: imgpatch.o bspatch.o utils.o
${AR} rcs $@ $^
This diff is collapsed.
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/