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