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