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