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