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 | |
| 19 | # Definitions applying to all targets. $(eval) this last. |
| 20 | define update_engine_common |
| 21 | LOCAL_CPP_EXTENSION := .cc |
| 22 | LOCAL_RTTI_FLAG := -frtti |
| 23 | LOCAL_CLANG := true |
| 24 | |
| 25 | LOCAL_CFLAGS += \ |
| 26 | -DUSE_HWID_OVERRIDE=0 \ |
| 27 | -DUSE_MTD=0 \ |
| 28 | -DUSE_POWER_MANAGEMENT=0 \ |
| 29 | -D_FILE_OFFSET_BITS=64 \ |
| 30 | -D_POSIX_C_SOURCE=199309L \ |
| 31 | -Wa,--noexecstack \ |
| 32 | -Wall \ |
| 33 | -Werror \ |
| 34 | -Wextra \ |
| 35 | -Wformat=2 \ |
| 36 | -Wno-psabi \ |
| 37 | -Wno-unused-parameter \ |
| 38 | -ffunction-sections \ |
| 39 | -fstack-protector-strong \ |
| 40 | -fvisibility=hidden |
| 41 | LOCAL_CPPFLAGS += \ |
| 42 | -Wnon-virtual-dtor \ |
| 43 | -fno-strict-aliasing \ |
| 44 | -std=gnu++11 |
| 45 | LOCAL_LDFLAGS += \ |
| 46 | -Wl,--gc-sections |
| 47 | LOCAL_C_INCLUDES += \ |
Christopher Wiley | cc8ce0e | 2015-10-01 16:48:47 -0700 | [diff] [blame] | 48 | $(LOCAL_PATH)/client_library/include \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 49 | external/gtest/include \ |
| 50 | system |
| 51 | LOCAL_SHARED_LIBRARIES += \ |
| 52 | libchrome \ |
| 53 | libchrome-dbus \ |
| 54 | libchromeos \ |
| 55 | libchromeos-dbus \ |
| 56 | libchromeos-http \ |
| 57 | libchromeos-stream |
| 58 | endef |
| 59 | |
| 60 | # update_metadata-protos (type: static_library) |
| 61 | # ======================================================== |
| 62 | # Protobufs. |
| 63 | include $(CLEAR_VARS) |
| 64 | LOCAL_MODULE := update_metadata-protos |
| 65 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 66 | generated_sources_dir := $(call local-generated-sources-dir) |
| 67 | LOCAL_EXPORT_C_INCLUDE_DIRS += \ |
| 68 | $(generated_sources_dir)/proto/system |
| 69 | LOCAL_SHARED_LIBRARIES += \ |
| 70 | libprotobuf-cpp-lite-rtti |
| 71 | LOCAL_SRC_FILES := \ |
| 72 | update_metadata.proto |
| 73 | $(eval $(update_engine_common)) |
| 74 | include $(BUILD_STATIC_LIBRARY) |
| 75 | |
| 76 | # update_engine-dbus-adaptor (from generate-dbus-adaptors.gypi) |
| 77 | # ======================================================== |
| 78 | include $(CLEAR_VARS) |
| 79 | LOCAL_MODULE := update_engine-dbus-adaptor |
| 80 | LOCAL_SRC_FILES := \ |
| 81 | dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml |
| 82 | include $(BUILD_STATIC_LIBRARY) |
| 83 | |
| 84 | # update_engine-dbus-libcros-client (from generate-dbus-proxies.gypi) |
| 85 | # ======================================================== |
| 86 | include $(CLEAR_VARS) |
| 87 | LOCAL_MODULE := update_engine-dbus-libcros-client |
| 88 | LOCAL_SRC_FILES := \ |
| 89 | dbus_bindings/org.chromium.LibCrosService.dbus-xml |
| 90 | LOCAL_DBUS_PROXY_PREFIX := libcros |
| 91 | include $(BUILD_STATIC_LIBRARY) |
| 92 | |
| 93 | # libupdate_engine (type: static_library) |
| 94 | # ======================================================== |
| 95 | # The main static_library with all the code. |
| 96 | include $(CLEAR_VARS) |
| 97 | LOCAL_MODULE := libupdate_engine |
| 98 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 99 | LOCAL_C_INCLUDES += \ |
Alex Deymo | 7eb2305 | 2015-10-09 15:27:59 -0700 | [diff] [blame] | 100 | $(LOCAL_PATH)/include \ |
| 101 | external/cros/system_api/dbus \ |
| 102 | external/e2fsprogs/lib |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 103 | LOCAL_EXPORT_C_INCLUDE_DIRS += \ |
Alex Deymo | 7eb2305 | 2015-10-09 15:27:59 -0700 | [diff] [blame] | 104 | $(LOCAL_PATH)/include \ |
| 105 | external/cros/system_api/dbus |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 106 | LOCAL_STATIC_LIBRARIES += \ |
| 107 | update_metadata-protos \ |
| 108 | update_engine-dbus-adaptor \ |
| 109 | update_engine-dbus-libcros-client \ |
| 110 | update_engine_client-dbus-proxies \ |
Alex Deymo | eadab7d | 2015-10-09 14:45:02 -0700 | [diff] [blame] | 111 | libxz \ |
David Zeuthen | 753fadc | 2015-09-15 16:34:09 -0400 | [diff] [blame] | 112 | libbz \ |
Alex Deymo | eadab7d | 2015-10-09 14:45:02 -0700 | [diff] [blame] | 113 | libfs_mgr |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 114 | LOCAL_SHARED_LIBRARIES += \ |
| 115 | libprotobuf-cpp-lite-rtti \ |
| 116 | libdbus \ |
| 117 | libcrypto \ |
| 118 | libcurl \ |
| 119 | libmetrics \ |
Alex Deymo | 7eb2305 | 2015-10-09 15:27:59 -0700 | [diff] [blame] | 120 | libshill-client \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 121 | libssl \ |
| 122 | libexpat \ |
Alex Deymo | eadab7d | 2015-10-09 14:45:02 -0700 | [diff] [blame] | 123 | libchromeos-policy \ |
| 124 | libhardware \ |
| 125 | libcutils |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 126 | LOCAL_SRC_FILES := \ |
| 127 | action_processor.cc \ |
| 128 | boot_control_android.cc \ |
| 129 | bzip.cc \ |
| 130 | bzip_extent_writer.cc \ |
| 131 | certificate_checker.cc \ |
| 132 | chrome_browser_proxy_resolver.cc \ |
| 133 | clock.cc \ |
| 134 | connection_manager.cc \ |
| 135 | constants.cc \ |
| 136 | daemon.cc \ |
| 137 | dbus_service.cc \ |
| 138 | delta_performer.cc \ |
| 139 | download_action.cc \ |
| 140 | extent_writer.cc \ |
| 141 | file_descriptor.cc \ |
| 142 | file_writer.cc \ |
| 143 | filesystem_verifier_action.cc \ |
| 144 | hardware_android.cc \ |
| 145 | http_common.cc \ |
| 146 | http_fetcher.cc \ |
| 147 | hwid_override.cc \ |
| 148 | install_plan.cc \ |
| 149 | libcros_proxy.cc \ |
| 150 | libcurl_http_fetcher.cc \ |
| 151 | metrics.cc \ |
| 152 | multi_range_http_fetcher.cc \ |
| 153 | omaha_hash_calculator.cc \ |
| 154 | omaha_request_action.cc \ |
| 155 | omaha_request_params.cc \ |
| 156 | omaha_response_handler_action.cc \ |
| 157 | p2p_manager.cc \ |
| 158 | payload_constants.cc \ |
| 159 | payload_state.cc \ |
| 160 | payload_verifier.cc \ |
Alex Deymo | ac41a82 | 2015-09-15 20:52:53 -0700 | [diff] [blame] | 161 | platform_constants_android.cc \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 162 | postinstall_runner_action.cc \ |
| 163 | prefs.cc \ |
| 164 | proxy_resolver.cc \ |
| 165 | real_system_state.cc \ |
| 166 | shill_proxy.cc \ |
| 167 | subprocess.cc \ |
| 168 | terminator.cc \ |
| 169 | update_attempter.cc \ |
| 170 | update_manager/boxed_value.cc \ |
| 171 | update_manager/chromeos_policy.cc \ |
| 172 | update_manager/default_policy.cc \ |
| 173 | update_manager/evaluation_context.cc \ |
| 174 | update_manager/policy.cc \ |
| 175 | update_manager/real_config_provider.cc \ |
| 176 | update_manager/real_device_policy_provider.cc \ |
| 177 | update_manager/real_random_provider.cc \ |
| 178 | update_manager/real_shill_provider.cc \ |
| 179 | update_manager/real_system_provider.cc \ |
| 180 | update_manager/real_time_provider.cc \ |
| 181 | update_manager/real_updater_provider.cc \ |
| 182 | update_manager/state_factory.cc \ |
| 183 | update_manager/update_manager.cc \ |
Christopher Wiley | cc8ce0e | 2015-10-01 16:48:47 -0700 | [diff] [blame] | 184 | update_status_utils.cc \ |
Alex Deymo | 2e71f90 | 2015-09-30 01:25:48 -0700 | [diff] [blame] | 185 | utils.cc \ |
| 186 | xz_extent_writer.cc |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 187 | $(eval $(update_engine_common)) |
| 188 | include $(BUILD_STATIC_LIBRARY) |
| 189 | |
| 190 | # update_engine (type: executable) |
| 191 | # ======================================================== |
| 192 | # update_engine daemon. |
| 193 | include $(CLEAR_VARS) |
| 194 | LOCAL_MODULE := update_engine |
| 195 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 196 | LOCAL_STATIC_LIBRARIES += \ |
| 197 | libupdate_engine \ |
| 198 | libbz \ |
David Zeuthen | 753fadc | 2015-09-15 16:34:09 -0400 | [diff] [blame] | 199 | libfs_mgr \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 200 | update_metadata-protos \ |
| 201 | update_engine-dbus-adaptor \ |
| 202 | update_engine-dbus-libcros-client \ |
Alex Deymo | eadab7d | 2015-10-09 14:45:02 -0700 | [diff] [blame] | 203 | update_engine_client-dbus-proxies \ |
| 204 | libxz |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 205 | LOCAL_SHARED_LIBRARIES += \ |
| 206 | libprotobuf-cpp-lite-rtti \ |
| 207 | libdbus \ |
| 208 | libcrypto \ |
| 209 | libcurl \ |
| 210 | libmetrics \ |
Alex Deymo | 7eb2305 | 2015-10-09 15:27:59 -0700 | [diff] [blame] | 211 | libshill-client \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 212 | libssl \ |
| 213 | libexpat \ |
Alex Deymo | eadab7d | 2015-10-09 14:45:02 -0700 | [diff] [blame] | 214 | libchromeos-policy \ |
| 215 | libhardware \ |
| 216 | libcutils |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 217 | LOCAL_SRC_FILES := \ |
| 218 | main.cc |
Gilad Arnold | 70141f2 | 2015-09-17 09:06:30 -0700 | [diff] [blame] | 219 | LOCAL_INIT_RC := update_engine.rc |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 220 | $(eval $(update_engine_common)) |
| 221 | include $(BUILD_EXECUTABLE) |
| 222 | |
| 223 | # update_engine_client (type: executable) |
| 224 | # ======================================================== |
| 225 | # update_engine console client. |
| 226 | include $(CLEAR_VARS) |
| 227 | LOCAL_MODULE := update_engine_client |
| 228 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 229 | LOCAL_C_INCLUDES += \ |
| 230 | $(LOCAL_PATH)/include |
| 231 | LOCAL_STATIC_LIBRARIES += \ |
| 232 | update_engine_client-dbus-proxies |
| 233 | LOCAL_SRC_FILES := \ |
| 234 | update_engine_client.cc |
| 235 | $(eval $(update_engine_common)) |
| 236 | include $(BUILD_EXECUTABLE) |
| 237 | |
| 238 | # libpayload_generator (type: static_library) |
| 239 | # ======================================================== |
| 240 | # server-side code. This is used for delta_generator and unittests but not |
| 241 | # for any client code. |
| 242 | include $(CLEAR_VARS) |
| 243 | LOCAL_MODULE := libpayload_generator |
| 244 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 245 | LOCAL_STATIC_LIBRARIES += \ |
| 246 | libupdate_engine \ |
| 247 | libbz \ |
David Zeuthen | 753fadc | 2015-09-15 16:34:09 -0400 | [diff] [blame] | 248 | libfs_mgr \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 249 | update_metadata-protos \ |
| 250 | update_engine-dbus-adaptor \ |
| 251 | update_engine-dbus-libcros-client \ |
| 252 | update_engine_client-dbus-proxies \ |
Alex Deymo | eadab7d | 2015-10-09 14:45:02 -0700 | [diff] [blame] | 253 | libxz \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 254 | update_metadata-protos |
| 255 | LOCAL_SHARED_LIBRARIES += \ |
| 256 | libdbus \ |
| 257 | libcrypto \ |
| 258 | libcurl \ |
| 259 | libmetrics \ |
Alex Deymo | 7eb2305 | 2015-10-09 15:27:59 -0700 | [diff] [blame] | 260 | libshill-client \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 261 | libssl \ |
| 262 | libexpat \ |
| 263 | libchromeos-policy \ |
Alex Deymo | eadab7d | 2015-10-09 14:45:02 -0700 | [diff] [blame] | 264 | libhardware \ |
| 265 | libcutils \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 266 | libprotobuf-cpp-lite-rtti \ |
| 267 | libext2fs |
| 268 | LOCAL_SRC_FILES := \ |
| 269 | payload_generator/ab_generator.cc \ |
| 270 | payload_generator/annotated_operation.cc \ |
| 271 | payload_generator/blob_file_writer.cc \ |
| 272 | payload_generator/block_mapping.cc \ |
| 273 | payload_generator/cycle_breaker.cc \ |
| 274 | payload_generator/delta_diff_generator.cc \ |
| 275 | payload_generator/delta_diff_utils.cc \ |
| 276 | payload_generator/ext2_filesystem.cc \ |
| 277 | payload_generator/extent_ranges.cc \ |
| 278 | payload_generator/extent_utils.cc \ |
| 279 | payload_generator/full_update_generator.cc \ |
| 280 | payload_generator/graph_types.cc \ |
| 281 | payload_generator/graph_utils.cc \ |
| 282 | payload_generator/inplace_generator.cc \ |
| 283 | payload_generator/payload_file.cc \ |
| 284 | payload_generator/payload_generation_config.cc \ |
| 285 | payload_generator/payload_signer.cc \ |
| 286 | payload_generator/raw_filesystem.cc \ |
| 287 | payload_generator/tarjan.cc \ |
| 288 | payload_generator/topological_sort.cc |
| 289 | $(eval $(update_engine_common)) |
| 290 | include $(BUILD_STATIC_LIBRARY) |
| 291 | |
| 292 | # delta_generator (type: executable) |
| 293 | # ======================================================== |
| 294 | # server-side delta generator. |
| 295 | include $(CLEAR_VARS) |
| 296 | LOCAL_MODULE := delta_generator |
| 297 | LOCAL_MODULE_CLASS := EXECUTABLES |
| 298 | LOCAL_STATIC_LIBRARIES += \ |
| 299 | libpayload_generator \ |
| 300 | libupdate_engine \ |
| 301 | libbz \ |
David Zeuthen | 753fadc | 2015-09-15 16:34:09 -0400 | [diff] [blame] | 302 | libfs_mgr \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 303 | update_metadata-protos \ |
| 304 | update_engine-dbus-adaptor \ |
| 305 | update_engine-dbus-libcros-client \ |
Alex Deymo | eadab7d | 2015-10-09 14:45:02 -0700 | [diff] [blame] | 306 | update_engine_client-dbus-proxies \ |
| 307 | libxz |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 308 | LOCAL_SHARED_LIBRARIES += \ |
| 309 | libdbus \ |
| 310 | libcrypto \ |
| 311 | libcurl \ |
| 312 | libmetrics \ |
Alex Deymo | 7eb2305 | 2015-10-09 15:27:59 -0700 | [diff] [blame] | 313 | libshill-client \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 314 | libssl \ |
| 315 | libexpat \ |
| 316 | libchromeos-policy \ |
Alex Deymo | eadab7d | 2015-10-09 14:45:02 -0700 | [diff] [blame] | 317 | libhardware \ |
| 318 | libcutils \ |
Alex Deymo | d5561a5 | 2015-09-03 23:17:52 -0700 | [diff] [blame] | 319 | libprotobuf-cpp-lite-rtti \ |
| 320 | libext2fs |
| 321 | LOCAL_SRC_FILES := \ |
| 322 | payload_generator/generate_delta_main.cc |
| 323 | $(eval $(update_engine_common)) |
| 324 | include $(BUILD_EXECUTABLE) |
| 325 | |
| 326 | # update_engine_client-dbus-proxies (from generate-dbus-proxies.gypi) |
| 327 | # ======================================================== |
| 328 | include $(CLEAR_VARS) |
| 329 | LOCAL_MODULE := update_engine_client-dbus-proxies |
| 330 | LOCAL_SRC_FILES := \ |
| 331 | dbus_bindings/dbus-service-config.json \ |
| 332 | dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml |
| 333 | LOCAL_DBUS_PROXY_PREFIX := update_engine |
| 334 | include $(BUILD_STATIC_LIBRARY) |
Alex Deymo | 0290c1f | 2015-09-14 17:45:38 -0700 | [diff] [blame] | 335 | |
Christopher Wiley | 16daa08 | 2015-10-01 17:18:40 -0700 | [diff] [blame] | 336 | # libupdate_engine_client |
| 337 | # ======================================================== |
| 338 | include $(CLEAR_VARS) |
| 339 | LOCAL_MODULE := libupdate_engine_client |
| 340 | LOCAL_RTTI_FLAG := -frtti |
| 341 | LOCAL_CFLAGS := \ |
| 342 | -Wall \ |
| 343 | -Werror \ |
| 344 | -Wno-unused-parameter |
| 345 | LOCAL_CLANG := true |
| 346 | LOCAL_CPP_EXTENSION := .cc |
| 347 | LOCAL_C_INCLUDES := \ |
| 348 | $(LOCAL_PATH)/client_library/include \ |
| 349 | external/cros/system_api/dbus \ |
| 350 | system \ |
| 351 | external/gtest/include |
| 352 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/client_library/include |
| 353 | LOCAL_SHARED_LIBRARIES := \ |
| 354 | libchrome \ |
| 355 | libchrome-dbus \ |
| 356 | libchromeos \ |
| 357 | libchromeos-dbus |
| 358 | LOCAL_STATIC_LIBRARIES := \ |
| 359 | update_engine_client-dbus-proxies |
| 360 | LOCAL_SRC_FILES := \ |
| 361 | client_library/client.cc \ |
| 362 | client_library/client_impl.cc \ |
| 363 | update_status_utils.cc |
| 364 | include $(BUILD_SHARED_LIBRARY) |
| 365 | |
Gaurav Shah | 263614f | 2015-09-24 14:20:38 -0700 | [diff] [blame] | 366 | |
| 367 | # Update payload signing public key. |
| 368 | # ======================================================== |
| 369 | include $(CLEAR_VARS) |
| 370 | LOCAL_MODULE := brillo-update-payload-key |
| 371 | LOCAL_MODULE_CLASS := ETC |
| 372 | LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/update_engine |
| 373 | LOCAL_MODULE_STEM := update-payload-key.pub.pem |
| 374 | LOCAL_SRC_FILES := update_payload_key/brillo-update-payload-key.pub.pem |
| 375 | LOCAL_BUILT_MODULE_STEM := update_payload_key/brillo-update-payload-key.pub.pem |
| 376 | include $(BUILD_PREBUILT) |