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