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