Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 1 | # Copyright (C) 2008 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 15 | LOCAL_PATH := $(call my-dir) |
Tao Bao | 80e46e0 | 2015-06-03 10:49:29 -0700 | [diff] [blame] | 16 | |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 17 | # libapplypatch (static library) |
| 18 | # =============================== |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 19 | include $(CLEAR_VARS) |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 20 | LOCAL_SRC_FILES := \ |
| 21 | applypatch.cpp \ |
| 22 | bspatch.cpp \ |
| 23 | freecache.cpp \ |
Tianjie Xu | 12b9055 | 2017-03-07 14:44:14 -0800 | [diff] [blame] | 24 | imgpatch.cpp |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 25 | LOCAL_MODULE := libapplypatch |
bigbiff | d58ba18 | 2020-03-23 10:02:29 -0400 | [diff] [blame] | 26 | LOCAL_MODULE_TAGS := optional |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 27 | LOCAL_C_INCLUDES := \ |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 28 | $(LOCAL_PATH)/include \ |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 29 | $(commands_recovery_local_path) |
Michael Bestas | 608d566 | 2018-01-10 18:30:37 +0200 | [diff] [blame] | 30 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 31 | LOCAL_STATIC_LIBRARIES := \ |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 32 | libotafault \ |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 33 | libbase \ |
Josh Gao | 073164f | 2016-08-05 15:59:05 -0700 | [diff] [blame] | 34 | libcrypto \ |
Sen Jiang | 25c5697 | 2016-05-10 15:23:25 -0700 | [diff] [blame] | 35 | libbspatch \ |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 36 | libbz \ |
| 37 | libz |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 38 | LOCAL_WHOLE_STATIC_LIBRARIES += libmtdutils |
Tao Bao | 087bc0c | 2017-01-19 10:46:39 -0800 | [diff] [blame] | 39 | LOCAL_CFLAGS := \ |
| 40 | -DZLIB_CONST \ |
| 41 | -Werror |
Michael Bestas | 608d566 | 2018-01-10 18:30:37 +0200 | [diff] [blame] | 42 | |
| 43 | BOARD_RECOVERY_DEFINES := BOARD_BML_BOOT BOARD_BML_RECOVERY |
| 44 | |
| 45 | $(foreach board_define,$(BOARD_RECOVERY_DEFINES), \ |
| 46 | $(if $($(board_define)), \ |
| 47 | $(eval LOCAL_CFLAGS += -D$(board_define)=\"$($(board_define))\") \ |
| 48 | ) \ |
| 49 | ) |
| 50 | |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 51 | include $(BUILD_STATIC_LIBRARY) |
| 52 | |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 53 | # libimgpatch (static library) |
| 54 | # =============================== |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 55 | include $(CLEAR_VARS) |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 56 | LOCAL_SRC_FILES := \ |
| 57 | bspatch.cpp \ |
Tianjie Xu | 12b9055 | 2017-03-07 14:44:14 -0800 | [diff] [blame] | 58 | imgpatch.cpp |
Sen Jiang | 0cce9cd | 2016-01-22 20:49:07 +0800 | [diff] [blame] | 59 | LOCAL_MODULE := libimgpatch |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 60 | LOCAL_C_INCLUDES := \ |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 61 | $(LOCAL_PATH)/include \ |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 62 | $(commands_recovery_local_path) |
Sen Jiang | 0cce9cd | 2016-01-22 20:49:07 +0800 | [diff] [blame] | 63 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 64 | LOCAL_STATIC_LIBRARIES := \ |
| 65 | libcrypto \ |
Sen Jiang | 25c5697 | 2016-05-10 15:23:25 -0700 | [diff] [blame] | 66 | libbspatch \ |
Tianjie Xu | 12b9055 | 2017-03-07 14:44:14 -0800 | [diff] [blame] | 67 | libbase \ |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 68 | libbz \ |
| 69 | libz |
Tao Bao | 087bc0c | 2017-01-19 10:46:39 -0800 | [diff] [blame] | 70 | LOCAL_CFLAGS := \ |
| 71 | -DZLIB_CONST \ |
| 72 | -Werror |
Sen Jiang | 0cce9cd | 2016-01-22 20:49:07 +0800 | [diff] [blame] | 73 | include $(BUILD_STATIC_LIBRARY) |
Sen Jiang | 0cce9cd | 2016-01-22 20:49:07 +0800 | [diff] [blame] | 74 | |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 75 | # libimgpatch (host static library) |
| 76 | # =============================== |
Sen Jiang | 0cce9cd | 2016-01-22 20:49:07 +0800 | [diff] [blame] | 77 | include $(CLEAR_VARS) |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 78 | LOCAL_SRC_FILES := \ |
| 79 | bspatch.cpp \ |
Tianjie Xu | 12b9055 | 2017-03-07 14:44:14 -0800 | [diff] [blame] | 80 | imgpatch.cpp |
Sen Jiang | 0cce9cd | 2016-01-22 20:49:07 +0800 | [diff] [blame] | 81 | LOCAL_MODULE := libimgpatch |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 82 | LOCAL_MODULE_HOST_OS := linux |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 83 | LOCAL_C_INCLUDES := \ |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 84 | $(LOCAL_PATH)/include \ |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 85 | $(commands_recovery_local_path) |
Sen Jiang | 0cce9cd | 2016-01-22 20:49:07 +0800 | [diff] [blame] | 86 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 87 | LOCAL_STATIC_LIBRARIES := \ |
| 88 | libcrypto \ |
Sen Jiang | 25c5697 | 2016-05-10 15:23:25 -0700 | [diff] [blame] | 89 | libbspatch \ |
Tianjie Xu | 12b9055 | 2017-03-07 14:44:14 -0800 | [diff] [blame] | 90 | libbase \ |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 91 | libbz \ |
| 92 | libz |
Tao Bao | 087bc0c | 2017-01-19 10:46:39 -0800 | [diff] [blame] | 93 | LOCAL_CFLAGS := \ |
| 94 | -DZLIB_CONST \ |
| 95 | -Werror |
Sen Jiang | 0cce9cd | 2016-01-22 20:49:07 +0800 | [diff] [blame] | 96 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 97 | |
Tao Bao | 36c3511 | 2016-10-25 14:17:26 -0700 | [diff] [blame] | 98 | # libapplypatch_modes (static library) |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 99 | # =============================== |
Sen Jiang | 0cce9cd | 2016-01-22 20:49:07 +0800 | [diff] [blame] | 100 | include $(CLEAR_VARS) |
Tao Bao | 36c3511 | 2016-10-25 14:17:26 -0700 | [diff] [blame] | 101 | LOCAL_SRC_FILES := \ |
| 102 | applypatch_modes.cpp |
| 103 | LOCAL_MODULE := libapplypatch_modes |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 104 | LOCAL_C_INCLUDES := $(commands_recovery_local_path) |
Tao Bao | 36c3511 | 2016-10-25 14:17:26 -0700 | [diff] [blame] | 105 | LOCAL_STATIC_LIBRARIES := \ |
| 106 | libapplypatch \ |
| 107 | libbase \ |
| 108 | libedify \ |
| 109 | libcrypto |
| 110 | LOCAL_CFLAGS := -Werror |
| 111 | include $(BUILD_STATIC_LIBRARY) |
Sen Jiang | 0cce9cd | 2016-01-22 20:49:07 +0800 | [diff] [blame] | 112 | |
Tao Bao | 36c3511 | 2016-10-25 14:17:26 -0700 | [diff] [blame] | 113 | # applypatch (target executable) |
| 114 | # =============================== |
| 115 | include $(CLEAR_VARS) |
Tao Bao | 36c3511 | 2016-10-25 14:17:26 -0700 | [diff] [blame] | 116 | LOCAL_SRC_FILES := applypatch_main.cpp |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 117 | LOCAL_MODULE := applypatch |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 118 | LOCAL_C_INCLUDES := $(commands_recovery_local_path) |
Tao Bao | 36c3511 | 2016-10-25 14:17:26 -0700 | [diff] [blame] | 119 | LOCAL_STATIC_LIBRARIES := \ |
| 120 | libapplypatch_modes \ |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 121 | libapplypatch \ |
| 122 | libbase \ |
| 123 | libedify \ |
| 124 | libotafault \ |
Josh Gao | 073164f | 2016-08-05 15:59:05 -0700 | [diff] [blame] | 125 | libcrypto \ |
Sen Jiang | 25c5697 | 2016-05-10 15:23:25 -0700 | [diff] [blame] | 126 | libbspatch \ |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 127 | libbz |
Tao Bao | 36c3511 | 2016-10-25 14:17:26 -0700 | [diff] [blame] | 128 | LOCAL_SHARED_LIBRARIES := \ |
| 129 | libbase \ |
| 130 | libz \ |
| 131 | libcutils |
Tianjie Xu | 7aa8874 | 2016-09-28 11:42:17 -0700 | [diff] [blame] | 132 | LOCAL_CFLAGS := -Werror |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 133 | include $(BUILD_EXECUTABLE) |
| 134 | |
Tianjie Xu | 12b9055 | 2017-03-07 14:44:14 -0800 | [diff] [blame] | 135 | libimgdiff_src_files := imgdiff.cpp |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 136 | |
| 137 | # libbsdiff is compiled with -D_FILE_OFFSET_BITS=64. |
| 138 | libimgdiff_cflags := \ |
| 139 | -Werror \ |
| 140 | -D_FILE_OFFSET_BITS=64 |
| 141 | |
| 142 | libimgdiff_static_libraries := \ |
| 143 | libbsdiff \ |
Sen Jiang | 930edb6 | 2017-01-18 17:26:42 -0800 | [diff] [blame] | 144 | libdivsufsort \ |
| 145 | libdivsufsort64 \ |
Tianjie Xu | 1ea84d6 | 2017-02-22 18:23:58 -0800 | [diff] [blame] | 146 | libziparchive \ |
| 147 | libutils \ |
| 148 | liblog \ |
Tao Bao | d37ce8f | 2016-12-17 17:10:04 -0800 | [diff] [blame] | 149 | libbase \ |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 150 | libz |
| 151 | |
| 152 | # libimgdiff (static library) |
| 153 | # =============================== |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 154 | include $(CLEAR_VARS) |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 155 | LOCAL_SRC_FILES := \ |
| 156 | $(libimgdiff_src_files) |
| 157 | LOCAL_MODULE := libimgdiff |
| 158 | LOCAL_CFLAGS := \ |
| 159 | $(libimgdiff_cflags) |
| 160 | LOCAL_STATIC_LIBRARIES := \ |
| 161 | $(libimgdiff_static_libraries) |
| 162 | LOCAL_C_INCLUDES := \ |
| 163 | $(LOCAL_PATH)/include |
| 164 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
| 165 | include $(BUILD_STATIC_LIBRARY) |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 166 | |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 167 | # libimgdiff (host static library) |
| 168 | # =============================== |
| 169 | include $(CLEAR_VARS) |
| 170 | LOCAL_SRC_FILES := \ |
| 171 | $(libimgdiff_src_files) |
| 172 | LOCAL_MODULE := libimgdiff |
| 173 | LOCAL_CFLAGS := \ |
| 174 | $(libimgdiff_cflags) |
| 175 | LOCAL_STATIC_LIBRARIES := \ |
| 176 | $(libimgdiff_static_libraries) |
| 177 | LOCAL_C_INCLUDES := \ |
| 178 | $(LOCAL_PATH)/include |
| 179 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
| 180 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 181 | |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 182 | # imgdiff (host static executable) |
| 183 | # =============================== |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 184 | include $(CLEAR_VARS) |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 185 | LOCAL_SRC_FILES := imgdiff_main.cpp |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 186 | LOCAL_MODULE := imgdiff |
Tianjie Xu | 7aa8874 | 2016-09-28 11:42:17 -0700 | [diff] [blame] | 187 | LOCAL_CFLAGS := -Werror |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 188 | LOCAL_STATIC_LIBRARIES := \ |
| 189 | libimgdiff \ |
| 190 | $(libimgdiff_static_libraries) \ |
Sen Jiang | 930edb6 | 2017-01-18 17:26:42 -0800 | [diff] [blame] | 191 | libbz |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 192 | include $(BUILD_HOST_EXECUTABLE) |