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