Android.mk revision 4cf1402b6245f1606788b1850b1a9c3571b0d27b
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 17LOCAL_PATH := $(my-dir) 18 19# Definitions applying to all targets. $(eval) this last. 20define 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 += \ 48 $(LOCAL_PATH)/client_library/include \ 49 external/gtest/include \ 50 system 51 LOCAL_SHARED_LIBRARIES += \ 52 libbrillo \ 53 libbrillo-dbus \ 54 libbrillo-http \ 55 libbrillo-stream \ 56 libchrome \ 57 libchrome-dbus 58endef 59 60# update_metadata-protos (type: static_library) 61# ======================================================== 62# Protobufs. 63include $(CLEAR_VARS) 64LOCAL_MODULE := update_metadata-protos 65LOCAL_MODULE_CLASS := STATIC_LIBRARIES 66generated_sources_dir := $(call local-generated-sources-dir) 67LOCAL_EXPORT_C_INCLUDE_DIRS += \ 68 $(generated_sources_dir)/proto/system 69LOCAL_SHARED_LIBRARIES += \ 70 libprotobuf-cpp-lite-rtti 71LOCAL_SRC_FILES := \ 72 update_metadata.proto 73$(eval $(update_engine_common)) 74include $(BUILD_STATIC_LIBRARY) 75 76# update_engine-dbus-adaptor (from generate-dbus-adaptors.gypi) 77# ======================================================== 78include $(CLEAR_VARS) 79LOCAL_MODULE := update_engine-dbus-adaptor 80LOCAL_SRC_FILES := \ 81 dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml 82include $(BUILD_STATIC_LIBRARY) 83 84# update_engine-dbus-libcros-client (from generate-dbus-proxies.gypi) 85# ======================================================== 86include $(CLEAR_VARS) 87LOCAL_MODULE := update_engine-dbus-libcros-client 88LOCAL_SRC_FILES := \ 89 dbus_bindings/org.chromium.LibCrosService.dbus-xml 90LOCAL_DBUS_PROXY_PREFIX := libcros 91include $(BUILD_STATIC_LIBRARY) 92 93# libupdate_engine (type: static_library) 94# ======================================================== 95# The main static_library with all the code. 96include $(CLEAR_VARS) 97LOCAL_MODULE := libupdate_engine 98LOCAL_MODULE_CLASS := STATIC_LIBRARIES 99LOCAL_C_INCLUDES += \ 100 $(LOCAL_PATH)/include \ 101 external/cros/system_api/dbus \ 102 external/e2fsprogs/lib 103LOCAL_EXPORT_C_INCLUDE_DIRS += \ 104 $(LOCAL_PATH)/include \ 105 external/cros/system_api/dbus 106LOCAL_STATIC_LIBRARIES += \ 107 update_metadata-protos \ 108 update_engine-dbus-adaptor \ 109 update_engine-dbus-libcros-client \ 110 update_engine_client-dbus-proxies \ 111 libxz \ 112 libbz \ 113 libfs_mgr 114LOCAL_SHARED_LIBRARIES += \ 115 libprotobuf-cpp-lite-rtti \ 116 libdbus \ 117 libcrypto \ 118 libcurl \ 119 libmetrics \ 120 libshill-client \ 121 libssl \ 122 libexpat \ 123 libbrillo-policy \ 124 libhardware \ 125 libcutils 126LOCAL_SRC_FILES := \ 127 action_processor.cc \ 128 boot_control_android.cc \ 129 boot_control_stub.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 image_properties_android.cc \ 149 install_plan.cc \ 150 libcros_proxy.cc \ 151 libcurl_http_fetcher.cc \ 152 metrics.cc \ 153 multi_range_http_fetcher.cc \ 154 omaha_hash_calculator.cc \ 155 omaha_request_action.cc \ 156 omaha_request_params.cc \ 157 omaha_response_handler_action.cc \ 158 p2p_manager.cc \ 159 payload_constants.cc \ 160 payload_state.cc \ 161 payload_verifier.cc \ 162 platform_constants_android.cc \ 163 postinstall_runner_action.cc \ 164 prefs.cc \ 165 proxy_resolver.cc \ 166 real_system_state.cc \ 167 shill_proxy.cc \ 168 subprocess.cc \ 169 terminator.cc \ 170 update_attempter.cc \ 171 update_manager/boxed_value.cc \ 172 update_manager/chromeos_policy.cc \ 173 update_manager/default_policy.cc \ 174 update_manager/evaluation_context.cc \ 175 update_manager/policy.cc \ 176 update_manager/real_config_provider.cc \ 177 update_manager/real_device_policy_provider.cc \ 178 update_manager/real_random_provider.cc \ 179 update_manager/real_shill_provider.cc \ 180 update_manager/real_system_provider.cc \ 181 update_manager/real_time_provider.cc \ 182 update_manager/real_updater_provider.cc \ 183 update_manager/state_factory.cc \ 184 update_manager/update_manager.cc \ 185 update_status_utils.cc \ 186 utils.cc \ 187 xz_extent_writer.cc 188$(eval $(update_engine_common)) 189include $(BUILD_STATIC_LIBRARY) 190 191# update_engine (type: executable) 192# ======================================================== 193# update_engine daemon. 194include $(CLEAR_VARS) 195LOCAL_MODULE := update_engine 196LOCAL_MODULE_CLASS := EXECUTABLES 197LOCAL_STATIC_LIBRARIES += \ 198 libupdate_engine \ 199 libbz \ 200 libfs_mgr \ 201 update_metadata-protos \ 202 update_engine-dbus-adaptor \ 203 update_engine-dbus-libcros-client \ 204 update_engine_client-dbus-proxies \ 205 libxz 206LOCAL_SHARED_LIBRARIES += \ 207 libprotobuf-cpp-lite-rtti \ 208 libdbus \ 209 libcrypto \ 210 libcurl \ 211 libmetrics \ 212 libshill-client \ 213 libssl \ 214 libexpat \ 215 libbrillo-policy \ 216 libhardware \ 217 libcutils 218LOCAL_SRC_FILES := \ 219 main.cc 220LOCAL_INIT_RC := update_engine.rc 221$(eval $(update_engine_common)) 222include $(BUILD_EXECUTABLE) 223 224# update_engine_client (type: executable) 225# ======================================================== 226# update_engine console client. 227include $(CLEAR_VARS) 228LOCAL_MODULE := update_engine_client 229LOCAL_MODULE_CLASS := EXECUTABLES 230LOCAL_C_INCLUDES += \ 231 $(LOCAL_PATH)/include 232LOCAL_STATIC_LIBRARIES += \ 233 update_engine_client-dbus-proxies 234LOCAL_SRC_FILES := \ 235 update_engine_client.cc 236$(eval $(update_engine_common)) 237include $(BUILD_EXECUTABLE) 238 239# libpayload_generator (type: static_library) 240# ======================================================== 241# server-side code. This is used for delta_generator and unittests but not 242# for any client code. 243include $(CLEAR_VARS) 244LOCAL_MODULE := libpayload_generator 245LOCAL_MODULE_CLASS := STATIC_LIBRARIES 246LOCAL_STATIC_LIBRARIES += \ 247 libupdate_engine \ 248 libbz \ 249 libfs_mgr \ 250 update_metadata-protos \ 251 update_engine-dbus-adaptor \ 252 update_engine-dbus-libcros-client \ 253 update_engine_client-dbus-proxies \ 254 libxz \ 255 update_metadata-protos 256LOCAL_SHARED_LIBRARIES += \ 257 libdbus \ 258 libcrypto \ 259 libcurl \ 260 libmetrics \ 261 libshill-client \ 262 libssl \ 263 libexpat \ 264 libbrillo-policy \ 265 libhardware \ 266 libcutils \ 267 libprotobuf-cpp-lite-rtti \ 268 libext2fs 269LOCAL_SRC_FILES := \ 270 payload_generator/ab_generator.cc \ 271 payload_generator/annotated_operation.cc \ 272 payload_generator/blob_file_writer.cc \ 273 payload_generator/block_mapping.cc \ 274 payload_generator/bzip.cc \ 275 payload_generator/cycle_breaker.cc \ 276 payload_generator/delta_diff_generator.cc \ 277 payload_generator/delta_diff_utils.cc \ 278 payload_generator/ext2_filesystem.cc \ 279 payload_generator/extent_ranges.cc \ 280 payload_generator/extent_utils.cc \ 281 payload_generator/full_update_generator.cc \ 282 payload_generator/graph_types.cc \ 283 payload_generator/graph_utils.cc \ 284 payload_generator/inplace_generator.cc \ 285 payload_generator/payload_file.cc \ 286 payload_generator/payload_generation_config.cc \ 287 payload_generator/payload_signer.cc \ 288 payload_generator/raw_filesystem.cc \ 289 payload_generator/tarjan.cc \ 290 payload_generator/topological_sort.cc 291$(eval $(update_engine_common)) 292include $(BUILD_STATIC_LIBRARY) 293 294# delta_generator (type: executable) 295# ======================================================== 296# server-side delta generator. 297include $(CLEAR_VARS) 298LOCAL_MODULE := delta_generator 299LOCAL_MODULE_CLASS := EXECUTABLES 300LOCAL_STATIC_LIBRARIES += \ 301 libpayload_generator \ 302 libupdate_engine \ 303 libbz \ 304 libfs_mgr \ 305 update_metadata-protos \ 306 update_engine-dbus-adaptor \ 307 update_engine-dbus-libcros-client \ 308 update_engine_client-dbus-proxies \ 309 libxz 310LOCAL_SHARED_LIBRARIES += \ 311 libdbus \ 312 libcrypto \ 313 libcurl \ 314 libmetrics \ 315 libshill-client \ 316 libssl \ 317 libexpat \ 318 libbrillo-policy \ 319 libhardware \ 320 libcutils \ 321 libprotobuf-cpp-lite-rtti \ 322 libext2fs 323LOCAL_SRC_FILES := \ 324 payload_generator/generate_delta_main.cc 325$(eval $(update_engine_common)) 326include $(BUILD_EXECUTABLE) 327 328# update_engine_client-dbus-proxies (from generate-dbus-proxies.gypi) 329# ======================================================== 330include $(CLEAR_VARS) 331LOCAL_MODULE := update_engine_client-dbus-proxies 332LOCAL_SRC_FILES := \ 333 dbus_bindings/dbus-service-config.json \ 334 dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml 335LOCAL_DBUS_PROXY_PREFIX := update_engine 336include $(BUILD_STATIC_LIBRARY) 337 338# libupdate_engine_client 339# ======================================================== 340include $(CLEAR_VARS) 341LOCAL_MODULE := libupdate_engine_client 342LOCAL_RTTI_FLAG := -frtti 343LOCAL_CFLAGS := \ 344 -Wall \ 345 -Werror \ 346 -Wno-unused-parameter 347LOCAL_CLANG := true 348LOCAL_CPP_EXTENSION := .cc 349LOCAL_C_INCLUDES := \ 350 $(LOCAL_PATH)/client_library/include \ 351 external/cros/system_api/dbus \ 352 system \ 353 external/gtest/include 354LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/client_library/include 355LOCAL_SHARED_LIBRARIES := \ 356 libchrome \ 357 libchrome-dbus \ 358 libbrillo \ 359 libbrillo-dbus 360LOCAL_STATIC_LIBRARIES := \ 361 update_engine_client-dbus-proxies 362LOCAL_SRC_FILES := \ 363 client_library/client.cc \ 364 client_library/client_impl.cc \ 365 update_status_utils.cc 366include $(BUILD_SHARED_LIBRARY) 367 368 369# Update payload signing public key. 370# ======================================================== 371include $(CLEAR_VARS) 372LOCAL_MODULE := brillo-update-payload-key 373LOCAL_MODULE_CLASS := ETC 374LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/update_engine 375LOCAL_MODULE_STEM := update-payload-key.pub.pem 376LOCAL_SRC_FILES := update_payload_key/brillo-update-payload-key.pub.pem 377LOCAL_BUILT_MODULE_STEM := update_payload_key/brillo-update-payload-key.pub.pem 378include $(BUILD_PREBUILT) 379