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