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 | |
Michael Bestas | c86b6d4 | 2017-04-28 22:43:09 +0300 | [diff] [blame] | 17 | ifdef project-path-for |
| 18 | RECOVERY_PATH := $(call project-path-for,recovery) |
| 19 | else |
| 20 | RECOVERY_PATH := bootable/recovery |
| 21 | endif |
| 22 | |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 23 | include $(CLEAR_VARS) |
| 24 | |
Conn O'Griofa | d920104 | 2014-03-25 01:26:49 +0000 | [diff] [blame] | 25 | BOARD_RECOVERY_DEFINES := BOARD_BML_BOOT BOARD_BML_RECOVERY |
| 26 | |
| 27 | $(foreach board_define,$(BOARD_RECOVERY_DEFINES), \ |
| 28 | $(if $($(board_define)), \ |
| 29 | $(eval LOCAL_CFLAGS += -D$(board_define)=\"$($(board_define))\") \ |
| 30 | ) \ |
| 31 | ) |
| 32 | |
Matt Mower | 55c75ca | 2014-08-31 11:30:15 -0500 | [diff] [blame] | 33 | LOCAL_C_INCLUDES += \ |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 34 | $(LOCAL_PATH)/include \ |
Matt Mower | 55c75ca | 2014-08-31 11:30:15 -0500 | [diff] [blame] | 35 | external/bzip2 \ |
| 36 | external/zlib \ |
| 37 | $(commands_recovery_local_path) |
Ethan Yonker | 34ae483 | 2016-08-24 15:32:18 -0500 | [diff] [blame] | 38 | |
Tao Bao | 80e46e0 | 2015-06-03 10:49:29 -0700 | [diff] [blame] | 39 | LOCAL_CLANG := true |
Tao Bao | ba9a42a | 2015-06-23 23:23:33 -0700 | [diff] [blame] | 40 | LOCAL_SRC_FILES := applypatch.cpp bspatch.cpp freecache.cpp imgpatch.cpp utils.cpp |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 41 | LOCAL_MODULE := libapplypatch |
| 42 | LOCAL_MODULE_TAGS := eng |
Michael Bestas | c86b6d4 | 2017-04-28 22:43:09 +0300 | [diff] [blame] | 43 | LOCAL_C_INCLUDES += $(RECOVERY_PATH) |
Ethan Yonker | b8e985c | 2016-08-31 13:42:11 -0500 | [diff] [blame] | 44 | LOCAL_STATIC_LIBRARIES += libbase libotafault libmtdutils libcrypto_static libbz libz |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 45 | |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 46 | # libapplypatch (static library) |
| 47 | # =============================== |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 48 | include $(CLEAR_VARS) |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 49 | LOCAL_SRC_FILES := \ |
| 50 | applypatch.cpp \ |
| 51 | bspatch.cpp \ |
| 52 | freecache.cpp \ |
Tianjie Xu | 12b9055 | 2017-03-07 14:44:14 -0800 | [diff] [blame] | 53 | imgpatch.cpp |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 54 | LOCAL_MODULE := libapplypatch |
| 55 | LOCAL_MODULE_TAGS := eng |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 56 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 57 | LOCAL_C_INCLUDES := \ |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 58 | $(LOCAL_PATH)/include \ |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 59 | $(commands_recovery_local_path) |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 60 | LOCAL_STATIC_LIBRARIES := \ |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 61 | libotafault \ |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 62 | libbase \ |
Josh Gao | 073164f | 2016-08-05 15:59:05 -0700 | [diff] [blame] | 63 | libcrypto \ |
Sen Jiang | 25c5697 | 2016-05-10 15:23:25 -0700 | [diff] [blame] | 64 | libbspatch \ |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 65 | libbz \ |
| 66 | libz |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 67 | LOCAL_WHOLE_STATIC_LIBRARIES += libmtdutils |
Tao Bao | 087bc0c | 2017-01-19 10:46:39 -0800 | [diff] [blame] | 68 | LOCAL_CFLAGS := \ |
| 69 | -DZLIB_CONST \ |
| 70 | -Werror |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 71 | include $(BUILD_STATIC_LIBRARY) |
| 72 | |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 73 | # libimgpatch (static library) |
| 74 | # =============================== |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 75 | include $(CLEAR_VARS) |
| 76 | |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 77 | LOCAL_SRC_FILES := \ |
| 78 | bspatch.cpp \ |
Tianjie Xu | 12b9055 | 2017-03-07 14:44:14 -0800 | [diff] [blame] | 79 | imgpatch.cpp |
Sen Jiang | 0cce9cd | 2016-01-22 20:49:07 +0800 | [diff] [blame] | 80 | LOCAL_MODULE := libimgpatch |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 81 | LOCAL_C_INCLUDES := \ |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 82 | $(LOCAL_PATH)/include \ |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 83 | $(commands_recovery_local_path) |
Sen Jiang | 0cce9cd | 2016-01-22 20:49:07 +0800 | [diff] [blame] | 84 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 85 | LOCAL_STATIC_LIBRARIES := \ |
| 86 | libcrypto \ |
Sen Jiang | 25c5697 | 2016-05-10 15:23:25 -0700 | [diff] [blame] | 87 | libbspatch \ |
Tianjie Xu | 12b9055 | 2017-03-07 14:44:14 -0800 | [diff] [blame] | 88 | libbase \ |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 89 | libbz \ |
| 90 | libz |
Tao Bao | 087bc0c | 2017-01-19 10:46:39 -0800 | [diff] [blame] | 91 | LOCAL_CFLAGS := \ |
| 92 | -DZLIB_CONST \ |
| 93 | -Werror |
Sen Jiang | 0cce9cd | 2016-01-22 20:49:07 +0800 | [diff] [blame] | 94 | include $(BUILD_STATIC_LIBRARY) |
Sen Jiang | 0cce9cd | 2016-01-22 20:49:07 +0800 | [diff] [blame] | 95 | |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 96 | # libimgpatch (host static library) |
| 97 | # =============================== |
Sen Jiang | 0cce9cd | 2016-01-22 20:49:07 +0800 | [diff] [blame] | 98 | include $(CLEAR_VARS) |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 99 | LOCAL_SRC_FILES := \ |
| 100 | bspatch.cpp \ |
Tianjie Xu | 12b9055 | 2017-03-07 14:44:14 -0800 | [diff] [blame] | 101 | imgpatch.cpp |
Sen Jiang | 0cce9cd | 2016-01-22 20:49:07 +0800 | [diff] [blame] | 102 | LOCAL_MODULE := libimgpatch |
Michael Bestas | c86b6d4 | 2017-04-28 22:43:09 +0300 | [diff] [blame] | 103 | LOCAL_C_INCLUDES += $(RECOVERY_PATH) |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 104 | LOCAL_MODULE_HOST_OS := linux |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 105 | LOCAL_C_INCLUDES := \ |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 106 | $(LOCAL_PATH)/include \ |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 107 | $(commands_recovery_local_path) |
Sen Jiang | 0cce9cd | 2016-01-22 20:49:07 +0800 | [diff] [blame] | 108 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 109 | LOCAL_STATIC_LIBRARIES := \ |
| 110 | libcrypto \ |
Sen Jiang | 25c5697 | 2016-05-10 15:23:25 -0700 | [diff] [blame] | 111 | libbspatch \ |
Tianjie Xu | 12b9055 | 2017-03-07 14:44:14 -0800 | [diff] [blame] | 112 | libbase \ |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 113 | libbz \ |
| 114 | libz |
Tao Bao | 087bc0c | 2017-01-19 10:46:39 -0800 | [diff] [blame] | 115 | LOCAL_CFLAGS := \ |
| 116 | -DZLIB_CONST \ |
| 117 | -Werror |
Sen Jiang | 0cce9cd | 2016-01-22 20:49:07 +0800 | [diff] [blame] | 118 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 119 | |
Tao Bao | 36c3511 | 2016-10-25 14:17:26 -0700 | [diff] [blame] | 120 | # libapplypatch_modes (static library) |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 121 | # =============================== |
Sen Jiang | 0cce9cd | 2016-01-22 20:49:07 +0800 | [diff] [blame] | 122 | include $(CLEAR_VARS) |
Tao Bao | 36c3511 | 2016-10-25 14:17:26 -0700 | [diff] [blame] | 123 | LOCAL_SRC_FILES := \ |
| 124 | applypatch_modes.cpp |
| 125 | LOCAL_MODULE := libapplypatch_modes |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 126 | LOCAL_C_INCLUDES := $(commands_recovery_local_path) |
Tao Bao | 36c3511 | 2016-10-25 14:17:26 -0700 | [diff] [blame] | 127 | LOCAL_STATIC_LIBRARIES := \ |
| 128 | libapplypatch \ |
| 129 | libbase \ |
| 130 | libedify \ |
| 131 | libcrypto |
| 132 | LOCAL_CFLAGS := -Werror |
| 133 | include $(BUILD_STATIC_LIBRARY) |
Sen Jiang | 0cce9cd | 2016-01-22 20:49:07 +0800 | [diff] [blame] | 134 | |
Tao Bao | 36c3511 | 2016-10-25 14:17:26 -0700 | [diff] [blame] | 135 | # applypatch (target executable) |
| 136 | # =============================== |
| 137 | include $(CLEAR_VARS) |
Tao Bao | 36c3511 | 2016-10-25 14:17:26 -0700 | [diff] [blame] | 138 | LOCAL_SRC_FILES := applypatch_main.cpp |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 139 | LOCAL_MODULE := applypatch |
Michael Bestas | c86b6d4 | 2017-04-28 22:43:09 +0300 | [diff] [blame] | 140 | LOCAL_C_INCLUDES += $(RECOVERY_PATH) |
Yabin Cui | ca78c9f | 2016-02-05 15:27:52 -0800 | [diff] [blame] | 141 | LOCAL_STATIC_LIBRARIES += libapplypatch libbase libotafault libmtdutils libcrypto_static libbz \ |
| 142 | libedify \ |
| 143 | |
Dan Albert | e49a9e5 | 2015-05-19 11:33:18 -0700 | [diff] [blame] | 144 | LOCAL_SHARED_LIBRARIES += libz libcutils libc |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 145 | |
Ethan Yonker | 8373cfe | 2017-09-08 06:50:54 -0500 | [diff] [blame] | 146 | LOCAL_C_INCLUDES := $(commands_recovery_local_path) |
Tao Bao | 36c3511 | 2016-10-25 14:17:26 -0700 | [diff] [blame] | 147 | LOCAL_STATIC_LIBRARIES := \ |
| 148 | libapplypatch_modes \ |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 149 | libapplypatch \ |
| 150 | libbase \ |
| 151 | libedify \ |
| 152 | libotafault \ |
Josh Gao | 073164f | 2016-08-05 15:59:05 -0700 | [diff] [blame] | 153 | libcrypto \ |
Sen Jiang | 25c5697 | 2016-05-10 15:23:25 -0700 | [diff] [blame] | 154 | libbspatch \ |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 155 | libbz |
Tao Bao | 36c3511 | 2016-10-25 14:17:26 -0700 | [diff] [blame] | 156 | LOCAL_SHARED_LIBRARIES := \ |
| 157 | libbase \ |
| 158 | libz \ |
| 159 | libcutils |
Tianjie Xu | 7aa8874 | 2016-09-28 11:42:17 -0700 | [diff] [blame] | 160 | LOCAL_CFLAGS := -Werror |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 161 | include $(BUILD_EXECUTABLE) |
| 162 | |
Tianjie Xu | 12b9055 | 2017-03-07 14:44:14 -0800 | [diff] [blame] | 163 | libimgdiff_src_files := imgdiff.cpp |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 164 | |
| 165 | # libbsdiff is compiled with -D_FILE_OFFSET_BITS=64. |
| 166 | libimgdiff_cflags := \ |
| 167 | -Werror \ |
| 168 | -D_FILE_OFFSET_BITS=64 |
| 169 | |
| 170 | libimgdiff_static_libraries := \ |
| 171 | libbsdiff \ |
Sen Jiang | 930edb6 | 2017-01-18 17:26:42 -0800 | [diff] [blame] | 172 | libdivsufsort \ |
| 173 | libdivsufsort64 \ |
Tianjie Xu | 1ea84d6 | 2017-02-22 18:23:58 -0800 | [diff] [blame] | 174 | libziparchive \ |
| 175 | libutils \ |
| 176 | liblog \ |
Tao Bao | d37ce8f | 2016-12-17 17:10:04 -0800 | [diff] [blame] | 177 | libbase \ |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 178 | libz |
| 179 | |
| 180 | # libimgdiff (static library) |
| 181 | # =============================== |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 182 | include $(CLEAR_VARS) |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 183 | LOCAL_SRC_FILES := \ |
| 184 | $(libimgdiff_src_files) |
| 185 | LOCAL_MODULE := libimgdiff |
| 186 | LOCAL_CFLAGS := \ |
| 187 | $(libimgdiff_cflags) |
| 188 | LOCAL_STATIC_LIBRARIES := \ |
| 189 | $(libimgdiff_static_libraries) |
| 190 | LOCAL_C_INCLUDES := \ |
| 191 | $(LOCAL_PATH)/include |
| 192 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
| 193 | include $(BUILD_STATIC_LIBRARY) |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 194 | |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 195 | # libimgdiff (host static library) |
| 196 | # =============================== |
| 197 | include $(CLEAR_VARS) |
| 198 | LOCAL_SRC_FILES := \ |
| 199 | $(libimgdiff_src_files) |
| 200 | LOCAL_MODULE := libimgdiff |
| 201 | LOCAL_CFLAGS := \ |
| 202 | $(libimgdiff_cflags) |
| 203 | LOCAL_STATIC_LIBRARIES := \ |
| 204 | $(libimgdiff_static_libraries) |
| 205 | LOCAL_C_INCLUDES := \ |
| 206 | $(LOCAL_PATH)/include |
| 207 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
| 208 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 209 | |
Tao Bao | d80a998 | 2016-03-03 11:43:47 -0800 | [diff] [blame] | 210 | # imgdiff (host static executable) |
| 211 | # =============================== |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 212 | include $(CLEAR_VARS) |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 213 | LOCAL_SRC_FILES := imgdiff_main.cpp |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 214 | LOCAL_MODULE := imgdiff |
Tianjie Xu | 7aa8874 | 2016-09-28 11:42:17 -0700 | [diff] [blame] | 215 | LOCAL_CFLAGS := -Werror |
Tao Bao | 97555da | 2016-12-15 10:15:06 -0800 | [diff] [blame] | 216 | LOCAL_STATIC_LIBRARIES := \ |
| 217 | libimgdiff \ |
| 218 | $(libimgdiff_static_libraries) \ |
Sen Jiang | 930edb6 | 2017-01-18 17:26:42 -0800 | [diff] [blame] | 219 | libbz |
Doug Zongker | 512536a | 2010-02-17 16:11:44 -0800 | [diff] [blame] | 220 | include $(BUILD_HOST_EXECUTABLE) |