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 | |
Daniel Cardenas | 0c37e31 | 2017-11-06 12:01:33 -0800 | [diff] [blame] | 17 | ifneq ($(TARGET_BUILD_PDK),true) |
| 18 | |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 19 | LOCAL_PATH := $(my-dir) |
| 20 | |
Alex Deymo | 78a954f | 2016-01-21 20:32:40 -0800 | [diff] [blame] | 21 | # Default values for the USE flags. Override these USE flags from your product |
| 22 | # by setting BRILLO_USE_* values. Note that we define local variables like |
| 23 | # local_use_* to prevent leaking our default setting for other packages. |
| 24 | local_use_binder := $(if $(BRILLO_USE_BINDER),$(BRILLO_USE_BINDER),1) |
Alex Deymo | 78a954f | 2016-01-21 20:32:40 -0800 | [diff] [blame] | 25 | local_use_hwid_override := \ |
| 26 | $(if $(BRILLO_USE_HWID_OVERRIDE),$(BRILLO_USE_HWID_OVERRIDE),0) |
| 27 | local_use_mtd := $(if $(BRILLO_USE_MTD),$(BRILLO_USE_MTD),0) |
Amin Hassani | e94ece5 | 2017-08-01 15:03:08 -0700 | [diff] [blame] | 28 | local_use_chrome_network_proxy := 0 |
| 29 | local_use_chrome_kiosk_app := 0 |
Alex Deymo | 787dc41 | 2015-10-29 11:39:20 -0700 | [diff] [blame] | 30 | |
Alex Deymo | 49d6445 | 2016-10-31 16:56:58 -0700 | [diff] [blame] | 31 | # IoT devices use Omaha for updates. |
| 32 | local_use_omaha := $(if $(filter true,$(PRODUCT_IOT)),1,0) |
| 33 | |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 34 | ue_common_cflags := \ |
Alex Deymo | 78a954f | 2016-01-21 20:32:40 -0800 | [diff] [blame] | 35 | -DUSE_BINDER=$(local_use_binder) \ |
Amin Hassani | e94ece5 | 2017-08-01 15:03:08 -0700 | [diff] [blame] | 36 | -DUSE_CHROME_NETWORK_PROXY=$(local_use_chrome_network_proxy) \ |
| 37 | -DUSE_CHROME_KIOSK_APP=$(local_use_chrome_kiosk_app) \ |
Alex Deymo | 78a954f | 2016-01-21 20:32:40 -0800 | [diff] [blame] | 38 | -DUSE_HWID_OVERRIDE=$(local_use_hwid_override) \ |
| 39 | -DUSE_MTD=$(local_use_mtd) \ |
Sen Jiang | 192a86a | 2016-05-19 17:21:24 -0700 | [diff] [blame] | 40 | -DUSE_OMAHA=$(local_use_omaha) \ |
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 \ |
Elliott Hughes | 063863b | 2016-10-10 13:37:53 -0700 | [diff] [blame] | 55 | -fno-strict-aliasing |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 56 | ue_common_ldflags := \ |
| 57 | -Wl,--gc-sections |
| 58 | ue_common_c_includes := \ |
| 59 | $(LOCAL_PATH)/client_library/include \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 60 | system |
| 61 | ue_common_shared_libraries := \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 62 | libbrillo-stream \ |
Alex Deymo | 44348e0 | 2016-07-29 16:22:26 -0700 | [diff] [blame] | 63 | libbrillo \ |
Alex Deymo | 4218b7e | 2015-11-17 21:14:42 -0300 | [diff] [blame] | 64 | libchrome |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 65 | ue_common_static_libraries := \ |
| 66 | libgtest_prod \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 67 | |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 68 | # update_metadata-protos (type: static_library) |
| 69 | # ======================================================== |
| 70 | # Protobufs. |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 71 | ue_update_metadata_protos_exported_static_libraries := \ |
| 72 | update_metadata-protos |
| 73 | ue_update_metadata_protos_exported_shared_libraries := \ |
Alex Vakulenko | ab5bd66 | 2015-12-21 12:24:45 -0800 | [diff] [blame] | 74 | libprotobuf-cpp-lite |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 75 | |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 76 | ue_update_metadata_protos_src_files := \ |
| 77 | update_metadata.proto |
| 78 | |
| 79 | # Build for the host. |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 80 | include $(CLEAR_VARS) |
| 81 | LOCAL_MODULE := update_metadata-protos |
| 82 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
Ying Wang | dbd1711 | 2015-12-17 11:59:09 -0800 | [diff] [blame] | 83 | LOCAL_IS_HOST_MODULE := true |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 84 | generated_sources_dir := $(call local-generated-sources-dir) |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 85 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(generated_sources_dir)/proto/system |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 86 | LOCAL_SRC_FILES := $(ue_update_metadata_protos_src_files) |
Chih-Hung Hsieh | 908da19 | 2017-10-20 15:14:48 -0700 | [diff] [blame] | 87 | LOCAL_CFLAGS := -Wall -Werror |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 88 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 89 | |
| 90 | # Build for the target. |
| 91 | include $(CLEAR_VARS) |
| 92 | LOCAL_MODULE := update_metadata-protos |
| 93 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 94 | generated_sources_dir := $(call local-generated-sources-dir) |
| 95 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(generated_sources_dir)/proto/system |
| 96 | LOCAL_SRC_FILES := $(ue_update_metadata_protos_src_files) |
Chih-Hung Hsieh | 908da19 | 2017-10-20 15:14:48 -0700 | [diff] [blame] | 97 | LOCAL_CFLAGS := -Wall -Werror |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 98 | include $(BUILD_STATIC_LIBRARY) |
| 99 | |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 100 | # libpayload_consumer (type: static_library) |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 101 | # ======================================================== |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 102 | # The payload application component and common dependencies. |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 103 | ue_libpayload_consumer_exported_static_libraries := \ |
| 104 | update_metadata-protos \ |
Steven Moreland | 0571c80 | 2017-05-12 14:10:55 -0700 | [diff] [blame] | 105 | libxz \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 106 | libbz \ |
Sen Jiang | 26dfa32 | 2016-05-10 15:31:46 -0700 | [diff] [blame] | 107 | libbspatch \ |
Tianjie Xu | 13df600 | 2017-10-28 22:05:20 -0700 | [diff] [blame] | 108 | libbrotli \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 109 | $(ue_update_metadata_protos_exported_static_libraries) |
| 110 | ue_libpayload_consumer_exported_shared_libraries := \ |
Dan Willemsen | 097288e | 2016-07-21 14:16:29 -0700 | [diff] [blame] | 111 | libcrypto \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 112 | $(ue_update_metadata_protos_exported_shared_libraries) |
| 113 | |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 114 | ue_libpayload_consumer_src_files := \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 115 | common/action_processor.cc \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 116 | common/boot_control_stub.cc \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 117 | common/clock.cc \ |
| 118 | common/constants.cc \ |
Alex Deymo | ab0d976 | 2016-02-02 10:52:56 -0800 | [diff] [blame] | 119 | common/cpu_limiter.cc \ |
Alex Deymo | e88e9fe | 2016-02-03 16:38:00 -0800 | [diff] [blame] | 120 | common/error_code_utils.cc \ |
Alex Deymo | d6ece53 | 2016-06-21 17:00:05 -0700 | [diff] [blame] | 121 | common/file_fetcher.cc \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 122 | common/hash_calculator.cc \ |
| 123 | common/http_common.cc \ |
| 124 | common/http_fetcher.cc \ |
| 125 | common/hwid_override.cc \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 126 | common/multi_range_http_fetcher.cc \ |
| 127 | common/platform_constants_android.cc \ |
| 128 | common/prefs.cc \ |
| 129 | common/subprocess.cc \ |
| 130 | common/terminator.cc \ |
| 131 | common/utils.cc \ |
| 132 | payload_consumer/bzip_extent_writer.cc \ |
| 133 | payload_consumer/delta_performer.cc \ |
| 134 | payload_consumer/download_action.cc \ |
| 135 | payload_consumer/extent_writer.cc \ |
| 136 | payload_consumer/file_descriptor.cc \ |
Alex Deymo | a48f630 | 2016-11-04 15:49:53 -0700 | [diff] [blame] | 137 | payload_consumer/file_descriptor_utils.cc \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 138 | payload_consumer/file_writer.cc \ |
| 139 | payload_consumer/filesystem_verifier_action.cc \ |
| 140 | payload_consumer/install_plan.cc \ |
| 141 | payload_consumer/payload_constants.cc \ |
| 142 | payload_consumer/payload_verifier.cc \ |
| 143 | payload_consumer/postinstall_runner_action.cc \ |
| 144 | payload_consumer/xz_extent_writer.cc |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 145 | |
| 146 | ifeq ($(HOST_OS),linux) |
| 147 | # Build for the host. |
| 148 | include $(CLEAR_VARS) |
| 149 | LOCAL_MODULE := libpayload_consumer |
| 150 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 151 | LOCAL_CPP_EXTENSION := .cc |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 152 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 153 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 154 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
| 155 | LOCAL_C_INCLUDES := \ |
Sen Jiang | dcbc0ae | 2016-03-18 15:33:19 -0700 | [diff] [blame] | 156 | $(ue_common_c_includes) |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 157 | LOCAL_STATIC_LIBRARIES := \ |
| 158 | update_metadata-protos \ |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 159 | $(ue_common_static_libraries) \ |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 160 | $(ue_libpayload_consumer_exported_static_libraries) \ |
| 161 | $(ue_update_metadata_protos_exported_static_libraries) |
| 162 | LOCAL_SHARED_LIBRARIES := \ |
| 163 | $(ue_common_shared_libraries) \ |
| 164 | $(ue_libpayload_consumer_exported_shared_libraries) \ |
| 165 | $(ue_update_metadata_protos_exported_shared_libraries) |
| 166 | LOCAL_SRC_FILES := $(ue_libpayload_consumer_src_files) |
| 167 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 168 | endif # HOST_OS == linux |
| 169 | |
| 170 | # Build for the target. |
| 171 | include $(CLEAR_VARS) |
| 172 | LOCAL_MODULE := libpayload_consumer |
| 173 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 174 | LOCAL_CPP_EXTENSION := .cc |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 175 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 176 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 177 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
| 178 | LOCAL_C_INCLUDES := \ |
Sen Jiang | dcbc0ae | 2016-03-18 15:33:19 -0700 | [diff] [blame] | 179 | $(ue_common_c_includes) |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 180 | LOCAL_STATIC_LIBRARIES := \ |
| 181 | update_metadata-protos \ |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 182 | $(ue_common_static_libraries) \ |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 183 | $(ue_libpayload_consumer_exported_static_libraries:-host=) \ |
| 184 | $(ue_update_metadata_protos_exported_static_libraries) |
| 185 | LOCAL_SHARED_LIBRARIES := \ |
| 186 | $(ue_common_shared_libraries) \ |
| 187 | $(ue_libpayload_consumer_exported_shared_libraries:-host=) \ |
| 188 | $(ue_update_metadata_protos_exported_shared_libraries) |
| 189 | LOCAL_SRC_FILES := $(ue_libpayload_consumer_src_files) |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 190 | include $(BUILD_STATIC_LIBRARY) |
| 191 | |
Connor O'Brien | cee6ad9 | 2016-11-21 13:53:52 -0800 | [diff] [blame] | 192 | # libupdate_engine_boot_control (type: static_library) |
| 193 | # ======================================================== |
| 194 | # A BootControl class implementation using Android's HIDL boot_control HAL. |
| 195 | ue_libupdate_engine_boot_control_exported_static_libraries := \ |
| 196 | update_metadata-protos \ |
| 197 | $(ue_update_metadata_protos_exported_static_libraries) |
| 198 | |
| 199 | ue_libupdate_engine_boot_control_exported_shared_libraries := \ |
| 200 | libhwbinder \ |
Connor O'Brien | 25cea5e | 2016-11-28 12:44:10 -0800 | [diff] [blame] | 201 | libhidlbase \ |
Connor O'Brien | cee6ad9 | 2016-11-21 13:53:52 -0800 | [diff] [blame] | 202 | libutils \ |
| 203 | android.hardware.boot@1.0 \ |
| 204 | $(ue_update_metadata_protos_exported_shared_libraries) |
| 205 | |
| 206 | include $(CLEAR_VARS) |
| 207 | LOCAL_MODULE := libupdate_engine_boot_control |
| 208 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 209 | LOCAL_CPP_EXTENSION := .cc |
Connor O'Brien | cee6ad9 | 2016-11-21 13:53:52 -0800 | [diff] [blame] | 210 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 211 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 212 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
| 213 | LOCAL_C_INCLUDES := \ |
| 214 | $(ue_common_c_includes) \ |
| 215 | bootable/recovery |
| 216 | LOCAL_STATIC_LIBRARIES := \ |
| 217 | $(ue_common_static_libraries) \ |
| 218 | $(ue_libupdate_engine_boot_control_exported_static_libraries) |
| 219 | LOCAL_SHARED_LIBRARIES := \ |
| 220 | $(ue_common_shared_libraries) \ |
| 221 | $(ue_libupdate_engine_boot_control_exported_shared_libraries) |
| 222 | LOCAL_SRC_FILES := \ |
| 223 | boot_control_android.cc |
| 224 | include $(BUILD_STATIC_LIBRARY) |
| 225 | |
Sen Jiang | 192a86a | 2016-05-19 17:21:24 -0700 | [diff] [blame] | 226 | ifeq ($(local_use_omaha),1) |
Alex Deymo | 4218b7e | 2015-11-17 21:14:42 -0300 | [diff] [blame] | 227 | |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 228 | # libupdate_engine (type: static_library) |
| 229 | # ======================================================== |
| 230 | # The main daemon static_library with all the code used to check for updates |
| 231 | # with Omaha and expose a DBus daemon. |
| 232 | ue_libupdate_engine_exported_c_includes := \ |
Alex Deymo | b09305e | 2015-12-02 16:09:13 -0300 | [diff] [blame] | 233 | external/cros/system_api/dbus |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 234 | ue_libupdate_engine_exported_static_libraries := \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 235 | libpayload_consumer \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 236 | update_metadata-protos \ |
David Zeuthen | 753fadc | 2015-09-15 16:34:09 -0400 | [diff] [blame] | 237 | libbz \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 238 | libfs_mgr \ |
bowgotsai | 763e17c | 2017-01-24 16:59:57 +0800 | [diff] [blame] | 239 | libbase \ |
bowgotsai | cd67f91 | 2017-01-27 14:50:26 +0800 | [diff] [blame] | 240 | liblog \ |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 241 | $(ue_libpayload_consumer_exported_static_libraries) \ |
Connor O'Brien | cee6ad9 | 2016-11-21 13:53:52 -0800 | [diff] [blame] | 242 | $(ue_update_metadata_protos_exported_static_libraries) \ |
| 243 | libupdate_engine_boot_control \ |
| 244 | $(ue_libupdate_engine_boot_control_exported_static_libraries) |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 245 | ue_libupdate_engine_exported_shared_libraries := \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 246 | libmetrics \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 247 | libexpat \ |
Alex Vakulenko | 1bab5a8 | 2015-10-27 11:47:28 -0700 | [diff] [blame] | 248 | libbrillo-policy \ |
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) \ |
Connor O'Brien | cee6ad9 | 2016-11-21 13:53:52 -0800 | [diff] [blame] | 253 | $(ue_update_metadata_protos_exported_shared_libraries) \ |
| 254 | $(ue_libupdate_engine_boot_control_exported_shared_libraries) |
Alex Deymo | c003790 | 2016-01-23 17:29:02 -0800 | [diff] [blame] | 255 | ifeq ($(local_use_binder),1) |
| 256 | ue_libupdate_engine_exported_shared_libraries += \ |
| 257 | libbinder \ |
| 258 | libbinderwrapper \ |
| 259 | libbrillo-binder \ |
| 260 | libutils |
| 261 | endif # local_use_binder == 1 |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 262 | |
| 263 | include $(CLEAR_VARS) |
| 264 | LOCAL_MODULE := libupdate_engine |
| 265 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 266 | LOCAL_CPP_EXTENSION := .cc |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 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 \ |
Tianjie Xu | 098f702 | 2017-08-24 21:37:16 -0700 | [diff] [blame] | 296 | metrics_reporter_omaha.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 |
Amin Hassani | e94ece5 | 2017-08-01 15:03:08 -0700 | [diff] [blame] | 331 | ifeq ($(local_use_chrome_network_proxy),1) |
Alex Deymo | 0cd976d | 2016-02-11 18:45:01 -0800 | [diff] [blame] | 332 | LOCAL_SRC_FILES += \ |
| 333 | chrome_browser_proxy_resolver.cc |
Amin Hassani | e94ece5 | 2017-08-01 15:03:08 -0700 | [diff] [blame] | 334 | endif # local_use_chrome_network_proxy == 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 \ |
Tianjie Xu | 1b66114 | 2017-09-28 14:03:42 -0700 | [diff] [blame] | 364 | libmetricslogger \ |
Alex Deymo | 14c0da8 | 2016-07-20 16:45:45 -0700 | [diff] [blame] | 365 | libssl \ |
Alex Deymo | fa78f14 | 2016-01-26 21:36:16 -0800 | [diff] [blame] | 366 | libutils |
| 367 | |
| 368 | include $(CLEAR_VARS) |
| 369 | LOCAL_MODULE := libupdate_engine_android |
| 370 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 371 | LOCAL_CPP_EXTENSION := .cc |
Alex Deymo | fa78f14 | 2016-01-26 21:36:16 -0800 | [diff] [blame] | 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 \ |
Tianjie Xu | 1b66114 | 2017-09-28 14:03:42 -0700 | [diff] [blame] | 398 | metrics_reporter_android.cc \ |
| 399 | metrics_utils.cc \ |
Alex Deymo | 87792ea | 2016-07-25 15:40:36 -0700 | [diff] [blame] | 400 | network_selector_android.cc \ |
Alex Deymo | 5e3ea27 | 2016-01-28 13:42:23 -0800 | [diff] [blame] | 401 | proxy_resolver.cc \ |
Alex Deymo | 3b678db | 2016-02-09 11:50:06 -0800 | [diff] [blame] | 402 | update_attempter_android.cc \ |
Alex Deymo | fb905d9 | 2016-06-03 19:26:58 -0700 | [diff] [blame] | 403 | update_status_utils.cc \ |
| 404 | utils_android.cc |
Alex Deymo | fa78f14 | 2016-01-26 21:36:16 -0800 | [diff] [blame] | 405 | include $(BUILD_STATIC_LIBRARY) |
| 406 | |
Sen Jiang | 192a86a | 2016-05-19 17:21:24 -0700 | [diff] [blame] | 407 | endif # local_use_omaha == 1 |
Alex Deymo | 4218b7e | 2015-11-17 21:14:42 -0300 | [diff] [blame] | 408 | |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 409 | # update_engine (type: executable) |
| 410 | # ======================================================== |
| 411 | # update_engine daemon. |
| 412 | include $(CLEAR_VARS) |
| 413 | LOCAL_MODULE := update_engine |
| 414 | LOCAL_MODULE_CLASS := EXECUTABLES |
Sen Jiang | 5609277 | 2015-11-23 14:41:00 -0800 | [diff] [blame] | 415 | LOCAL_REQUIRED_MODULES := \ |
Alex Deymo | ab49446 | 2015-11-30 17:07:36 -0300 | [diff] [blame] | 416 | cacerts_google |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 417 | LOCAL_CPP_EXTENSION := .cc |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 418 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 419 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 420 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
| 421 | LOCAL_C_INCLUDES := \ |
Alex Deymo | 4218b7e | 2015-11-17 21:14:42 -0300 | [diff] [blame] | 422 | $(ue_common_c_includes) |
Alex Deymo | e97b39c | 2016-01-20 13:22:17 -0800 | [diff] [blame] | 423 | LOCAL_SHARED_LIBRARIES := \ |
| 424 | $(ue_common_shared_libraries) |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 425 | LOCAL_STATIC_LIBRARIES := \ |
| 426 | $(ue_common_static_libraries) |
Alex Deymo | e97b39c | 2016-01-20 13:22:17 -0800 | [diff] [blame] | 427 | LOCAL_SRC_FILES := \ |
| 428 | main.cc |
Alex Deymo | 4218b7e | 2015-11-17 21:14:42 -0300 | [diff] [blame] | 429 | |
Sen Jiang | 192a86a | 2016-05-19 17:21:24 -0700 | [diff] [blame] | 430 | ifeq ($(local_use_omaha),1) |
Alex Deymo | 4218b7e | 2015-11-17 21:14:42 -0300 | [diff] [blame] | 431 | LOCAL_C_INCLUDES += \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 432 | $(ue_libupdate_engine_exported_c_includes) |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 433 | LOCAL_STATIC_LIBRARIES += \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 434 | libupdate_engine \ |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 435 | $(ue_libupdate_engine_exported_static_libraries:-host=) |
Alex Deymo | e97b39c | 2016-01-20 13:22:17 -0800 | [diff] [blame] | 436 | LOCAL_SHARED_LIBRARIES += \ |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 437 | $(ue_libupdate_engine_exported_shared_libraries:-host=) |
Sen Jiang | 192a86a | 2016-05-19 17:21:24 -0700 | [diff] [blame] | 438 | else # local_use_omaha == 1 |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 439 | LOCAL_STATIC_LIBRARIES += \ |
Alex Deymo | fa78f14 | 2016-01-26 21:36:16 -0800 | [diff] [blame] | 440 | libupdate_engine_android \ |
| 441 | $(ue_libupdate_engine_android_exported_static_libraries:-host=) |
Alex Deymo | e97b39c | 2016-01-20 13:22:17 -0800 | [diff] [blame] | 442 | LOCAL_SHARED_LIBRARIES += \ |
Alex Deymo | fa78f14 | 2016-01-26 21:36:16 -0800 | [diff] [blame] | 443 | $(ue_libupdate_engine_android_exported_shared_libraries:-host=) |
Sen Jiang | 192a86a | 2016-05-19 17:21:24 -0700 | [diff] [blame] | 444 | endif # local_use_omaha == 1 |
Casey Dahlin | a93cd53 | 2016-01-14 16:55:11 -0800 | [diff] [blame] | 445 | |
Gilad Arnold | 70141f2 | 2015-09-17 09:06:30 -0700 | [diff] [blame] | 446 | LOCAL_INIT_RC := update_engine.rc |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 447 | include $(BUILD_EXECUTABLE) |
| 448 | |
Alex Deymo | 03a4de7 | 2016-07-20 16:08:23 -0700 | [diff] [blame] | 449 | # update_engine_sideload (type: executable) |
| 450 | # ======================================================== |
| 451 | # A static binary equivalent to update_engine daemon that installs an update |
| 452 | # from a local file directly instead of running in the background. |
| 453 | include $(CLEAR_VARS) |
| 454 | LOCAL_MODULE := update_engine_sideload |
Alex Deymo | 44348e0 | 2016-07-29 16:22:26 -0700 | [diff] [blame] | 455 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 456 | LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin |
Alex Deymo | 03a4de7 | 2016-07-20 16:08:23 -0700 | [diff] [blame] | 457 | LOCAL_MODULE_CLASS := EXECUTABLES |
Alex Deymo | 03a4de7 | 2016-07-20 16:08:23 -0700 | [diff] [blame] | 458 | LOCAL_CPP_EXTENSION := .cc |
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 \ |
Tianjie Xu | d4c5deb | 2017-10-24 11:17:03 -0700 | [diff] [blame] | 474 | metrics_reporter_stub.cc \ |
Tianjie Xu | 1b66114 | 2017-09-28 14:03:42 -0700 | [diff] [blame] | 475 | metrics_utils.cc \ |
Alex Deymo | 03a4de7 | 2016-07-20 16:08:23 -0700 | [diff] [blame] | 476 | network_selector_stub.cc \ |
| 477 | proxy_resolver.cc \ |
| 478 | sideload_main.cc \ |
| 479 | update_attempter_android.cc \ |
| 480 | update_status_utils.cc \ |
| 481 | utils_android.cc |
| 482 | LOCAL_STATIC_LIBRARIES := \ |
| 483 | libfs_mgr \ |
bowgotsai | 763e17c | 2017-01-24 16:59:57 +0800 | [diff] [blame] | 484 | libbase \ |
bowgotsai | cd67f91 | 2017-01-27 14:50:26 +0800 | [diff] [blame] | 485 | liblog \ |
Alex Deymo | 03a4de7 | 2016-07-20 16:08:23 -0700 | [diff] [blame] | 486 | libpayload_consumer \ |
| 487 | update_metadata-protos \ |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 488 | $(ue_common_static_libraries) \ |
Alex Deymo | 03a4de7 | 2016-07-20 16:08:23 -0700 | [diff] [blame] | 489 | $(ue_libpayload_consumer_exported_static_libraries:-host=) \ |
| 490 | $(ue_update_metadata_protos_exported_static_libraries) |
Alex Deymo | 44348e0 | 2016-07-29 16:22:26 -0700 | [diff] [blame] | 491 | # We add the static versions of the shared libraries since we are forcing this |
| 492 | # binary to be a static binary, so we also need to include all the static |
| 493 | # library dependencies of these static libraries. |
| 494 | LOCAL_STATIC_LIBRARIES += \ |
Alex Deymo | 03a4de7 | 2016-07-20 16:08:23 -0700 | [diff] [blame] | 495 | $(ue_common_shared_libraries) \ |
Tom Cherry | 012aa5b | 2017-10-10 14:45:09 -0700 | [diff] [blame] | 496 | libbase \ |
Dimitry Ivanov | e9ae98c | 2016-09-24 22:35:07 -0700 | [diff] [blame] | 497 | liblog \ |
Alex Deymo | 03a4de7 | 2016-07-20 16:08:23 -0700 | [diff] [blame] | 498 | $(ue_libpayload_consumer_exported_shared_libraries:-host=) \ |
Alex Deymo | 44348e0 | 2016-07-29 16:22:26 -0700 | [diff] [blame] | 499 | $(ue_update_metadata_protos_exported_shared_libraries) \ |
| 500 | libevent \ |
| 501 | libmodpb64 \ |
| 502 | libgtest_prod |
Alex Deymo | 44348e0 | 2016-07-29 16:22:26 -0700 | [diff] [blame] | 503 | |
| 504 | ifeq ($(strip $(PRODUCT_STATIC_BOOT_CONTROL_HAL)),) |
| 505 | # No static boot_control HAL defined, so no sideload support. We use a fake |
| 506 | # boot_control HAL to allow compiling update_engine_sideload for test purposes. |
| 507 | ifeq ($(strip $(AB_OTA_UPDATER)),true) |
| 508 | $(warning No PRODUCT_STATIC_BOOT_CONTROL_HAL configured but AB_OTA_UPDATER is \ |
| 509 | true, no update sideload support.) |
| 510 | endif # AB_OTA_UPDATER == true |
| 511 | LOCAL_SRC_FILES += \ |
| 512 | boot_control_recovery_stub.cc |
| 513 | else # PRODUCT_STATIC_BOOT_CONTROL_HAL != "" |
| 514 | LOCAL_STATIC_LIBRARIES += \ |
| 515 | $(PRODUCT_STATIC_BOOT_CONTROL_HAL) |
| 516 | endif # PRODUCT_STATIC_BOOT_CONTROL_HAL != "" |
| 517 | |
Alex Deymo | 03a4de7 | 2016-07-20 16:08:23 -0700 | [diff] [blame] | 518 | include $(BUILD_EXECUTABLE) |
| 519 | |
Alex Deymo | a96ddc1 | 2016-02-10 15:59:03 -0800 | [diff] [blame] | 520 | # libupdate_engine_client (type: shared_library) |
| 521 | # ======================================================== |
| 522 | include $(CLEAR_VARS) |
| 523 | LOCAL_MODULE := libupdate_engine_client |
| 524 | LOCAL_CFLAGS := \ |
| 525 | -Wall \ |
| 526 | -Werror \ |
| 527 | -Wno-unused-parameter \ |
Alex Deymo | a96ddc1 | 2016-02-10 15:59:03 -0800 | [diff] [blame] | 528 | -DUSE_BINDER=$(local_use_binder) |
Alex Deymo | a96ddc1 | 2016-02-10 15:59:03 -0800 | [diff] [blame] | 529 | LOCAL_CPP_EXTENSION := .cc |
| 530 | # TODO(deymo): Remove "external/cros/system_api/dbus" when dbus is not used. |
| 531 | LOCAL_C_INCLUDES := \ |
| 532 | $(LOCAL_PATH)/client_library/include \ |
| 533 | external/cros/system_api/dbus \ |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 534 | system |
Alex Deymo | a96ddc1 | 2016-02-10 15:59:03 -0800 | [diff] [blame] | 535 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/client_library/include |
| 536 | LOCAL_SHARED_LIBRARIES := \ |
| 537 | libchrome \ |
| 538 | libbrillo |
| 539 | LOCAL_SRC_FILES := \ |
| 540 | client_library/client.cc \ |
| 541 | update_status_utils.cc |
| 542 | |
Sen Jiang | a7c4de2 | 2017-03-02 15:53:54 -0800 | [diff] [blame] | 543 | # We only support binder IPC mechanism in Android. |
Alex Deymo | a96ddc1 | 2016-02-10 15:59:03 -0800 | [diff] [blame] | 544 | ifeq ($(local_use_binder),1) |
| 545 | LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder_bindings |
| 546 | LOCAL_SHARED_LIBRARIES += \ |
| 547 | libbinder \ |
| 548 | libbrillo-binder \ |
| 549 | libutils |
| 550 | LOCAL_SRC_FILES += \ |
| 551 | binder_bindings/android/brillo/IUpdateEngine.aidl \ |
| 552 | binder_bindings/android/brillo/IUpdateEngineStatusCallback.aidl \ |
| 553 | client_library/client_binder.cc \ |
| 554 | parcelable_update_engine_status.cc |
Alex Deymo | a96ddc1 | 2016-02-10 15:59:03 -0800 | [diff] [blame] | 555 | endif # local_use_binder == 1 |
| 556 | |
| 557 | include $(BUILD_SHARED_LIBRARY) |
| 558 | |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 559 | # update_engine_client (type: executable) |
| 560 | # ======================================================== |
| 561 | # update_engine console client. |
| 562 | include $(CLEAR_VARS) |
| 563 | LOCAL_MODULE := update_engine_client |
| 564 | LOCAL_MODULE_CLASS := EXECUTABLES |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 565 | LOCAL_CPP_EXTENSION := .cc |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 566 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 567 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 568 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
Casey Dahlin | ce90f44 | 2016-01-25 16:55:28 -0800 | [diff] [blame] | 569 | LOCAL_C_INCLUDES := $(ue_common_c_includes) |
Alex Deymo | 5f52811 | 2016-01-27 23:32:36 -0800 | [diff] [blame] | 570 | LOCAL_SHARED_LIBRARIES := $(ue_common_shared_libraries) |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 571 | LOCAL_STATIC_LIBRARIES := $(ue_common_static_libraries) |
Sen Jiang | 192a86a | 2016-05-19 17:21:24 -0700 | [diff] [blame] | 572 | ifeq ($(local_use_omaha),1) |
Alex Deymo | 5f52811 | 2016-01-27 23:32:36 -0800 | [diff] [blame] | 573 | LOCAL_SHARED_LIBRARIES += \ |
Casey Dahlin | e844c1a | 2015-12-16 14:30:58 -0800 | [diff] [blame] | 574 | libupdate_engine_client |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 575 | LOCAL_SRC_FILES := \ |
Shuqian Zhao | 2997173 | 2016-02-05 11:29:32 -0800 | [diff] [blame] | 576 | update_engine_client.cc \ |
Alex Deymo | b3fa53b | 2016-04-18 19:57:58 -0700 | [diff] [blame] | 577 | common/error_code_utils.cc \ |
| 578 | omaha_utils.cc |
Sen Jiang | 192a86a | 2016-05-19 17:21:24 -0700 | [diff] [blame] | 579 | else # local_use_omaha == 1 |
Alex Deymo | 5f52811 | 2016-01-27 23:32:36 -0800 | [diff] [blame] | 580 | #TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved |
| 581 | # out of the DBus interface. |
| 582 | LOCAL_C_INCLUDES += \ |
| 583 | external/cros/system_api/dbus |
| 584 | LOCAL_SHARED_LIBRARIES += \ |
| 585 | libbinder \ |
Alex Deymo | 2130ee0 | 2016-02-02 18:35:50 -0800 | [diff] [blame] | 586 | libbinderwrapper \ |
Alex Deymo | 5f52811 | 2016-01-27 23:32:36 -0800 | [diff] [blame] | 587 | libbrillo-binder \ |
| 588 | libutils |
| 589 | LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder_bindings |
| 590 | LOCAL_SRC_FILES := \ |
| 591 | binder_bindings/android/os/IUpdateEngine.aidl \ |
| 592 | binder_bindings/android/os/IUpdateEngineCallback.aidl \ |
Alex Deymo | e88e9fe | 2016-02-03 16:38:00 -0800 | [diff] [blame] | 593 | common/error_code_utils.cc \ |
Alex Deymo | 5f52811 | 2016-01-27 23:32:36 -0800 | [diff] [blame] | 594 | update_engine_client_android.cc \ |
| 595 | update_status_utils.cc |
Sen Jiang | 192a86a | 2016-05-19 17:21:24 -0700 | [diff] [blame] | 596 | endif # local_use_omaha == 1 |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 597 | include $(BUILD_EXECUTABLE) |
| 598 | |
| 599 | # libpayload_generator (type: static_library) |
| 600 | # ======================================================== |
| 601 | # server-side code. This is used for delta_generator and unittests but not |
| 602 | # for any client code. |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 603 | ue_libpayload_generator_exported_static_libraries := \ |
Amin Hassani | 71be937 | 2017-08-04 14:25:20 -0700 | [diff] [blame] | 604 | libbsdiff \ |
Sen Jiang | 806f53d | 2017-08-17 16:00:34 -0700 | [diff] [blame] | 605 | libdivsufsort \ |
| 606 | libdivsufsort64 \ |
Tianjie Xu | 13df600 | 2017-10-28 22:05:20 -0700 | [diff] [blame] | 607 | libbrotli \ |
Alex Deymo | b09305e | 2015-12-02 16:09:13 -0300 | [diff] [blame] | 608 | libpayload_consumer \ |
Alex Deymo | 246bf21 | 2016-03-22 19:27:33 -0700 | [diff] [blame] | 609 | liblzma \ |
Amin Hassani | 71be937 | 2017-08-04 14:25:20 -0700 | [diff] [blame] | 610 | update_metadata-protos \ |
Alex Deymo | b09305e | 2015-12-02 16:09:13 -0300 | [diff] [blame] | 611 | $(ue_libpayload_consumer_exported_static_libraries) \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 612 | $(ue_update_metadata_protos_exported_static_libraries) |
| 613 | ue_libpayload_generator_exported_shared_libraries := \ |
Alex Deymo | 89f6d67 | 2017-01-13 17:26:52 -0800 | [diff] [blame] | 614 | libext2fs \ |
Alex Deymo | b09305e | 2015-12-02 16:09:13 -0300 | [diff] [blame] | 615 | $(ue_libpayload_consumer_exported_shared_libraries) \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 616 | $(ue_update_metadata_protos_exported_shared_libraries) |
| 617 | |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 618 | ue_libpayload_generator_src_files := \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 619 | payload_generator/ab_generator.cc \ |
| 620 | payload_generator/annotated_operation.cc \ |
| 621 | payload_generator/blob_file_writer.cc \ |
| 622 | payload_generator/block_mapping.cc \ |
Alex Deymo | 0bc2611 | 2015-10-19 20:54:57 -0700 | [diff] [blame] | 623 | payload_generator/bzip.cc \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 624 | payload_generator/cycle_breaker.cc \ |
| 625 | payload_generator/delta_diff_generator.cc \ |
| 626 | payload_generator/delta_diff_utils.cc \ |
| 627 | payload_generator/ext2_filesystem.cc \ |
| 628 | payload_generator/extent_ranges.cc \ |
| 629 | payload_generator/extent_utils.cc \ |
| 630 | payload_generator/full_update_generator.cc \ |
| 631 | payload_generator/graph_types.cc \ |
| 632 | payload_generator/graph_utils.cc \ |
| 633 | payload_generator/inplace_generator.cc \ |
Alex Deymo | 20bdc70 | 2016-12-07 21:07:11 -0800 | [diff] [blame] | 634 | payload_generator/mapfile_filesystem.cc \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 635 | payload_generator/payload_file.cc \ |
| 636 | payload_generator/payload_generation_config.cc \ |
| 637 | payload_generator/payload_signer.cc \ |
| 638 | payload_generator/raw_filesystem.cc \ |
| 639 | payload_generator/tarjan.cc \ |
Alex Deymo | 246bf21 | 2016-03-22 19:27:33 -0700 | [diff] [blame] | 640 | payload_generator/topological_sort.cc \ |
| 641 | payload_generator/xz_android.cc |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 642 | |
| 643 | ifeq ($(HOST_OS),linux) |
| 644 | # Build for the host. |
| 645 | include $(CLEAR_VARS) |
| 646 | LOCAL_MODULE := libpayload_generator |
| 647 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 648 | LOCAL_CPP_EXTENSION := .cc |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 649 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 650 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 651 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
| 652 | LOCAL_C_INCLUDES := $(ue_common_c_includes) |
| 653 | LOCAL_STATIC_LIBRARIES := \ |
Amin Hassani | 71be937 | 2017-08-04 14:25:20 -0700 | [diff] [blame] | 654 | libbsdiff \ |
Sen Jiang | 806f53d | 2017-08-17 16:00:34 -0700 | [diff] [blame] | 655 | libdivsufsort \ |
| 656 | libdivsufsort64 \ |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 657 | libpayload_consumer \ |
Alex Deymo | 246bf21 | 2016-03-22 19:27:33 -0700 | [diff] [blame] | 658 | liblzma \ |
Amin Hassani | 71be937 | 2017-08-04 14:25:20 -0700 | [diff] [blame] | 659 | update_metadata-protos \ |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 660 | $(ue_common_static_libraries) \ |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 661 | $(ue_libpayload_consumer_exported_static_libraries) \ |
| 662 | $(ue_update_metadata_protos_exported_static_libraries) |
| 663 | LOCAL_SHARED_LIBRARIES := \ |
| 664 | $(ue_common_shared_libraries) \ |
| 665 | $(ue_libpayload_generator_exported_shared_libraries) \ |
| 666 | $(ue_libpayload_consumer_exported_shared_libraries) \ |
| 667 | $(ue_update_metadata_protos_exported_shared_libraries) |
| 668 | LOCAL_SRC_FILES := $(ue_libpayload_generator_src_files) |
| 669 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 670 | endif # HOST_OS == linux |
| 671 | |
| 672 | # Build for the target. |
| 673 | include $(CLEAR_VARS) |
| 674 | LOCAL_MODULE := libpayload_generator |
| 675 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 676 | LOCAL_CPP_EXTENSION := .cc |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 677 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 678 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 679 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
| 680 | LOCAL_C_INCLUDES := $(ue_common_c_includes) |
| 681 | LOCAL_STATIC_LIBRARIES := \ |
Sen Jiang | 806f53d | 2017-08-17 16:00:34 -0700 | [diff] [blame] | 682 | libbsdiff \ |
| 683 | libdivsufsort \ |
| 684 | libdivsufsort64 \ |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 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 |
| 709 | LOCAL_MODULE_CLASS := EXECUTABLES |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 710 | LOCAL_CPP_EXTENSION := .cc |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 711 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 712 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 713 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
Alex Deymo | b09305e | 2015-12-02 16:09:13 -0300 | [diff] [blame] | 714 | LOCAL_C_INCLUDES := $(ue_common_c_includes) |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 715 | LOCAL_STATIC_LIBRARIES := \ |
Alex Deymo | b09305e | 2015-12-02 16:09:13 -0300 | [diff] [blame] | 716 | libpayload_consumer \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 717 | libpayload_generator \ |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 718 | $(ue_common_static_libraries) \ |
Alex Deymo | b09305e | 2015-12-02 16:09:13 -0300 | [diff] [blame] | 719 | $(ue_libpayload_consumer_exported_static_libraries) \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 720 | $(ue_libpayload_generator_exported_static_libraries) |
| 721 | LOCAL_SHARED_LIBRARIES := \ |
| 722 | $(ue_common_shared_libraries) \ |
Alex Deymo | b09305e | 2015-12-02 16:09:13 -0300 | [diff] [blame] | 723 | $(ue_libpayload_consumer_exported_shared_libraries) \ |
Alex Deymo | c372ab6 | 2015-10-29 00:43:26 -0700 | [diff] [blame] | 724 | $(ue_libpayload_generator_exported_shared_libraries) |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 725 | LOCAL_SRC_FILES := $(ue_delta_generator_src_files) |
| 726 | include $(BUILD_HOST_EXECUTABLE) |
| 727 | endif # HOST_OS == linux |
| 728 | |
| 729 | # Build for the target. |
| 730 | include $(CLEAR_VARS) |
Sen Jiang | 5a216c1 | 2016-03-30 13:08:24 -0700 | [diff] [blame] | 731 | LOCAL_MODULE := ue_unittest_delta_generator |
| 732 | LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests |
| 733 | LOCAL_MODULE_STEM := delta_generator |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 734 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 735 | LOCAL_CPP_EXTENSION := .cc |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 736 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 737 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 738 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
| 739 | LOCAL_C_INCLUDES := $(ue_common_c_includes) |
| 740 | LOCAL_STATIC_LIBRARIES := \ |
| 741 | libpayload_consumer \ |
| 742 | libpayload_generator \ |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 743 | $(ue_common_static_libraries) \ |
Alex Deymo | 05e0e38 | 2015-12-07 20:18:16 -0800 | [diff] [blame] | 744 | $(ue_libpayload_consumer_exported_static_libraries:-host=) \ |
| 745 | $(ue_libpayload_generator_exported_static_libraries:-host=) |
| 746 | LOCAL_SHARED_LIBRARIES := \ |
| 747 | $(ue_common_shared_libraries) \ |
| 748 | $(ue_libpayload_consumer_exported_shared_libraries:-host=) \ |
| 749 | $(ue_libpayload_generator_exported_shared_libraries:-host=) |
| 750 | LOCAL_SRC_FILES := $(ue_delta_generator_src_files) |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 751 | include $(BUILD_EXECUTABLE) |
| 752 | |
Sen Jiang | 923886a | 2016-03-14 15:04:28 -0700 | [diff] [blame] | 753 | # Private and public keys for unittests. |
| 754 | # ======================================================== |
| 755 | # Generate a module that installs a prebuilt private key and a module that |
| 756 | # installs a public key generated from the private key. |
| 757 | # |
| 758 | # $(1): The path to the private key in pem format. |
| 759 | define ue-unittest-keys |
| 760 | $(eval include $(CLEAR_VARS)) \ |
| 761 | $(eval LOCAL_MODULE := ue_$(1).pem) \ |
| 762 | $(eval LOCAL_MODULE_CLASS := ETC) \ |
| 763 | $(eval $(ifeq $(BRILLO), 1, LOCAL_MODULE_TAGS := eng)) \ |
| 764 | $(eval LOCAL_SRC_FILES := $(1).pem) \ |
| 765 | $(eval LOCAL_MODULE_PATH := \ |
| 766 | $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests) \ |
| 767 | $(eval LOCAL_MODULE_STEM := $(1).pem) \ |
| 768 | $(eval include $(BUILD_PREBUILT)) \ |
| 769 | \ |
| 770 | $(eval include $(CLEAR_VARS)) \ |
| 771 | $(eval LOCAL_MODULE := ue_$(1).pub.pem) \ |
| 772 | $(eval LOCAL_MODULE_CLASS := ETC) \ |
| 773 | $(eval $(ifeq $(BRILLO), 1, LOCAL_MODULE_TAGS := eng)) \ |
| 774 | $(eval LOCAL_MODULE_PATH := \ |
| 775 | $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests) \ |
| 776 | $(eval LOCAL_MODULE_STEM := $(1).pub.pem) \ |
| 777 | $(eval include $(BUILD_SYSTEM)/base_rules.mk) \ |
| 778 | $(eval $(LOCAL_BUILT_MODULE) : $(LOCAL_PATH)/$(1).pem ; \ |
| 779 | openssl rsa -in $$< -pubout -out $$@) |
| 780 | endef |
| 781 | |
| 782 | $(call ue-unittest-keys,unittest_key) |
| 783 | $(call ue-unittest-keys,unittest_key2) |
| 784 | |
Alex Deymo | c90be63 | 2016-02-17 19:25:20 -0800 | [diff] [blame] | 785 | # Sample images for unittests. |
| 786 | # ======================================================== |
| 787 | # Generate a prebuilt module that installs a sample image from the compressed |
| 788 | # sample_images.tar.bz2 file used by the unittests. |
| 789 | # |
| 790 | # $(1): The filename in the sample_images.tar.bz2 |
| 791 | define ue-unittest-sample-image |
| 792 | $(eval include $(CLEAR_VARS)) \ |
| 793 | $(eval LOCAL_MODULE := ue_unittest_$(1)) \ |
| 794 | $(eval LOCAL_MODULE_CLASS := EXECUTABLES) \ |
| 795 | $(eval $(ifeq $(BRILLO), 1, LOCAL_MODULE_TAGS := eng)) \ |
| 796 | $(eval LOCAL_MODULE_PATH := \ |
| 797 | $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests/gen) \ |
| 798 | $(eval LOCAL_MODULE_STEM := $(1)) \ |
Alex Deymo | a3553e4 | 2016-03-04 18:55:05 -0800 | [diff] [blame] | 799 | $(eval include $(BUILD_SYSTEM)/base_rules.mk) \ |
| 800 | $(eval $(LOCAL_BUILT_MODULE) : \ |
| 801 | $(LOCAL_PATH)/sample_images/sample_images.tar.bz2 ; \ |
| 802 | tar -jxf $$< -C $$(dir $$@) $$(notdir $$@) && touch $$@) |
Alex Deymo | c90be63 | 2016-02-17 19:25:20 -0800 | [diff] [blame] | 803 | endef |
| 804 | |
| 805 | $(call ue-unittest-sample-image,disk_ext2_1k.img) |
| 806 | $(call ue-unittest-sample-image,disk_ext2_4k.img) |
| 807 | $(call ue-unittest-sample-image,disk_ext2_4k_empty.img) |
Alex Deymo | d15c546 | 2016-03-09 18:11:12 -0800 | [diff] [blame] | 808 | $(call ue-unittest-sample-image,disk_ext2_unittest.img) |
Alex Deymo | c90be63 | 2016-02-17 19:25:20 -0800 | [diff] [blame] | 809 | |
Sen Jiang | e0d0428 | 2016-03-01 14:22:52 -0800 | [diff] [blame] | 810 | # Zlib Fingerprint |
| 811 | # ======================================================== |
| 812 | include $(CLEAR_VARS) |
| 813 | LOCAL_MODULE := zlib_fingerprint |
| 814 | LOCAL_MODULE_CLASS := ETC |
| 815 | LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests |
| 816 | LOCAL_PREBUILT_MODULE_FILE := $(TARGET_OUT_COMMON_GEN)/zlib_fingerprint |
| 817 | include $(BUILD_PREBUILT) |
| 818 | |
Sen Jiang | ee63c6e | 2016-03-30 14:01:02 -0700 | [diff] [blame] | 819 | # update_engine.conf |
| 820 | # ======================================================== |
| 821 | include $(CLEAR_VARS) |
| 822 | LOCAL_MODULE := ue_unittest_update_engine.conf |
| 823 | LOCAL_MODULE_CLASS := ETC |
| 824 | LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests |
| 825 | LOCAL_MODULE_STEM := update_engine.conf |
| 826 | LOCAL_SRC_FILES := update_engine.conf |
| 827 | include $(BUILD_PREBUILT) |
| 828 | |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 829 | # test_http_server (type: executable) |
| 830 | # ======================================================== |
| 831 | # Test HTTP Server. |
| 832 | include $(CLEAR_VARS) |
| 833 | LOCAL_MODULE := test_http_server |
Alex Deymo | dc873fa | 2016-03-03 22:32:47 -0800 | [diff] [blame] | 834 | LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 835 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 836 | LOCAL_CPP_EXTENSION := .cc |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 837 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 838 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 839 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
| 840 | LOCAL_C_INCLUDES := $(ue_common_c_includes) |
| 841 | LOCAL_SHARED_LIBRARIES := $(ue_common_shared_libraries) |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 842 | LOCAL_STATIC_LIBRARIES := $(ue_common_static_libraries) |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 843 | LOCAL_SRC_FILES := \ |
| 844 | common/http_common.cc \ |
| 845 | test_http_server.cc |
Alex Deymo | dc873fa | 2016-03-03 22:32:47 -0800 | [diff] [blame] | 846 | include $(BUILD_EXECUTABLE) |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 847 | |
Alex Deymo | 279d572 | 2016-04-07 16:22:13 -0700 | [diff] [blame] | 848 | # test_subprocess (type: executable) |
| 849 | # ======================================================== |
| 850 | # Test helper subprocess program. |
| 851 | include $(CLEAR_VARS) |
| 852 | LOCAL_MODULE := test_subprocess |
Alex Deymo | 279d572 | 2016-04-07 16:22:13 -0700 | [diff] [blame] | 853 | LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests |
| 854 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 855 | LOCAL_CPP_EXTENSION := .cc |
Alex Deymo | 279d572 | 2016-04-07 16:22:13 -0700 | [diff] [blame] | 856 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 857 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 858 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
| 859 | LOCAL_C_INCLUDES := $(ue_common_c_includes) |
| 860 | LOCAL_SHARED_LIBRARIES := $(ue_common_shared_libraries) |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 861 | LOCAL_STATIC_LIBRARIES := $(ue_common_static_libraries) |
Alex Deymo | 279d572 | 2016-04-07 16:22:13 -0700 | [diff] [blame] | 862 | LOCAL_SRC_FILES := test_subprocess.cc |
| 863 | include $(BUILD_EXECUTABLE) |
| 864 | |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 865 | # update_engine_unittests (type: executable) |
| 866 | # ======================================================== |
| 867 | # Main unittest file. |
| 868 | include $(CLEAR_VARS) |
| 869 | LOCAL_MODULE := update_engine_unittests |
Alex Deymo | c90be63 | 2016-02-17 19:25:20 -0800 | [diff] [blame] | 870 | LOCAL_REQUIRED_MODULES := \ |
Alex Deymo | 279d572 | 2016-04-07 16:22:13 -0700 | [diff] [blame] | 871 | test_http_server \ |
| 872 | test_subprocess \ |
Sen Jiang | 5a216c1 | 2016-03-30 13:08:24 -0700 | [diff] [blame] | 873 | ue_unittest_delta_generator \ |
Alex Deymo | c90be63 | 2016-02-17 19:25:20 -0800 | [diff] [blame] | 874 | ue_unittest_disk_ext2_1k.img \ |
| 875 | ue_unittest_disk_ext2_4k.img \ |
| 876 | ue_unittest_disk_ext2_4k_empty.img \ |
Sen Jiang | 923886a | 2016-03-14 15:04:28 -0700 | [diff] [blame] | 877 | ue_unittest_disk_ext2_unittest.img \ |
| 878 | ue_unittest_key.pem \ |
| 879 | ue_unittest_key.pub.pem \ |
| 880 | ue_unittest_key2.pem \ |
Sen Jiang | e0d0428 | 2016-03-01 14:22:52 -0800 | [diff] [blame] | 881 | ue_unittest_key2.pub.pem \ |
Sen Jiang | ee63c6e | 2016-03-30 14:01:02 -0700 | [diff] [blame] | 882 | ue_unittest_update_engine.conf \ |
Sen Jiang | e0d0428 | 2016-03-01 14:22:52 -0800 | [diff] [blame] | 883 | zlib_fingerprint |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 884 | LOCAL_CPP_EXTENSION := .cc |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 885 | LOCAL_CFLAGS := $(ue_common_cflags) |
| 886 | LOCAL_CPPFLAGS := $(ue_common_cppflags) |
| 887 | LOCAL_LDFLAGS := $(ue_common_ldflags) |
| 888 | LOCAL_C_INCLUDES := \ |
| 889 | $(ue_common_c_includes) \ |
| 890 | $(ue_libupdate_engine_exported_c_includes) |
| 891 | LOCAL_STATIC_LIBRARIES := \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 892 | libpayload_generator \ |
| 893 | libbrillo-test-helpers \ |
| 894 | libgmock \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 895 | libchrome_test_helpers \ |
Dan Albert | 6cacaf5 | 2016-08-11 13:05:40 -0700 | [diff] [blame] | 896 | $(ue_common_static_libraries) \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 897 | $(ue_libpayload_generator_exported_static_libraries:-host=) |
| 898 | LOCAL_SHARED_LIBRARIES := \ |
| 899 | $(ue_common_shared_libraries) \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 900 | $(ue_libpayload_generator_exported_shared_libraries:-host=) |
| 901 | LOCAL_SRC_FILES := \ |
Alex Deymo | 14c0da8 | 2016-07-20 16:45:45 -0700 | [diff] [blame] | 902 | certificate_checker_unittest.cc \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 903 | common/action_pipe_unittest.cc \ |
| 904 | common/action_processor_unittest.cc \ |
| 905 | common/action_unittest.cc \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 906 | common/cpu_limiter_unittest.cc \ |
| 907 | common/fake_prefs.cc \ |
Alex Deymo | 2c131bb | 2016-05-26 16:43:13 -0700 | [diff] [blame] | 908 | common/file_fetcher_unittest.cc \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 909 | common/hash_calculator_unittest.cc \ |
| 910 | common/http_fetcher_unittest.cc \ |
| 911 | common/hwid_override_unittest.cc \ |
| 912 | common/mock_http_fetcher.cc \ |
| 913 | common/prefs_unittest.cc \ |
| 914 | common/subprocess_unittest.cc \ |
| 915 | common/terminator_unittest.cc \ |
| 916 | common/test_utils.cc \ |
| 917 | common/utils_unittest.cc \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 918 | payload_consumer/bzip_extent_writer_unittest.cc \ |
| 919 | payload_consumer/delta_performer_integration_test.cc \ |
| 920 | payload_consumer/delta_performer_unittest.cc \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 921 | payload_consumer/extent_writer_unittest.cc \ |
Alex Deymo | a48f630 | 2016-11-04 15:49:53 -0700 | [diff] [blame] | 922 | payload_consumer/fake_file_descriptor.cc \ |
| 923 | payload_consumer/file_descriptor_utils_unittest.cc \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 924 | payload_consumer/file_writer_unittest.cc \ |
| 925 | payload_consumer/filesystem_verifier_action_unittest.cc \ |
| 926 | payload_consumer/postinstall_runner_action_unittest.cc \ |
| 927 | payload_consumer/xz_extent_writer_unittest.cc \ |
| 928 | payload_generator/ab_generator_unittest.cc \ |
| 929 | payload_generator/blob_file_writer_unittest.cc \ |
| 930 | payload_generator/block_mapping_unittest.cc \ |
| 931 | payload_generator/cycle_breaker_unittest.cc \ |
| 932 | payload_generator/delta_diff_utils_unittest.cc \ |
| 933 | payload_generator/ext2_filesystem_unittest.cc \ |
| 934 | payload_generator/extent_ranges_unittest.cc \ |
| 935 | payload_generator/extent_utils_unittest.cc \ |
| 936 | payload_generator/fake_filesystem.cc \ |
| 937 | payload_generator/full_update_generator_unittest.cc \ |
| 938 | payload_generator/graph_utils_unittest.cc \ |
| 939 | payload_generator/inplace_generator_unittest.cc \ |
Alex Deymo | 20bdc70 | 2016-12-07 21:07:11 -0800 | [diff] [blame] | 940 | payload_generator/mapfile_filesystem_unittest.cc \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 941 | payload_generator/payload_file_unittest.cc \ |
| 942 | payload_generator/payload_generation_config_unittest.cc \ |
| 943 | payload_generator/payload_signer_unittest.cc \ |
| 944 | payload_generator/tarjan_unittest.cc \ |
| 945 | payload_generator/topological_sort_unittest.cc \ |
| 946 | payload_generator/zip_unittest.cc \ |
Alex Deymo | 3582194 | 2017-02-05 04:36:02 +0000 | [diff] [blame] | 947 | proxy_resolver_unittest.cc \ |
Sen Jiang | 24ab6c0 | 2016-06-22 16:26:47 -0700 | [diff] [blame] | 948 | testrunner.cc |
| 949 | ifeq ($(local_use_omaha),1) |
| 950 | LOCAL_C_INCLUDES += \ |
| 951 | $(ue_libupdate_engine_exported_c_includes) |
| 952 | LOCAL_STATIC_LIBRARIES += \ |
| 953 | libupdate_engine \ |
| 954 | $(ue_libupdate_engine_exported_static_libraries:-host=) |
| 955 | LOCAL_SHARED_LIBRARIES += \ |
| 956 | $(ue_libupdate_engine_exported_shared_libraries:-host=) |
| 957 | LOCAL_SRC_FILES += \ |
| 958 | common_service_unittest.cc \ |
| 959 | fake_system_state.cc \ |
Sen Jiang | b56fe9f | 2017-06-16 15:19:35 -0700 | [diff] [blame] | 960 | image_properties_android_unittest.cc \ |
Tianjie Xu | 98333a8 | 2017-09-22 21:29:29 -0700 | [diff] [blame] | 961 | metrics_reporter_omaha_unittest.cc \ |
Sen Jiang | 24ab6c0 | 2016-06-22 16:26:47 -0700 | [diff] [blame] | 962 | metrics_utils_unittest.cc \ |
| 963 | omaha_request_action_unittest.cc \ |
| 964 | omaha_request_params_unittest.cc \ |
| 965 | omaha_response_handler_action_unittest.cc \ |
| 966 | omaha_utils_unittest.cc \ |
| 967 | p2p_manager_unittest.cc \ |
| 968 | payload_consumer/download_action_unittest.cc \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 969 | payload_state_unittest.cc \ |
Aaron Wood | 7f92e2b | 2017-08-28 14:51:21 -0700 | [diff] [blame] | 970 | parcelable_update_engine_status_unittest.cc \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 971 | update_attempter_unittest.cc \ |
| 972 | update_manager/boxed_value_unittest.cc \ |
| 973 | update_manager/chromeos_policy_unittest.cc \ |
| 974 | update_manager/evaluation_context_unittest.cc \ |
| 975 | update_manager/generic_variables_unittest.cc \ |
| 976 | update_manager/prng_unittest.cc \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 977 | update_manager/real_device_policy_provider_unittest.cc \ |
| 978 | update_manager/real_random_provider_unittest.cc \ |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 979 | update_manager/real_system_provider_unittest.cc \ |
| 980 | update_manager/real_time_provider_unittest.cc \ |
| 981 | update_manager/real_updater_provider_unittest.cc \ |
| 982 | update_manager/umtest_utils.cc \ |
| 983 | update_manager/update_manager_unittest.cc \ |
Sen Jiang | 24ab6c0 | 2016-06-22 16:26:47 -0700 | [diff] [blame] | 984 | update_manager/variable_unittest.cc |
| 985 | else # local_use_omaha == 1 |
| 986 | LOCAL_STATIC_LIBRARIES += \ |
| 987 | libupdate_engine_android \ |
| 988 | $(ue_libupdate_engine_android_exported_static_libraries:-host=) |
| 989 | LOCAL_SHARED_LIBRARIES += \ |
| 990 | $(ue_libupdate_engine_android_exported_shared_libraries:-host=) |
Tianjie Xu | 90aaa10 | 2017-10-10 17:39:03 -0700 | [diff] [blame] | 991 | LOCAL_SRC_FILES += \ |
| 992 | update_attempter_android_unittest.cc |
Sen Jiang | 24ab6c0 | 2016-06-22 16:26:47 -0700 | [diff] [blame] | 993 | endif # local_use_omaha == 1 |
Amin Hassani | e94ece5 | 2017-08-01 15:03:08 -0700 | [diff] [blame] | 994 | ifeq ($(local_use_chrome_network_proxy),1) |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 995 | LOCAL_SRC_FILES += \ |
| 996 | chrome_browser_proxy_resolver_unittest.cc |
Amin Hassani | e94ece5 | 2017-08-01 15:03:08 -0700 | [diff] [blame] | 997 | endif # local_use_chrome_network_proxy == 1 |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 998 | include $(BUILD_NATIVE_TEST) |
Alex Deymo | 80f70ff | 2016-02-10 16:08:11 -0800 | [diff] [blame] | 999 | |
Gaurav Shah | 263614f | 2015-09-24 14:20:38 -0700 | [diff] [blame] | 1000 | # Update payload signing public key. |
| 1001 | # ======================================================== |
Alex Deymo | 78850aa | 2017-04-05 04:25:36 -0700 | [diff] [blame] | 1002 | ifeq ($(PRODUCT_IOT),true) |
Gaurav Shah | 263614f | 2015-09-24 14:20:38 -0700 | [diff] [blame] | 1003 | include $(CLEAR_VARS) |
| 1004 | LOCAL_MODULE := brillo-update-payload-key |
| 1005 | LOCAL_MODULE_CLASS := ETC |
| 1006 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/update_engine |
| 1007 | LOCAL_MODULE_STEM := update-payload-key.pub.pem |
| 1008 | LOCAL_SRC_FILES := update_payload_key/brillo-update-payload-key.pub.pem |
| 1009 | LOCAL_BUILT_MODULE_STEM := update_payload_key/brillo-update-payload-key.pub.pem |
| 1010 | include $(BUILD_PREBUILT) |
Alex Deymo | 78850aa | 2017-04-05 04:25:36 -0700 | [diff] [blame] | 1011 | endif # PRODUCT_IOT |
Tao Bao | 042f8a1 | 2016-01-07 16:52:14 -0800 | [diff] [blame] | 1012 | |
| 1013 | # Brillo update payload generation script |
| 1014 | # ======================================================== |
| 1015 | ifeq ($(HOST_OS),linux) |
| 1016 | include $(CLEAR_VARS) |
| 1017 | LOCAL_SRC_FILES := scripts/brillo_update_payload |
| 1018 | LOCAL_MODULE := brillo_update_payload |
| 1019 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 1020 | LOCAL_IS_HOST_MODULE := true |
| 1021 | LOCAL_MODULE_TAGS := optional |
| 1022 | LOCAL_REQUIRED_MODULES := \ |
| 1023 | delta_generator \ |
Sen Jiang | db537c1 | 2017-09-20 14:53:05 -0700 | [diff] [blame] | 1024 | shflags \ |
| 1025 | simg2img |
Tao Bao | 042f8a1 | 2016-01-07 16:52:14 -0800 | [diff] [blame] | 1026 | include $(BUILD_PREBUILT) |
| 1027 | endif # HOST_OS == linux |
Daniel Cardenas | 0c37e31 | 2017-11-06 12:01:33 -0800 | [diff] [blame] | 1028 | |
| 1029 | endif # ifneq ($(TARGET_BUILD_PDK),true) |