Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2015 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
| 17 | LOCAL_PATH := $(my-dir) |
| 18 | |
Alex Deymo | 78a954f | 2016-01-21 20:32:40 -0800 | [diff] [blame] | 19 | # Default values for the USE flags. Override these USE flags from your product |
| 20 | # by setting BRILLO_USE_* values. Note that we define local variables like |
| 21 | # local_use_* to prevent leaking our default setting for other packages. |
| 22 | local_use_binder := $(if $(BRILLO_USE_BINDER),$(BRILLO_USE_BINDER),1) |
Alex Deymo | 78a954f | 2016-01-21 20:32:40 -0800 | [diff] [blame] | 23 | local_use_hwid_override := \ |
| 24 | $(if $(BRILLO_USE_HWID_OVERRIDE),$(BRILLO_USE_HWID_OVERRIDE),0) |
Alex Deymo | 0cd976d | 2016-02-11 18:45:01 -0800 | [diff] [blame] | 25 | # "libcros" gates the LibCrosService exposed by the Chrome OS' chrome browser to |
| 26 | # the system layer. |
| 27 | local_use_libcros := $(if $(BRILLO_USE_LIBCROS),$(BRILLO_USE_LIBCROS),0) |
Alex Deymo | 78a954f | 2016-01-21 20:32:40 -0800 | [diff] [blame] | 28 | local_use_mtd := $(if $(BRILLO_USE_MTD),$(BRILLO_USE_MTD),0) |
Alex Deymo | 787dc41 | 2015-10-29 11:39:20 -0700 | [diff] [blame] | 29 | |
Alex Deymo | 49d6445 | 2016-10-31 16:56:58 -0700 | [diff] [blame] | 30 | # IoT devices use Omaha for updates. |
| 31 | local_use_omaha := $(if $(filter true,$(PRODUCT_IOT)),1,0) |
| 32 | |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 33 | ue_common_cflags := \ |
Alex Deymo | 78a954f | 2016-01-21 20:32:40 -0800 | [diff] [blame] | 34 | -DUSE_BINDER=$(local_use_binder) \ |
Alex Deymo | 78a954f | 2016-01-21 20:32:40 -0800 | [diff] [blame] | 35 | -DUSE_HWID_OVERRIDE=$(local_use_hwid_override) \ |
Alex Deymo | 0cd976d | 2016-02-11 18:45:01 -0800 | [diff] [blame] | 36 | -DUSE_LIBCROS=$(local_use_libcros) \ |
Alex Deymo | 78a954f | 2016-01-21 20:32:40 -0800 | [diff] [blame] | 37 | -DUSE_MTD=$(local_use_mtd) \ |
Sen Jiang | 192a86a | 2016-05-19 17:21:24 -0700 | [diff] [blame] | 38 | -DUSE_OMAHA=$(local_use_omaha) \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 39 | -D_FILE_OFFSET_BITS=64 \ |
| 40 | -D_POSIX_C_SOURCE=199309L \ |
| 41 | -Wa,--noexecstack \ |
| 42 | -Wall \ |
| 43 | -Werror \ |
| 44 | -Wextra \ |
| 45 | -Wformat=2 \ |
| 46 | -Wno-psabi \ |
| 47 | -Wno-unused-parameter \ |
| 48 | -ffunction-sections \ |
| 49 | -fstack-protector-strong \ |
| 50 | -fvisibility=hidden |
| 51 | ue_common_cppflags := \ |
| 52 | -Wnon-virtual-dtor \ |
Elliott Hughes | 063863b | 2016-10-10 13:37:53 -0700 | [diff] [blame] | 53 | -fno-strict-aliasing |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 54 | ue_common_ldflags := \ |
| 55 | -Wl,--gc-sections |
| 56 | ue_common_c_includes := \ |
| 57 | $(LOCAL_PATH)/client_library/include \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 58 | system |
| 59 | ue_common_shared_libraries := \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 60 | libbrillo-stream \ |
Alex Deymo | 44348e0 | 2016-07-29 16:22:26 -0700 | [diff] [blame] | 61 | libbrillo \ |
Alex Deymo | 4218b7e | 2015-11-17 21:14:42 -0300 | [diff] [blame] | 62 | libchrome |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 63 | ue_common_static_libraries := \ |
| 64 | libgtest_prod \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 65 | |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 66 | # update_metadata-protos (type: static_library) |
| 67 | # ======================================================== |
| 68 | # Protobufs. |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 69 | ue_update_metadata_protos_exported_static_libraries := \ |
| 70 | update_metadata-protos |
| 71 | ue_update_metadata_protos_exported_shared_libraries := \ |
Alex Vakulenko | ab5bd66 | 2015-12-21 12:24:45 -0800 | [diff] [blame] | 72 | libprotobuf-cpp-lite |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 73 | |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 74 | ue_update_metadata_protos_src_files := \ |
| 75 | update_metadata.proto |
| 76 | |
| 77 | # Build for the host. |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 78 | include $(CLEAR_VARS) |
| 79 | LOCAL_MODULE := update_metadata-protos |
| 80 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
Ying Wang | dbd1711 | 2015-12-17 11:59:09 -0800 | [diff] [blame] | 81 | LOCAL_IS_HOST_MODULE := true |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 82 | generated_sources_dir := $(call local-generated-sources-dir) |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 83 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(generated_sources_dir)/proto/system |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 84 | LOCAL_SRC_FILES := $(ue_update_metadata_protos_src_files) |
| 85 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 86 | |
| 87 | # Build for the target. |
| 88 | include $(CLEAR_VARS) |
| 89 | LOCAL_MODULE := update_metadata-protos |
| 90 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 91 | generated_sources_dir := $(call local-generated-sources-dir) |
| 92 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(generated_sources_dir)/proto/system |
| 93 | LOCAL_SRC_FILES := $(ue_update_metadata_protos_src_files) |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 94 | include $(BUILD_STATIC_LIBRARY) |
| 95 | |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 96 | # libpayload_consumer (type: static_library) |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 97 | # ======================================================== |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 98 | # The payload application component and common dependencies. |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 99 | ue_libpayload_consumer_exported_static_libraries := \ |
| 100 | update_metadata-protos \ |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 101 | libxz-host \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 102 | libbz \ |
Sen Jiang | bc3e6b0 | 2016-01-19 18:39:26 +0800 | [diff] [blame] | 103 | libimgpatch \ |
Sen Jiang | 26dfa32 | 2016-05-10 15:31:46 -0700 | [diff] [blame] | 104 | libbspatch \ |
Sen Jiang | bc3e6b0 | 2016-01-19 18:39:26 +0800 | [diff] [blame] | 105 | libz \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 106 | $(ue_update_metadata_protos_exported_static_libraries) |
| 107 | ue_libpayload_consumer_exported_shared_libraries := \ |
Dan Willemsen | 097288e | 2016-07-21 14:16:29 -0700 | [diff] [blame] | 108 | libcrypto \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 109 | $(ue_update_metadata_protos_exported_shared_libraries) |
| 110 | |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 111 | ue_libpayload_consumer_src_files := \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 112 | common/action_processor.cc \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 113 | common/boot_control_stub.cc \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 114 | common/clock.cc \ |
| 115 | common/constants.cc \ |
Alex Deymo | ab0d976 | 2016-02-02 10:52:56 -0800 | [diff] [blame] | 116 | common/cpu_limiter.cc \ |
Alex Deymo | e88e9fe | 2016-02-03 16:38:00 -0800 | [diff] [blame] | 117 | common/error_code_utils.cc \ |
Alex Deymo | d6ece53 | 2016-06-21 17:00:05 -0700 | [diff] [blame] | 118 | common/file_fetcher.cc \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 119 | common/hash_calculator.cc \ |
| 120 | common/http_common.cc \ |
| 121 | common/http_fetcher.cc \ |
| 122 | common/hwid_override.cc \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 123 | common/multi_range_http_fetcher.cc \ |
| 124 | common/platform_constants_android.cc \ |
| 125 | common/prefs.cc \ |
| 126 | common/subprocess.cc \ |
| 127 | common/terminator.cc \ |
| 128 | common/utils.cc \ |
| 129 | payload_consumer/bzip_extent_writer.cc \ |
| 130 | payload_consumer/delta_performer.cc \ |
| 131 | payload_consumer/download_action.cc \ |
| 132 | payload_consumer/extent_writer.cc \ |
| 133 | payload_consumer/file_descriptor.cc \ |
| 134 | payload_consumer/file_writer.cc \ |
| 135 | payload_consumer/filesystem_verifier_action.cc \ |
| 136 | payload_consumer/install_plan.cc \ |
| 137 | payload_consumer/payload_constants.cc \ |
| 138 | payload_consumer/payload_verifier.cc \ |
| 139 | payload_consumer/postinstall_runner_action.cc \ |
| 140 | payload_consumer/xz_extent_writer.cc |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 141 | |
| 142 | ifeq ($(HOST_OS),linux) |
| 143 | # Build for the host. |
| 144 | include $(CLEAR_VARS) |
| 145 | LOCAL_MODULE := libpayload_consumer |
| 146 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 147 | LOCAL_CPP_EXTENSION := .cc |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 148 | LOCAL_CLANG := true |
| 149 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 150 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 151 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
| 152 | LOCAL_C_INCLUDES := \ |
Sen Jiang | dcbc0ae | 2016-03-18 15:33:19 -0700 | [diff] [blame] | 153 | $(ue_common_c_includes) |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 154 | LOCAL_STATIC_LIBRARIES := \ |
| 155 | update_metadata-protos \ |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 156 | $(ue_common_static_libraries) \ |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 157 | $(ue_libpayload_consumer_exported_static_libraries) \ |
| 158 | $(ue_update_metadata_protos_exported_static_libraries) |
| 159 | LOCAL_SHARED_LIBRARIES := \ |
| 160 | $(ue_common_shared_libraries) \ |
| 161 | $(ue_libpayload_consumer_exported_shared_libraries) \ |
| 162 | $(ue_update_metadata_protos_exported_shared_libraries) |
| 163 | LOCAL_SRC_FILES := $(ue_libpayload_consumer_src_files) |
| 164 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 165 | endif # HOST_OS == linux |
| 166 | |
| 167 | # Build for the target. |
| 168 | include $(CLEAR_VARS) |
| 169 | LOCAL_MODULE := libpayload_consumer |
| 170 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 171 | LOCAL_CPP_EXTENSION := .cc |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 172 | LOCAL_CLANG := true |
| 173 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 174 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 175 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
| 176 | LOCAL_C_INCLUDES := \ |
Sen Jiang | dcbc0ae | 2016-03-18 15:33:19 -0700 | [diff] [blame] | 177 | $(ue_common_c_includes) |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 178 | LOCAL_STATIC_LIBRARIES := \ |
| 179 | update_metadata-protos \ |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 180 | $(ue_common_static_libraries) \ |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 181 | $(ue_libpayload_consumer_exported_static_libraries:-host=) \ |
| 182 | $(ue_update_metadata_protos_exported_static_libraries) |
| 183 | LOCAL_SHARED_LIBRARIES := \ |
| 184 | $(ue_common_shared_libraries) \ |
| 185 | $(ue_libpayload_consumer_exported_shared_libraries:-host=) \ |
| 186 | $(ue_update_metadata_protos_exported_shared_libraries) |
| 187 | LOCAL_SRC_FILES := $(ue_libpayload_consumer_src_files) |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 188 | include $(BUILD_STATIC_LIBRARY) |
| 189 | |
Connor O'Brien | cee6ad9 | 2016-11-21 13:53:52 -0800 | [diff] [blame] | 190 | # libupdate_engine_boot_control (type: static_library) |
| 191 | # ======================================================== |
| 192 | # A BootControl class implementation using Android's HIDL boot_control HAL. |
| 193 | ue_libupdate_engine_boot_control_exported_static_libraries := \ |
| 194 | update_metadata-protos \ |
| 195 | $(ue_update_metadata_protos_exported_static_libraries) |
| 196 | |
| 197 | ue_libupdate_engine_boot_control_exported_shared_libraries := \ |
| 198 | libhwbinder \ |
Connor O'Brien | 25cea5e | 2016-11-28 12:44:10 -0800 | [diff] [blame] | 199 | libhidlbase \ |
Connor O'Brien | cee6ad9 | 2016-11-21 13:53:52 -0800 | [diff] [blame] | 200 | libutils \ |
| 201 | android.hardware.boot@1.0 \ |
| 202 | $(ue_update_metadata_protos_exported_shared_libraries) |
| 203 | |
| 204 | include $(CLEAR_VARS) |
| 205 | LOCAL_MODULE := libupdate_engine_boot_control |
| 206 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 207 | LOCAL_CPP_EXTENSION := .cc |
| 208 | LOCAL_CLANG := true |
| 209 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 210 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 211 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
| 212 | LOCAL_C_INCLUDES := \ |
| 213 | $(ue_common_c_includes) \ |
| 214 | bootable/recovery |
| 215 | LOCAL_STATIC_LIBRARIES := \ |
| 216 | $(ue_common_static_libraries) \ |
| 217 | $(ue_libupdate_engine_boot_control_exported_static_libraries) |
| 218 | LOCAL_SHARED_LIBRARIES := \ |
| 219 | $(ue_common_shared_libraries) \ |
| 220 | $(ue_libupdate_engine_boot_control_exported_shared_libraries) |
| 221 | LOCAL_SRC_FILES := \ |
| 222 | boot_control_android.cc |
| 223 | include $(BUILD_STATIC_LIBRARY) |
| 224 | |
Sen Jiang | 192a86a | 2016-05-19 17:21:24 -0700 | [diff] [blame] | 225 | ifeq ($(local_use_omaha),1) |
Alex Deymo | 4218b7e | 2015-11-17 21:14:42 -0300 | [diff] [blame] | 226 | |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 227 | # libupdate_engine (type: static_library) |
| 228 | # ======================================================== |
| 229 | # The main daemon static_library with all the code used to check for updates |
| 230 | # with Omaha and expose a DBus daemon. |
| 231 | ue_libupdate_engine_exported_c_includes := \ |
Alex Deymo | b09305e | 2015-12-02 16:09:13 -0300 | [diff] [blame] | 232 | external/cros/system_api/dbus |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 233 | ue_libupdate_engine_exported_static_libraries := \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 234 | libpayload_consumer \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 235 | update_metadata-protos \ |
David Zeuthen | 753fadc | 2015-09-15 16:34:09 -0400 | [diff] [blame] | 236 | libbz \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 237 | libfs_mgr \ |
bowgotsai | 763e17c | 2017-01-24 16:59:57 +0800 | [diff] [blame] | 238 | libbase \ |
bowgotsai | cd67f91 | 2017-01-27 14:50:26 +0800 | [diff] [blame] | 239 | liblog \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 240 | $(ue_libpayload_consumer_exported_static_libraries) \ |
Connor O'Brien | cee6ad9 | 2016-11-21 13:53:52 -0800 | [diff] [blame] | 241 | $(ue_update_metadata_protos_exported_static_libraries) \ |
| 242 | libupdate_engine_boot_control \ |
| 243 | $(ue_libupdate_engine_boot_control_exported_static_libraries) |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 244 | ue_libupdate_engine_exported_shared_libraries := \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 245 | libmetrics \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 246 | libexpat \ |
Alex Vakulenko | 1bab5a8 | 2015-10-27 11:47:28 -0700 | [diff] [blame] | 247 | libbrillo-policy \ |
Alex Deymo | 14c0da8 | 2016-07-20 16:45:45 -0700 | [diff] [blame] | 248 | libcurl \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 249 | libcutils \ |
Alex Deymo | 14c0da8 | 2016-07-20 16:45:45 -0700 | [diff] [blame] | 250 | libssl \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 251 | $(ue_libpayload_consumer_exported_shared_libraries) \ |
Connor O'Brien | cee6ad9 | 2016-11-21 13:53:52 -0800 | [diff] [blame] | 252 | $(ue_update_metadata_protos_exported_shared_libraries) \ |
| 253 | $(ue_libupdate_engine_boot_control_exported_shared_libraries) |
Alex Deymo | c003790 | 2016-01-23 17:29:02 -0800 | [diff] [blame] | 254 | ifeq ($(local_use_binder),1) |
| 255 | ue_libupdate_engine_exported_shared_libraries += \ |
| 256 | libbinder \ |
| 257 | libbinderwrapper \ |
| 258 | libbrillo-binder \ |
| 259 | libutils |
| 260 | endif # local_use_binder == 1 |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 261 | |
| 262 | include $(CLEAR_VARS) |
| 263 | LOCAL_MODULE := libupdate_engine |
| 264 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 265 | LOCAL_CPP_EXTENSION := .cc |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 266 | LOCAL_CLANG := true |
| 267 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(ue_libupdate_engine_exported_c_includes) |
| 268 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 269 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 270 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
| 271 | LOCAL_C_INCLUDES := \ |
| 272 | $(ue_common_c_includes) \ |
Alex Deymo | fb905d9 | 2016-06-03 19:26:58 -0700 | [diff] [blame] | 273 | $(ue_libupdate_engine_exported_c_includes) \ |
| 274 | bootable/recovery |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 275 | LOCAL_STATIC_LIBRARIES := \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 276 | libpayload_consumer \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 277 | update_metadata-protos \ |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 278 | $(ue_common_static_libraries) \ |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 279 | $(ue_libupdate_engine_exported_static_libraries:-host=) \ |
| 280 | $(ue_libpayload_consumer_exported_static_libraries:-host=) \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 281 | $(ue_update_metadata_protos_exported_static_libraries) |
| 282 | LOCAL_SHARED_LIBRARIES := \ |
| 283 | $(ue_common_shared_libraries) \ |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 284 | $(ue_libupdate_engine_exported_shared_libraries:-host=) \ |
| 285 | $(ue_libpayload_consumer_exported_shared_libraries:-host=) \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 286 | $(ue_update_metadata_protos_exported_shared_libraries) |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 287 | LOCAL_SRC_FILES := \ |
Alex Deymo | 14c0da8 | 2016-07-20 16:45:45 -0700 | [diff] [blame] | 288 | certificate_checker.cc \ |
Alex Deymo | 78a954f | 2016-01-21 20:32:40 -0800 | [diff] [blame] | 289 | common_service.cc \ |
Sen Jiang | a7c4de2 | 2017-03-02 15:53:54 -0800 | [diff] [blame] | 290 | connection_manager_android.cc \ |
Sen Jiang | 255e22b | 2016-05-20 16:15:29 -0700 | [diff] [blame] | 291 | connection_utils.cc \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 292 | daemon.cc \ |
Alex Deymo | 1b03f9f | 2015-12-09 00:38:36 -0800 | [diff] [blame] | 293 | hardware_android.cc \ |
Alex Deymo | 8561665 | 2015-10-15 18:48:31 -0700 | [diff] [blame] | 294 | image_properties_android.cc \ |
Alex Deymo | 14c0da8 | 2016-07-20 16:45:45 -0700 | [diff] [blame] | 295 | libcurl_http_fetcher.cc \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 296 | metrics.cc \ |
Alex Deymo | 38429cf | 2015-11-11 18:27:22 -0800 | [diff] [blame] | 297 | metrics_utils.cc \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 298 | omaha_request_action.cc \ |
| 299 | omaha_request_params.cc \ |
| 300 | omaha_response_handler_action.cc \ |
Alex Deymo | b3fa53b | 2016-04-18 19:57:58 -0700 | [diff] [blame] | 301 | omaha_utils.cc \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 302 | p2p_manager.cc \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 303 | payload_state.cc \ |
Sen Jiang | b8c6a8f | 2016-06-07 17:33:17 -0700 | [diff] [blame] | 304 | power_manager_android.cc \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 305 | proxy_resolver.cc \ |
| 306 | real_system_state.cc \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 307 | update_attempter.cc \ |
| 308 | update_manager/boxed_value.cc \ |
| 309 | update_manager/chromeos_policy.cc \ |
| 310 | update_manager/default_policy.cc \ |
| 311 | update_manager/evaluation_context.cc \ |
| 312 | update_manager/policy.cc \ |
| 313 | update_manager/real_config_provider.cc \ |
| 314 | update_manager/real_device_policy_provider.cc \ |
| 315 | update_manager/real_random_provider.cc \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 316 | update_manager/real_system_provider.cc \ |
| 317 | update_manager/real_time_provider.cc \ |
| 318 | update_manager/real_updater_provider.cc \ |
| 319 | update_manager/state_factory.cc \ |
| 320 | update_manager/update_manager.cc \ |
Alex Deymo | f7ead81 | 2015-10-23 17:37:27 -0700 | [diff] [blame] | 321 | update_status_utils.cc \ |
Alex Deymo | dc066f1 | 2017-03-27 13:01:29 -0700 | [diff] [blame^] | 322 | utils_android.cc |
Alex Deymo | 78a954f | 2016-01-21 20:32:40 -0800 | [diff] [blame] | 323 | ifeq ($(local_use_binder),1) |
Casey Dahlin | a93cd53 | 2016-01-14 16:55:11 -0800 | [diff] [blame] | 324 | LOCAL_AIDL_INCLUDES += $(LOCAL_PATH)/binder_bindings |
Casey Dahlin | a93cd53 | 2016-01-14 16:55:11 -0800 | [diff] [blame] | 325 | LOCAL_SRC_FILES += \ |
| 326 | binder_bindings/android/brillo/IUpdateEngine.aidl \ |
| 327 | binder_bindings/android/brillo/IUpdateEngineStatusCallback.aidl \ |
Alex Deymo | fa78f14 | 2016-01-26 21:36:16 -0800 | [diff] [blame] | 328 | binder_service_brillo.cc \ |
Casey Dahlin | a93cd53 | 2016-01-14 16:55:11 -0800 | [diff] [blame] | 329 | parcelable_update_engine_status.cc |
Alex Deymo | 78a954f | 2016-01-21 20:32:40 -0800 | [diff] [blame] | 330 | endif # local_use_binder == 1 |
Alex Deymo | 0cd976d | 2016-02-11 18:45:01 -0800 | [diff] [blame] | 331 | ifeq ($(local_use_libcros),1) |
| 332 | LOCAL_SRC_FILES += \ |
| 333 | chrome_browser_proxy_resolver.cc |
| 334 | endif # local_use_libcros == 1 |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 335 | include $(BUILD_STATIC_LIBRARY) |
| 336 | |
Sen Jiang | 192a86a | 2016-05-19 17:21:24 -0700 | [diff] [blame] | 337 | else # local_use_omaha == 1 |
Alex Deymo | fa78f14 | 2016-01-26 21:36:16 -0800 | [diff] [blame] | 338 | |
| 339 | ifneq ($(local_use_binder),1) |
| 340 | $(error USE_BINDER is disabled but is required in non-Brillo devices.) |
| 341 | endif # local_use_binder == 1 |
| 342 | |
| 343 | # libupdate_engine_android (type: static_library) |
| 344 | # ======================================================== |
| 345 | # The main daemon static_library used in Android (non-Brillo). This only has a |
| 346 | # loop to apply payloads provided by the upper layer via a Binder interface. |
| 347 | ue_libupdate_engine_android_exported_static_libraries := \ |
| 348 | libpayload_consumer \ |
Alex Deymo | 5e3ea27 | 2016-01-28 13:42:23 -0800 | [diff] [blame] | 349 | libfs_mgr \ |
bowgotsai | 763e17c | 2017-01-24 16:59:57 +0800 | [diff] [blame] | 350 | libbase \ |
bowgotsai | cd67f91 | 2017-01-27 14:50:26 +0800 | [diff] [blame] | 351 | liblog \ |
Connor O'Brien | cee6ad9 | 2016-11-21 13:53:52 -0800 | [diff] [blame] | 352 | $(ue_libpayload_consumer_exported_static_libraries) \ |
| 353 | libupdate_engine_boot_control \ |
| 354 | $(ue_libupdate_engine_boot_control_exported_static_libraries) |
Alex Deymo | fa78f14 | 2016-01-26 21:36:16 -0800 | [diff] [blame] | 355 | ue_libupdate_engine_android_exported_shared_libraries := \ |
| 356 | $(ue_libpayload_consumer_exported_shared_libraries) \ |
Connor O'Brien | cee6ad9 | 2016-11-21 13:53:52 -0800 | [diff] [blame] | 357 | $(ue_libupdate_engine_boot_control_exported_shared_libraries) \ |
Alex Deymo | b8437be | 2016-12-09 16:28:12 -0800 | [diff] [blame] | 358 | libandroid_net \ |
Alex Deymo | fa78f14 | 2016-01-26 21:36:16 -0800 | [diff] [blame] | 359 | libbinder \ |
| 360 | libbinderwrapper \ |
| 361 | libbrillo-binder \ |
Alex Deymo | 5e3ea27 | 2016-01-28 13:42:23 -0800 | [diff] [blame] | 362 | libcutils \ |
Alex Deymo | 14c0da8 | 2016-07-20 16:45:45 -0700 | [diff] [blame] | 363 | libcurl \ |
Alex Deymo | 14c0da8 | 2016-07-20 16:45:45 -0700 | [diff] [blame] | 364 | libssl \ |
Alex Deymo | fa78f14 | 2016-01-26 21:36:16 -0800 | [diff] [blame] | 365 | libutils |
| 366 | |
| 367 | include $(CLEAR_VARS) |
| 368 | LOCAL_MODULE := libupdate_engine_android |
| 369 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 370 | LOCAL_CPP_EXTENSION := .cc |
| 371 | LOCAL_CLANG := true |
| 372 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 373 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 374 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
Alex Deymo | fb905d9 | 2016-06-03 19:26:58 -0700 | [diff] [blame] | 375 | LOCAL_C_INCLUDES := \ |
| 376 | $(ue_common_c_includes) \ |
| 377 | bootable/recovery |
Alex Deymo | 3b678db | 2016-02-09 11:50:06 -0800 | [diff] [blame] | 378 | #TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved |
| 379 | # out of the DBus interface. |
| 380 | LOCAL_C_INCLUDES += \ |
| 381 | external/cros/system_api/dbus |
Alex Deymo | fa78f14 | 2016-01-26 21:36:16 -0800 | [diff] [blame] | 382 | LOCAL_STATIC_LIBRARIES := \ |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 383 | $(ue_common_static_libraries) \ |
Alex Deymo | fa78f14 | 2016-01-26 21:36:16 -0800 | [diff] [blame] | 384 | $(ue_libupdate_engine_android_exported_static_libraries:-host=) |
| 385 | LOCAL_SHARED_LIBRARIES += \ |
| 386 | $(ue_common_shared_libraries) \ |
| 387 | $(ue_libupdate_engine_android_exported_shared_libraries:-host=) |
| 388 | LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder_bindings |
| 389 | LOCAL_SRC_FILES += \ |
| 390 | binder_bindings/android/os/IUpdateEngine.aidl \ |
| 391 | binder_bindings/android/os/IUpdateEngineCallback.aidl \ |
| 392 | binder_service_android.cc \ |
Alex Deymo | 14c0da8 | 2016-07-20 16:45:45 -0700 | [diff] [blame] | 393 | certificate_checker.cc \ |
Alex Deymo | fa78f14 | 2016-01-26 21:36:16 -0800 | [diff] [blame] | 394 | daemon.cc \ |
Alex Deymo | 5e3ea27 | 2016-01-28 13:42:23 -0800 | [diff] [blame] | 395 | daemon_state_android.cc \ |
| 396 | hardware_android.cc \ |
Alex Deymo | 14c0da8 | 2016-07-20 16:45:45 -0700 | [diff] [blame] | 397 | libcurl_http_fetcher.cc \ |
Alex Deymo | 87792ea | 2016-07-25 15:40:36 -0700 | [diff] [blame] | 398 | network_selector_android.cc \ |
Alex Deymo | 5e3ea27 | 2016-01-28 13:42:23 -0800 | [diff] [blame] | 399 | proxy_resolver.cc \ |
Alex Deymo | 3b678db | 2016-02-09 11:50:06 -0800 | [diff] [blame] | 400 | update_attempter_android.cc \ |
Alex Deymo | fb905d9 | 2016-06-03 19:26:58 -0700 | [diff] [blame] | 401 | update_status_utils.cc \ |
| 402 | utils_android.cc |
Alex Deymo | fa78f14 | 2016-01-26 21:36:16 -0800 | [diff] [blame] | 403 | include $(BUILD_STATIC_LIBRARY) |
| 404 | |
Sen Jiang | 192a86a | 2016-05-19 17:21:24 -0700 | [diff] [blame] | 405 | endif # local_use_omaha == 1 |
Alex Deymo | 4218b7e | 2015-11-17 21:14:42 -0300 | [diff] [blame] | 406 | |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 407 | # update_engine (type: executable) |
| 408 | # ======================================================== |
| 409 | # update_engine daemon. |
| 410 | include $(CLEAR_VARS) |
| 411 | LOCAL_MODULE := update_engine |
| 412 | LOCAL_MODULE_CLASS := EXECUTABLES |
Sen Jiang | 5609277 | 2015-11-23 14:41:00 -0800 | [diff] [blame] | 413 | LOCAL_REQUIRED_MODULES := \ |
Alex Deymo | ab49446 | 2015-11-30 17:07:36 -0300 | [diff] [blame] | 414 | cacerts_google |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 415 | LOCAL_CPP_EXTENSION := .cc |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 416 | LOCAL_CLANG := true |
| 417 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 418 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 419 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
| 420 | LOCAL_C_INCLUDES := \ |
Alex Deymo | 4218b7e | 2015-11-17 21:14:42 -0300 | [diff] [blame] | 421 | $(ue_common_c_includes) |
Alex Deymo | e97b39c | 2016-01-20 13:22:17 -0800 | [diff] [blame] | 422 | LOCAL_SHARED_LIBRARIES := \ |
| 423 | $(ue_common_shared_libraries) |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 424 | LOCAL_STATIC_LIBRARIES := \ |
| 425 | $(ue_common_static_libraries) |
Alex Deymo | e97b39c | 2016-01-20 13:22:17 -0800 | [diff] [blame] | 426 | LOCAL_SRC_FILES := \ |
| 427 | main.cc |
Alex Deymo | 4218b7e | 2015-11-17 21:14:42 -0300 | [diff] [blame] | 428 | |
Sen Jiang | 192a86a | 2016-05-19 17:21:24 -0700 | [diff] [blame] | 429 | ifeq ($(local_use_omaha),1) |
Alex Deymo | 4218b7e | 2015-11-17 21:14:42 -0300 | [diff] [blame] | 430 | LOCAL_C_INCLUDES += \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 431 | $(ue_libupdate_engine_exported_c_includes) |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 432 | LOCAL_STATIC_LIBRARIES += \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 433 | libupdate_engine \ |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 434 | $(ue_libupdate_engine_exported_static_libraries:-host=) |
Alex Deymo | e97b39c | 2016-01-20 13:22:17 -0800 | [diff] [blame] | 435 | LOCAL_SHARED_LIBRARIES += \ |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 436 | $(ue_libupdate_engine_exported_shared_libraries:-host=) |
Sen Jiang | 192a86a | 2016-05-19 17:21:24 -0700 | [diff] [blame] | 437 | else # local_use_omaha == 1 |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 438 | LOCAL_STATIC_LIBRARIES += \ |
Alex Deymo | fa78f14 | 2016-01-26 21:36:16 -0800 | [diff] [blame] | 439 | libupdate_engine_android \ |
| 440 | $(ue_libupdate_engine_android_exported_static_libraries:-host=) |
Alex Deymo | e97b39c | 2016-01-20 13:22:17 -0800 | [diff] [blame] | 441 | LOCAL_SHARED_LIBRARIES += \ |
Alex Deymo | fa78f14 | 2016-01-26 21:36:16 -0800 | [diff] [blame] | 442 | $(ue_libupdate_engine_android_exported_shared_libraries:-host=) |
Sen Jiang | 192a86a | 2016-05-19 17:21:24 -0700 | [diff] [blame] | 443 | endif # local_use_omaha == 1 |
Casey Dahlin | a93cd53 | 2016-01-14 16:55:11 -0800 | [diff] [blame] | 444 | |
Gilad Arnold | 70141f2 | 2015-09-17 09:06:30 -0700 | [diff] [blame] | 445 | LOCAL_INIT_RC := update_engine.rc |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 446 | include $(BUILD_EXECUTABLE) |
| 447 | |
Alex Deymo | 03a4de7 | 2016-07-20 16:08:23 -0700 | [diff] [blame] | 448 | # update_engine_sideload (type: executable) |
| 449 | # ======================================================== |
| 450 | # A static binary equivalent to update_engine daemon that installs an update |
| 451 | # from a local file directly instead of running in the background. |
| 452 | include $(CLEAR_VARS) |
| 453 | LOCAL_MODULE := update_engine_sideload |
Alex Deymo | 44348e0 | 2016-07-29 16:22:26 -0700 | [diff] [blame] | 454 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 455 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin |
Alex Deymo | 03a4de7 | 2016-07-20 16:08:23 -0700 | [diff] [blame] | 456 | LOCAL_MODULE_CLASS := EXECUTABLES |
Alex Deymo | 03a4de7 | 2016-07-20 16:08:23 -0700 | [diff] [blame] | 457 | LOCAL_CPP_EXTENSION := .cc |
| 458 | LOCAL_CLANG := true |
Alex Deymo | 14c0da8 | 2016-07-20 16:45:45 -0700 | [diff] [blame] | 459 | LOCAL_CFLAGS := \ |
| 460 | $(ue_common_cflags) \ |
| 461 | -D_UE_SIDELOAD |
Alex Deymo | 03a4de7 | 2016-07-20 16:08:23 -0700 | [diff] [blame] | 462 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 463 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
| 464 | LOCAL_C_INCLUDES := \ |
| 465 | $(ue_common_c_includes) \ |
| 466 | bootable/recovery |
| 467 | #TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved |
| 468 | # out of the DBus interface. |
| 469 | LOCAL_C_INCLUDES += \ |
| 470 | external/cros/system_api/dbus |
| 471 | LOCAL_SRC_FILES := \ |
Connor O'Brien | cee6ad9 | 2016-11-21 13:53:52 -0800 | [diff] [blame] | 472 | boot_control_recovery.cc \ |
Alex Deymo | 03a4de7 | 2016-07-20 16:08:23 -0700 | [diff] [blame] | 473 | hardware_android.cc \ |
| 474 | network_selector_stub.cc \ |
| 475 | proxy_resolver.cc \ |
| 476 | sideload_main.cc \ |
| 477 | update_attempter_android.cc \ |
| 478 | update_status_utils.cc \ |
| 479 | utils_android.cc |
| 480 | LOCAL_STATIC_LIBRARIES := \ |
| 481 | libfs_mgr \ |
bowgotsai | 763e17c | 2017-01-24 16:59:57 +0800 | [diff] [blame] | 482 | libbase \ |
bowgotsai | cd67f91 | 2017-01-27 14:50:26 +0800 | [diff] [blame] | 483 | liblog \ |
Alex Deymo | 03a4de7 | 2016-07-20 16:08:23 -0700 | [diff] [blame] | 484 | libpayload_consumer \ |
| 485 | update_metadata-protos \ |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 486 | $(ue_common_static_libraries) \ |
Alex Deymo | 03a4de7 | 2016-07-20 16:08:23 -0700 | [diff] [blame] | 487 | $(ue_libpayload_consumer_exported_static_libraries:-host=) \ |
| 488 | $(ue_update_metadata_protos_exported_static_libraries) |
Alex Deymo | 44348e0 | 2016-07-29 16:22:26 -0700 | [diff] [blame] | 489 | # We add the static versions of the shared libraries since we are forcing this |
| 490 | # binary to be a static binary, so we also need to include all the static |
| 491 | # library dependencies of these static libraries. |
| 492 | LOCAL_STATIC_LIBRARIES += \ |
Alex Deymo | 03a4de7 | 2016-07-20 16:08:23 -0700 | [diff] [blame] | 493 | $(ue_common_shared_libraries) \ |
Alex Deymo | 03a4de7 | 2016-07-20 16:08:23 -0700 | [diff] [blame] | 494 | libcutils \ |
Dimitry Ivanov | e9ae98c | 2016-09-24 22:35:07 -0700 | [diff] [blame] | 495 | liblog \ |
Alex Deymo | 03a4de7 | 2016-07-20 16:08:23 -0700 | [diff] [blame] | 496 | $(ue_libpayload_consumer_exported_shared_libraries:-host=) \ |
Alex Deymo | 44348e0 | 2016-07-29 16:22:26 -0700 | [diff] [blame] | 497 | $(ue_update_metadata_protos_exported_shared_libraries) \ |
| 498 | libevent \ |
| 499 | libmodpb64 \ |
| 500 | libgtest_prod |
| 501 | # libchrome requires these extra LDFLAGS which are not propagated through the |
| 502 | # build system. |
| 503 | LOCAL_LDFLAGS += \ |
| 504 | -Wl,-wrap,calloc \ |
| 505 | -Wl,-wrap,free \ |
| 506 | -Wl,-wrap,malloc \ |
| 507 | -Wl,-wrap,memalign \ |
| 508 | -Wl,-wrap,realloc |
| 509 | |
| 510 | ifeq ($(strip $(PRODUCT_STATIC_BOOT_CONTROL_HAL)),) |
| 511 | # No static boot_control HAL defined, so no sideload support. We use a fake |
| 512 | # boot_control HAL to allow compiling update_engine_sideload for test purposes. |
| 513 | ifeq ($(strip $(AB_OTA_UPDATER)),true) |
| 514 | $(warning No PRODUCT_STATIC_BOOT_CONTROL_HAL configured but AB_OTA_UPDATER is \ |
| 515 | true, no update sideload support.) |
| 516 | endif # AB_OTA_UPDATER == true |
| 517 | LOCAL_SRC_FILES += \ |
| 518 | boot_control_recovery_stub.cc |
| 519 | else # PRODUCT_STATIC_BOOT_CONTROL_HAL != "" |
| 520 | LOCAL_STATIC_LIBRARIES += \ |
| 521 | $(PRODUCT_STATIC_BOOT_CONTROL_HAL) |
| 522 | endif # PRODUCT_STATIC_BOOT_CONTROL_HAL != "" |
| 523 | |
Alex Deymo | 03a4de7 | 2016-07-20 16:08:23 -0700 | [diff] [blame] | 524 | include $(BUILD_EXECUTABLE) |
| 525 | |
Alex Deymo | a96ddc1 | 2016-02-10 15:59:03 -0800 | [diff] [blame] | 526 | # libupdate_engine_client (type: shared_library) |
| 527 | # ======================================================== |
| 528 | include $(CLEAR_VARS) |
| 529 | LOCAL_MODULE := libupdate_engine_client |
| 530 | LOCAL_CFLAGS := \ |
| 531 | -Wall \ |
| 532 | -Werror \ |
| 533 | -Wno-unused-parameter \ |
Alex Deymo | a96ddc1 | 2016-02-10 15:59:03 -0800 | [diff] [blame] | 534 | -DUSE_BINDER=$(local_use_binder) |
| 535 | LOCAL_CLANG := true |
| 536 | LOCAL_CPP_EXTENSION := .cc |
| 537 | # TODO(deymo): Remove "external/cros/system_api/dbus" when dbus is not used. |
| 538 | LOCAL_C_INCLUDES := \ |
| 539 | $(LOCAL_PATH)/client_library/include \ |
| 540 | external/cros/system_api/dbus \ |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 541 | system |
Alex Deymo | a96ddc1 | 2016-02-10 15:59:03 -0800 | [diff] [blame] | 542 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/client_library/include |
| 543 | LOCAL_SHARED_LIBRARIES := \ |
| 544 | libchrome \ |
| 545 | libbrillo |
| 546 | LOCAL_SRC_FILES := \ |
| 547 | client_library/client.cc \ |
| 548 | update_status_utils.cc |
| 549 | |
Sen Jiang | a7c4de2 | 2017-03-02 15:53:54 -0800 | [diff] [blame] | 550 | # We only support binder IPC mechanism in Android. |
Alex Deymo | a96ddc1 | 2016-02-10 15:59:03 -0800 | [diff] [blame] | 551 | ifeq ($(local_use_binder),1) |
| 552 | LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder_bindings |
| 553 | LOCAL_SHARED_LIBRARIES += \ |
| 554 | libbinder \ |
| 555 | libbrillo-binder \ |
| 556 | libutils |
| 557 | LOCAL_SRC_FILES += \ |
| 558 | binder_bindings/android/brillo/IUpdateEngine.aidl \ |
| 559 | binder_bindings/android/brillo/IUpdateEngineStatusCallback.aidl \ |
| 560 | client_library/client_binder.cc \ |
| 561 | parcelable_update_engine_status.cc |
Alex Deymo | a96ddc1 | 2016-02-10 15:59:03 -0800 | [diff] [blame] | 562 | endif # local_use_binder == 1 |
| 563 | |
| 564 | include $(BUILD_SHARED_LIBRARY) |
| 565 | |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 566 | # update_engine_client (type: executable) |
| 567 | # ======================================================== |
| 568 | # update_engine console client. |
| 569 | include $(CLEAR_VARS) |
| 570 | LOCAL_MODULE := update_engine_client |
| 571 | LOCAL_MODULE_CLASS := EXECUTABLES |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 572 | LOCAL_CPP_EXTENSION := .cc |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 573 | LOCAL_CLANG := true |
| 574 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 575 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 576 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
Casey Dahlin | ce90f44 | 2016-01-25 16:55:28 -0800 | [diff] [blame] | 577 | LOCAL_C_INCLUDES := $(ue_common_c_includes) |
Alex Deymo | 5f52811 | 2016-01-27 23:32:36 -0800 | [diff] [blame] | 578 | LOCAL_SHARED_LIBRARIES := $(ue_common_shared_libraries) |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 579 | LOCAL_STATIC_LIBRARIES := $(ue_common_static_libraries) |
Sen Jiang | 192a86a | 2016-05-19 17:21:24 -0700 | [diff] [blame] | 580 | ifeq ($(local_use_omaha),1) |
Alex Deymo | 5f52811 | 2016-01-27 23:32:36 -0800 | [diff] [blame] | 581 | LOCAL_SHARED_LIBRARIES += \ |
Casey Dahlin | e844c1a | 2015-12-16 14:30:58 -0800 | [diff] [blame] | 582 | libupdate_engine_client |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 583 | LOCAL_SRC_FILES := \ |
Shuqian Zhao | 2997173 | 2016-02-05 11:29:32 -0800 | [diff] [blame] | 584 | update_engine_client.cc \ |
Alex Deymo | b3fa53b | 2016-04-18 19:57:58 -0700 | [diff] [blame] | 585 | common/error_code_utils.cc \ |
| 586 | omaha_utils.cc |
Sen Jiang | 192a86a | 2016-05-19 17:21:24 -0700 | [diff] [blame] | 587 | else # local_use_omaha == 1 |
Alex Deymo | 5f52811 | 2016-01-27 23:32:36 -0800 | [diff] [blame] | 588 | #TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved |
| 589 | # out of the DBus interface. |
| 590 | LOCAL_C_INCLUDES += \ |
| 591 | external/cros/system_api/dbus |
| 592 | LOCAL_SHARED_LIBRARIES += \ |
| 593 | libbinder \ |
Alex Deymo | 2130ee0 | 2016-02-02 18:35:50 -0800 | [diff] [blame] | 594 | libbinderwrapper \ |
Alex Deymo | 5f52811 | 2016-01-27 23:32:36 -0800 | [diff] [blame] | 595 | libbrillo-binder \ |
| 596 | libutils |
| 597 | LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder_bindings |
| 598 | LOCAL_SRC_FILES := \ |
| 599 | binder_bindings/android/os/IUpdateEngine.aidl \ |
| 600 | binder_bindings/android/os/IUpdateEngineCallback.aidl \ |
Alex Deymo | e88e9fe | 2016-02-03 16:38:00 -0800 | [diff] [blame] | 601 | common/error_code_utils.cc \ |
Alex Deymo | 5f52811 | 2016-01-27 23:32:36 -0800 | [diff] [blame] | 602 | update_engine_client_android.cc \ |
| 603 | update_status_utils.cc |
Sen Jiang | 192a86a | 2016-05-19 17:21:24 -0700 | [diff] [blame] | 604 | endif # local_use_omaha == 1 |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 605 | include $(BUILD_EXECUTABLE) |
| 606 | |
| 607 | # libpayload_generator (type: static_library) |
| 608 | # ======================================================== |
| 609 | # server-side code. This is used for delta_generator and unittests but not |
| 610 | # for any client code. |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 611 | ue_libpayload_generator_exported_static_libraries := \ |
Alex Deymo | b09305e | 2015-12-02 16:09:13 -0300 | [diff] [blame] | 612 | libpayload_consumer \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 613 | update_metadata-protos \ |
Alex Deymo | 246bf21 | 2016-03-22 19:27:33 -0700 | [diff] [blame] | 614 | liblzma \ |
Alex Deymo | b09305e | 2015-12-02 16:09:13 -0300 | [diff] [blame] | 615 | $(ue_libpayload_consumer_exported_static_libraries) \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 616 | $(ue_update_metadata_protos_exported_static_libraries) |
| 617 | ue_libpayload_generator_exported_shared_libraries := \ |
Alex Deymo | 89f6d67 | 2017-01-13 17:26:52 -0800 | [diff] [blame] | 618 | libext2fs \ |
Alex Deymo | b09305e | 2015-12-02 16:09:13 -0300 | [diff] [blame] | 619 | $(ue_libpayload_consumer_exported_shared_libraries) \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 620 | $(ue_update_metadata_protos_exported_shared_libraries) |
| 621 | |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 622 | ue_libpayload_generator_src_files := \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 623 | payload_generator/ab_generator.cc \ |
| 624 | payload_generator/annotated_operation.cc \ |
| 625 | payload_generator/blob_file_writer.cc \ |
| 626 | payload_generator/block_mapping.cc \ |
Alex Deymo | 0bc2611 | 2015-10-19 20:54:57 -0700 | [diff] [blame] | 627 | payload_generator/bzip.cc \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 628 | payload_generator/cycle_breaker.cc \ |
| 629 | payload_generator/delta_diff_generator.cc \ |
| 630 | payload_generator/delta_diff_utils.cc \ |
| 631 | payload_generator/ext2_filesystem.cc \ |
| 632 | payload_generator/extent_ranges.cc \ |
| 633 | payload_generator/extent_utils.cc \ |
| 634 | payload_generator/full_update_generator.cc \ |
| 635 | payload_generator/graph_types.cc \ |
| 636 | payload_generator/graph_utils.cc \ |
| 637 | payload_generator/inplace_generator.cc \ |
Alex Deymo | 20bdc70 | 2016-12-07 21:07:11 -0800 | [diff] [blame] | 638 | payload_generator/mapfile_filesystem.cc \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 639 | payload_generator/payload_file.cc \ |
| 640 | payload_generator/payload_generation_config.cc \ |
| 641 | payload_generator/payload_signer.cc \ |
| 642 | payload_generator/raw_filesystem.cc \ |
| 643 | payload_generator/tarjan.cc \ |
Alex Deymo | 246bf21 | 2016-03-22 19:27:33 -0700 | [diff] [blame] | 644 | payload_generator/topological_sort.cc \ |
| 645 | payload_generator/xz_android.cc |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 646 | |
| 647 | ifeq ($(HOST_OS),linux) |
| 648 | # Build for the host. |
| 649 | include $(CLEAR_VARS) |
| 650 | LOCAL_MODULE := libpayload_generator |
| 651 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 652 | LOCAL_CPP_EXTENSION := .cc |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 653 | LOCAL_CLANG := true |
| 654 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 655 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 656 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
| 657 | LOCAL_C_INCLUDES := $(ue_common_c_includes) |
| 658 | LOCAL_STATIC_LIBRARIES := \ |
| 659 | libpayload_consumer \ |
| 660 | update_metadata-protos \ |
Alex Deymo | 246bf21 | 2016-03-22 19:27:33 -0700 | [diff] [blame] | 661 | liblzma \ |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 662 | $(ue_common_static_libraries) \ |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 663 | $(ue_libpayload_consumer_exported_static_libraries) \ |
| 664 | $(ue_update_metadata_protos_exported_static_libraries) |
| 665 | LOCAL_SHARED_LIBRARIES := \ |
| 666 | $(ue_common_shared_libraries) \ |
| 667 | $(ue_libpayload_generator_exported_shared_libraries) \ |
| 668 | $(ue_libpayload_consumer_exported_shared_libraries) \ |
| 669 | $(ue_update_metadata_protos_exported_shared_libraries) |
| 670 | LOCAL_SRC_FILES := $(ue_libpayload_generator_src_files) |
| 671 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 672 | endif # HOST_OS == linux |
| 673 | |
| 674 | # Build for the target. |
| 675 | include $(CLEAR_VARS) |
| 676 | LOCAL_MODULE := libpayload_generator |
| 677 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 678 | LOCAL_CPP_EXTENSION := .cc |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 679 | LOCAL_CLANG := true |
| 680 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 681 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 682 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
| 683 | LOCAL_C_INCLUDES := $(ue_common_c_includes) |
| 684 | LOCAL_STATIC_LIBRARIES := \ |
| 685 | libpayload_consumer \ |
| 686 | update_metadata-protos \ |
Alex Deymo | 246bf21 | 2016-03-22 19:27:33 -0700 | [diff] [blame] | 687 | liblzma \ |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 688 | $(ue_common_static_libraries) \ |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 689 | $(ue_libpayload_consumer_exported_static_libraries:-host=) \ |
| 690 | $(ue_update_metadata_protos_exported_static_libraries) |
| 691 | LOCAL_SHARED_LIBRARIES := \ |
| 692 | $(ue_common_shared_libraries) \ |
| 693 | $(ue_libpayload_generator_exported_shared_libraries:-host=) \ |
| 694 | $(ue_libpayload_consumer_exported_shared_libraries:-host=) \ |
| 695 | $(ue_update_metadata_protos_exported_shared_libraries) |
| 696 | LOCAL_SRC_FILES := $(ue_libpayload_generator_src_files) |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 697 | include $(BUILD_STATIC_LIBRARY) |
| 698 | |
| 699 | # delta_generator (type: executable) |
| 700 | # ======================================================== |
| 701 | # server-side delta generator. |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 702 | ue_delta_generator_src_files := \ |
| 703 | payload_generator/generate_delta_main.cc |
| 704 | |
| 705 | ifeq ($(HOST_OS),linux) |
| 706 | # Build for the host. |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 707 | include $(CLEAR_VARS) |
| 708 | LOCAL_MODULE := delta_generator |
Alex Deymo | 616fd4f | 2016-04-06 20:30:38 -0700 | [diff] [blame] | 709 | LOCAL_REQUIRED_MODULES := \ |
| 710 | bsdiff \ |
| 711 | imgdiff |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 712 | LOCAL_MODULE_CLASS := EXECUTABLES |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 713 | LOCAL_CPP_EXTENSION := .cc |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 714 | LOCAL_CLANG := true |
| 715 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 716 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 717 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
Alex Deymo | b09305e | 2015-12-02 16:09:13 -0300 | [diff] [blame] | 718 | LOCAL_C_INCLUDES := $(ue_common_c_includes) |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 719 | LOCAL_STATIC_LIBRARIES := \ |
Alex Deymo | b09305e | 2015-12-02 16:09:13 -0300 | [diff] [blame] | 720 | libpayload_consumer \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 721 | libpayload_generator \ |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 722 | $(ue_common_static_libraries) \ |
Alex Deymo | b09305e | 2015-12-02 16:09:13 -0300 | [diff] [blame] | 723 | $(ue_libpayload_consumer_exported_static_libraries) \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 724 | $(ue_libpayload_generator_exported_static_libraries) |
| 725 | LOCAL_SHARED_LIBRARIES := \ |
| 726 | $(ue_common_shared_libraries) \ |
Alex Deymo | b09305e | 2015-12-02 16:09:13 -0300 | [diff] [blame] | 727 | $(ue_libpayload_consumer_exported_shared_libraries) \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 728 | $(ue_libpayload_generator_exported_shared_libraries) |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 729 | LOCAL_SRC_FILES := $(ue_delta_generator_src_files) |
| 730 | include $(BUILD_HOST_EXECUTABLE) |
| 731 | endif # HOST_OS == linux |
| 732 | |
| 733 | # Build for the target. |
| 734 | include $(CLEAR_VARS) |
Sen Jiang | 5a216c1 | 2016-03-30 13:08:24 -0700 | [diff] [blame] | 735 | LOCAL_MODULE := ue_unittest_delta_generator |
| 736 | LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests |
| 737 | LOCAL_MODULE_STEM := delta_generator |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 738 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 739 | LOCAL_CPP_EXTENSION := .cc |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 740 | LOCAL_CLANG := true |
| 741 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 742 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 743 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
| 744 | LOCAL_C_INCLUDES := $(ue_common_c_includes) |
| 745 | LOCAL_STATIC_LIBRARIES := \ |
| 746 | libpayload_consumer \ |
| 747 | libpayload_generator \ |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 748 | $(ue_common_static_libraries) \ |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 749 | $(ue_libpayload_consumer_exported_static_libraries:-host=) \ |
| 750 | $(ue_libpayload_generator_exported_static_libraries:-host=) |
| 751 | LOCAL_SHARED_LIBRARIES := \ |
| 752 | $(ue_common_shared_libraries) \ |
| 753 | $(ue_libpayload_consumer_exported_shared_libraries:-host=) \ |
| 754 | $(ue_libpayload_generator_exported_shared_libraries:-host=) |
| 755 | LOCAL_SRC_FILES := $(ue_delta_generator_src_files) |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 756 | include $(BUILD_EXECUTABLE) |
| 757 | |
Sen Jiang | 923886a | 2016-03-14 15:04:28 -0700 | [diff] [blame] | 758 | # Private and public keys for unittests. |
| 759 | # ======================================================== |
| 760 | # Generate a module that installs a prebuilt private key and a module that |
| 761 | # installs a public key generated from the private key. |
| 762 | # |
| 763 | # $(1): The path to the private key in pem format. |
| 764 | define ue-unittest-keys |
| 765 | $(eval include $(CLEAR_VARS)) \ |
| 766 | $(eval LOCAL_MODULE := ue_$(1).pem) \ |
| 767 | $(eval LOCAL_MODULE_CLASS := ETC) \ |
| 768 | $(eval $(ifeq $(BRILLO), 1, LOCAL_MODULE_TAGS := eng)) \ |
| 769 | $(eval LOCAL_SRC_FILES := $(1).pem) \ |
| 770 | $(eval LOCAL_MODULE_PATH := \ |
| 771 | $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests) \ |
| 772 | $(eval LOCAL_MODULE_STEM := $(1).pem) \ |
| 773 | $(eval include $(BUILD_PREBUILT)) \ |
| 774 | \ |
| 775 | $(eval include $(CLEAR_VARS)) \ |
| 776 | $(eval LOCAL_MODULE := ue_$(1).pub.pem) \ |
| 777 | $(eval LOCAL_MODULE_CLASS := ETC) \ |
| 778 | $(eval $(ifeq $(BRILLO), 1, LOCAL_MODULE_TAGS := eng)) \ |
| 779 | $(eval LOCAL_MODULE_PATH := \ |
| 780 | $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests) \ |
| 781 | $(eval LOCAL_MODULE_STEM := $(1).pub.pem) \ |
| 782 | $(eval include $(BUILD_SYSTEM)/base_rules.mk) \ |
| 783 | $(eval $(LOCAL_BUILT_MODULE) : $(LOCAL_PATH)/$(1).pem ; \ |
| 784 | openssl rsa -in $$< -pubout -out $$@) |
| 785 | endef |
| 786 | |
| 787 | $(call ue-unittest-keys,unittest_key) |
| 788 | $(call ue-unittest-keys,unittest_key2) |
| 789 | |
Alex Deymo | c90be63 | 2016-02-17 19:25:20 -0800 | [diff] [blame] | 790 | # Sample images for unittests. |
| 791 | # ======================================================== |
| 792 | # Generate a prebuilt module that installs a sample image from the compressed |
| 793 | # sample_images.tar.bz2 file used by the unittests. |
| 794 | # |
| 795 | # $(1): The filename in the sample_images.tar.bz2 |
| 796 | define ue-unittest-sample-image |
| 797 | $(eval include $(CLEAR_VARS)) \ |
| 798 | $(eval LOCAL_MODULE := ue_unittest_$(1)) \ |
| 799 | $(eval LOCAL_MODULE_CLASS := EXECUTABLES) \ |
| 800 | $(eval $(ifeq $(BRILLO), 1, LOCAL_MODULE_TAGS := eng)) \ |
| 801 | $(eval LOCAL_MODULE_PATH := \ |
| 802 | $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests/gen) \ |
| 803 | $(eval LOCAL_MODULE_STEM := $(1)) \ |
Alex Deymo | a3553e4 | 2016-03-04 18:55:05 -0800 | [diff] [blame] | 804 | $(eval include $(BUILD_SYSTEM)/base_rules.mk) \ |
| 805 | $(eval $(LOCAL_BUILT_MODULE) : \ |
| 806 | $(LOCAL_PATH)/sample_images/sample_images.tar.bz2 ; \ |
| 807 | tar -jxf $$< -C $$(dir $$@) $$(notdir $$@) && touch $$@) |
Alex Deymo | c90be63 | 2016-02-17 19:25:20 -0800 | [diff] [blame] | 808 | endef |
| 809 | |
| 810 | $(call ue-unittest-sample-image,disk_ext2_1k.img) |
| 811 | $(call ue-unittest-sample-image,disk_ext2_4k.img) |
| 812 | $(call ue-unittest-sample-image,disk_ext2_4k_empty.img) |
Alex Deymo | d15c546 | 2016-03-09 18:11:12 -0800 | [diff] [blame] | 813 | $(call ue-unittest-sample-image,disk_ext2_unittest.img) |
Alex Deymo | c90be63 | 2016-02-17 19:25:20 -0800 | [diff] [blame] | 814 | |
Sen Jiang | e0d0428 | 2016-03-01 14:22:52 -0800 | [diff] [blame] | 815 | # Zlib Fingerprint |
| 816 | # ======================================================== |
| 817 | include $(CLEAR_VARS) |
| 818 | LOCAL_MODULE := zlib_fingerprint |
| 819 | LOCAL_MODULE_CLASS := ETC |
| 820 | LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests |
| 821 | LOCAL_PREBUILT_MODULE_FILE := $(TARGET_OUT_COMMON_GEN)/zlib_fingerprint |
| 822 | include $(BUILD_PREBUILT) |
| 823 | |
Sen Jiang | ee63c6e | 2016-03-30 14:01:02 -0700 | [diff] [blame] | 824 | # update_engine.conf |
| 825 | # ======================================================== |
| 826 | include $(CLEAR_VARS) |
| 827 | LOCAL_MODULE := ue_unittest_update_engine.conf |
| 828 | LOCAL_MODULE_CLASS := ETC |
| 829 | LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests |
| 830 | LOCAL_MODULE_STEM := update_engine.conf |
| 831 | LOCAL_SRC_FILES := update_engine.conf |
| 832 | include $(BUILD_PREBUILT) |
| 833 | |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 834 | # test_http_server (type: executable) |
| 835 | # ======================================================== |
| 836 | # Test HTTP Server. |
| 837 | include $(CLEAR_VARS) |
| 838 | LOCAL_MODULE := test_http_server |
Alex Deymo | dc873fa | 2016-03-03 22:32:47 -0800 | [diff] [blame] | 839 | LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 840 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 841 | LOCAL_CPP_EXTENSION := .cc |
| 842 | LOCAL_CLANG := true |
| 843 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 844 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 845 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
| 846 | LOCAL_C_INCLUDES := $(ue_common_c_includes) |
| 847 | LOCAL_SHARED_LIBRARIES := $(ue_common_shared_libraries) |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 848 | LOCAL_STATIC_LIBRARIES := $(ue_common_static_libraries) |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 849 | LOCAL_SRC_FILES := \ |
| 850 | common/http_common.cc \ |
| 851 | test_http_server.cc |
Alex Deymo | dc873fa | 2016-03-03 22:32:47 -0800 | [diff] [blame] | 852 | include $(BUILD_EXECUTABLE) |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 853 | |
Sen Jiang | a78ee10 | 2016-04-01 14:15:08 -0700 | [diff] [blame] | 854 | # bsdiff (type: executable) |
| 855 | # ======================================================== |
| 856 | # We need bsdiff in the update_engine_unittests directory, so we build it here. |
| 857 | include $(CLEAR_VARS) |
| 858 | LOCAL_MODULE := ue_unittest_bsdiff |
| 859 | LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests |
| 860 | LOCAL_MODULE_STEM := bsdiff |
| 861 | LOCAL_CPP_EXTENSION := .cc |
| 862 | LOCAL_SRC_FILES := ../../external/bsdiff/bsdiff_main.cc |
Sen Jiang | 1514d68 | 2016-04-08 14:20:31 -0700 | [diff] [blame] | 863 | LOCAL_CFLAGS := \ |
| 864 | -D_FILE_OFFSET_BITS=64 \ |
| 865 | -Wall \ |
| 866 | -Werror \ |
| 867 | -Wextra \ |
| 868 | -Wno-unused-parameter |
Sen Jiang | a78ee10 | 2016-04-01 14:15:08 -0700 | [diff] [blame] | 869 | LOCAL_STATIC_LIBRARIES := \ |
| 870 | libbsdiff \ |
Sen Jiang | 1514d68 | 2016-04-08 14:20:31 -0700 | [diff] [blame] | 871 | libbz \ |
| 872 | libdivsufsort64 \ |
| 873 | libdivsufsort |
Sen Jiang | a78ee10 | 2016-04-01 14:15:08 -0700 | [diff] [blame] | 874 | include $(BUILD_EXECUTABLE) |
| 875 | |
Alex Deymo | 279d572 | 2016-04-07 16:22:13 -0700 | [diff] [blame] | 876 | # test_subprocess (type: executable) |
| 877 | # ======================================================== |
| 878 | # Test helper subprocess program. |
| 879 | include $(CLEAR_VARS) |
| 880 | LOCAL_MODULE := test_subprocess |
Alex Deymo | 279d572 | 2016-04-07 16:22:13 -0700 | [diff] [blame] | 881 | LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests |
| 882 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 883 | LOCAL_CPP_EXTENSION := .cc |
| 884 | LOCAL_CLANG := true |
| 885 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 886 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 887 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
| 888 | LOCAL_C_INCLUDES := $(ue_common_c_includes) |
| 889 | LOCAL_SHARED_LIBRARIES := $(ue_common_shared_libraries) |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 890 | LOCAL_STATIC_LIBRARIES := $(ue_common_static_libraries) |
Alex Deymo | 279d572 | 2016-04-07 16:22:13 -0700 | [diff] [blame] | 891 | LOCAL_SRC_FILES := test_subprocess.cc |
| 892 | include $(BUILD_EXECUTABLE) |
| 893 | |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 894 | # update_engine_unittests (type: executable) |
| 895 | # ======================================================== |
| 896 | # Main unittest file. |
| 897 | include $(CLEAR_VARS) |
| 898 | LOCAL_MODULE := update_engine_unittests |
Alex Deymo | c90be63 | 2016-02-17 19:25:20 -0800 | [diff] [blame] | 899 | LOCAL_REQUIRED_MODULES := \ |
Alex Deymo | 279d572 | 2016-04-07 16:22:13 -0700 | [diff] [blame] | 900 | test_http_server \ |
| 901 | test_subprocess \ |
Sen Jiang | a78ee10 | 2016-04-01 14:15:08 -0700 | [diff] [blame] | 902 | ue_unittest_bsdiff \ |
Sen Jiang | 5a216c1 | 2016-03-30 13:08:24 -0700 | [diff] [blame] | 903 | ue_unittest_delta_generator \ |
Alex Deymo | c90be63 | 2016-02-17 19:25:20 -0800 | [diff] [blame] | 904 | ue_unittest_disk_ext2_1k.img \ |
| 905 | ue_unittest_disk_ext2_4k.img \ |
| 906 | ue_unittest_disk_ext2_4k_empty.img \ |
Sen Jiang | 923886a | 2016-03-14 15:04:28 -0700 | [diff] [blame] | 907 | ue_unittest_disk_ext2_unittest.img \ |
| 908 | ue_unittest_key.pem \ |
| 909 | ue_unittest_key.pub.pem \ |
| 910 | ue_unittest_key2.pem \ |
Sen Jiang | e0d0428 | 2016-03-01 14:22:52 -0800 | [diff] [blame] | 911 | ue_unittest_key2.pub.pem \ |
Sen Jiang | ee63c6e | 2016-03-30 14:01:02 -0700 | [diff] [blame] | 912 | ue_unittest_update_engine.conf \ |
Sen Jiang | e0d0428 | 2016-03-01 14:22:52 -0800 | [diff] [blame] | 913 | zlib_fingerprint |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 914 | LOCAL_CPP_EXTENSION := .cc |
| 915 | LOCAL_CLANG := true |
| 916 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 917 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 918 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
| 919 | LOCAL_C_INCLUDES := \ |
| 920 | $(ue_common_c_includes) \ |
| 921 | $(ue_libupdate_engine_exported_c_includes) |
| 922 | LOCAL_STATIC_LIBRARIES := \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 923 | libpayload_generator \ |
| 924 | libbrillo-test-helpers \ |
| 925 | libgmock \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 926 | libchrome_test_helpers \ |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 927 | $(ue_common_static_libraries) \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 928 | $(ue_libpayload_generator_exported_static_libraries:-host=) |
| 929 | LOCAL_SHARED_LIBRARIES := \ |
| 930 | $(ue_common_shared_libraries) \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 931 | $(ue_libpayload_generator_exported_shared_libraries:-host=) |
| 932 | LOCAL_SRC_FILES := \ |
Alex Deymo | 14c0da8 | 2016-07-20 16:45:45 -0700 | [diff] [blame] | 933 | certificate_checker_unittest.cc \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 934 | common/action_pipe_unittest.cc \ |
| 935 | common/action_processor_unittest.cc \ |
| 936 | common/action_unittest.cc \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 937 | common/cpu_limiter_unittest.cc \ |
| 938 | common/fake_prefs.cc \ |
Alex Deymo | 2c131bb | 2016-05-26 16:43:13 -0700 | [diff] [blame] | 939 | common/file_fetcher_unittest.cc \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 940 | common/hash_calculator_unittest.cc \ |
| 941 | common/http_fetcher_unittest.cc \ |
| 942 | common/hwid_override_unittest.cc \ |
| 943 | common/mock_http_fetcher.cc \ |
| 944 | common/prefs_unittest.cc \ |
| 945 | common/subprocess_unittest.cc \ |
| 946 | common/terminator_unittest.cc \ |
| 947 | common/test_utils.cc \ |
| 948 | common/utils_unittest.cc \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 949 | payload_consumer/bzip_extent_writer_unittest.cc \ |
| 950 | payload_consumer/delta_performer_integration_test.cc \ |
| 951 | payload_consumer/delta_performer_unittest.cc \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 952 | payload_consumer/extent_writer_unittest.cc \ |
| 953 | payload_consumer/file_writer_unittest.cc \ |
| 954 | payload_consumer/filesystem_verifier_action_unittest.cc \ |
| 955 | payload_consumer/postinstall_runner_action_unittest.cc \ |
| 956 | payload_consumer/xz_extent_writer_unittest.cc \ |
| 957 | payload_generator/ab_generator_unittest.cc \ |
| 958 | payload_generator/blob_file_writer_unittest.cc \ |
| 959 | payload_generator/block_mapping_unittest.cc \ |
| 960 | payload_generator/cycle_breaker_unittest.cc \ |
| 961 | payload_generator/delta_diff_utils_unittest.cc \ |
| 962 | payload_generator/ext2_filesystem_unittest.cc \ |
| 963 | payload_generator/extent_ranges_unittest.cc \ |
| 964 | payload_generator/extent_utils_unittest.cc \ |
| 965 | payload_generator/fake_filesystem.cc \ |
| 966 | payload_generator/full_update_generator_unittest.cc \ |
| 967 | payload_generator/graph_utils_unittest.cc \ |
| 968 | payload_generator/inplace_generator_unittest.cc \ |
Alex Deymo | 20bdc70 | 2016-12-07 21:07:11 -0800 | [diff] [blame] | 969 | payload_generator/mapfile_filesystem_unittest.cc \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 970 | payload_generator/payload_file_unittest.cc \ |
| 971 | payload_generator/payload_generation_config_unittest.cc \ |
| 972 | payload_generator/payload_signer_unittest.cc \ |
| 973 | payload_generator/tarjan_unittest.cc \ |
| 974 | payload_generator/topological_sort_unittest.cc \ |
| 975 | payload_generator/zip_unittest.cc \ |
Alex Deymo | 3582194 | 2017-02-05 04:36:02 +0000 | [diff] [blame] | 976 | proxy_resolver_unittest.cc \ |
Sen Jiang | 24ab6c0 | 2016-06-22 16:26:47 -0700 | [diff] [blame] | 977 | testrunner.cc |
| 978 | ifeq ($(local_use_omaha),1) |
| 979 | LOCAL_C_INCLUDES += \ |
| 980 | $(ue_libupdate_engine_exported_c_includes) |
| 981 | LOCAL_STATIC_LIBRARIES += \ |
| 982 | libupdate_engine \ |
| 983 | $(ue_libupdate_engine_exported_static_libraries:-host=) |
| 984 | LOCAL_SHARED_LIBRARIES += \ |
| 985 | $(ue_libupdate_engine_exported_shared_libraries:-host=) |
| 986 | LOCAL_SRC_FILES += \ |
| 987 | common_service_unittest.cc \ |
| 988 | fake_system_state.cc \ |
| 989 | metrics_utils_unittest.cc \ |
| 990 | omaha_request_action_unittest.cc \ |
| 991 | omaha_request_params_unittest.cc \ |
| 992 | omaha_response_handler_action_unittest.cc \ |
| 993 | omaha_utils_unittest.cc \ |
| 994 | p2p_manager_unittest.cc \ |
| 995 | payload_consumer/download_action_unittest.cc \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 996 | payload_state_unittest.cc \ |
| 997 | update_attempter_unittest.cc \ |
| 998 | update_manager/boxed_value_unittest.cc \ |
| 999 | update_manager/chromeos_policy_unittest.cc \ |
| 1000 | update_manager/evaluation_context_unittest.cc \ |
| 1001 | update_manager/generic_variables_unittest.cc \ |
| 1002 | update_manager/prng_unittest.cc \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 1003 | update_manager/real_device_policy_provider_unittest.cc \ |
| 1004 | update_manager/real_random_provider_unittest.cc \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 1005 | update_manager/real_system_provider_unittest.cc \ |
| 1006 | update_manager/real_time_provider_unittest.cc \ |
| 1007 | update_manager/real_updater_provider_unittest.cc \ |
| 1008 | update_manager/umtest_utils.cc \ |
| 1009 | update_manager/update_manager_unittest.cc \ |
Sen Jiang | 24ab6c0 | 2016-06-22 16:26:47 -0700 | [diff] [blame] | 1010 | update_manager/variable_unittest.cc |
| 1011 | else # local_use_omaha == 1 |
| 1012 | LOCAL_STATIC_LIBRARIES += \ |
| 1013 | libupdate_engine_android \ |
| 1014 | $(ue_libupdate_engine_android_exported_static_libraries:-host=) |
| 1015 | LOCAL_SHARED_LIBRARIES += \ |
| 1016 | $(ue_libupdate_engine_android_exported_shared_libraries:-host=) |
| 1017 | endif # local_use_omaha == 1 |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 1018 | ifeq ($(local_use_libcros),1) |
| 1019 | LOCAL_SRC_FILES += \ |
| 1020 | chrome_browser_proxy_resolver_unittest.cc |
| 1021 | endif # local_use_libcros == 1 |
| 1022 | include $(BUILD_NATIVE_TEST) |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 1023 | |
Gaurav Shah | 263614f | 2015-09-24 14:20:38 -0700 | [diff] [blame] | 1024 | # Update payload signing public key. |
| 1025 | # ======================================================== |
Alex Deymo | 50e24f4 | 2016-01-27 20:48:54 -0800 | [diff] [blame] | 1026 | ifdef BRILLO |
Gaurav Shah | 263614f | 2015-09-24 14:20:38 -0700 | [diff] [blame] | 1027 | include $(CLEAR_VARS) |
| 1028 | LOCAL_MODULE := brillo-update-payload-key |
| 1029 | LOCAL_MODULE_CLASS := ETC |
| 1030 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/update_engine |
| 1031 | LOCAL_MODULE_STEM := update-payload-key.pub.pem |
| 1032 | LOCAL_SRC_FILES := update_payload_key/brillo-update-payload-key.pub.pem |
| 1033 | LOCAL_BUILT_MODULE_STEM := update_payload_key/brillo-update-payload-key.pub.pem |
| 1034 | include $(BUILD_PREBUILT) |
Alex Deymo | 50e24f4 | 2016-01-27 20:48:54 -0800 | [diff] [blame] | 1035 | endif # BRILLO |
Tao Bao | 042f8a1 | 2016-01-07 16:52:14 -0800 | [diff] [blame] | 1036 | |
| 1037 | # Brillo update payload generation script |
| 1038 | # ======================================================== |
| 1039 | ifeq ($(HOST_OS),linux) |
| 1040 | include $(CLEAR_VARS) |
| 1041 | LOCAL_SRC_FILES := scripts/brillo_update_payload |
| 1042 | LOCAL_MODULE := brillo_update_payload |
| 1043 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 1044 | LOCAL_IS_HOST_MODULE := true |
| 1045 | LOCAL_MODULE_TAGS := optional |
| 1046 | LOCAL_REQUIRED_MODULES := \ |
| 1047 | delta_generator \ |
| 1048 | shflags |
| 1049 | include $(BUILD_PREBUILT) |
| 1050 | endif # HOST_OS == linux |