blob: 77bb4200f05ab7fae50415b747fdcb46fb180e92 [file] [log] [blame]
Alex Deymod5561a52015-09-03 23:17:52 -07001#
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
Alex Deymo78a954f2016-01-21 20:32:40 -080019# 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.
22local_use_binder := $(if $(BRILLO_USE_BINDER),$(BRILLO_USE_BINDER),1)
Alex Deymoe97b39c2016-01-20 13:22:17 -080023local_use_dbus := $(if $(BRILLO_USE_DBUS),$(BRILLO_USE_DBUS),0)
Alex Deymo78a954f2016-01-21 20:32:40 -080024local_use_hwid_override := \
25 $(if $(BRILLO_USE_HWID_OVERRIDE),$(BRILLO_USE_HWID_OVERRIDE),0)
Alex Deymo0cd976d2016-02-11 18:45:01 -080026# "libcros" gates the LibCrosService exposed by the Chrome OS' chrome browser to
27# the system layer.
28local_use_libcros := $(if $(BRILLO_USE_LIBCROS),$(BRILLO_USE_LIBCROS),0)
Alex Deymo78a954f2016-01-21 20:32:40 -080029local_use_mtd := $(if $(BRILLO_USE_MTD),$(BRILLO_USE_MTD),0)
30local_use_power_management := \
31 $(if $(BRILLO_USE_POWER_MANAGEMENT),$(BRILLO_USE_POWER_MANAGEMENT),0)
32local_use_weave := $(if $(BRILLO_USE_WEAVE),$(BRILLO_USE_WEAVE),0)
Alex Deymo787dc412015-10-29 11:39:20 -070033
Alex Deymoc372ab62015-10-29 00:43:26 -070034ue_common_cflags := \
Alex Deymo78a954f2016-01-21 20:32:40 -080035 -DUSE_BINDER=$(local_use_binder) \
36 -DUSE_DBUS=$(local_use_dbus) \
37 -DUSE_HWID_OVERRIDE=$(local_use_hwid_override) \
Alex Deymo0cd976d2016-02-11 18:45:01 -080038 -DUSE_LIBCROS=$(local_use_libcros) \
Alex Deymo78a954f2016-01-21 20:32:40 -080039 -DUSE_MTD=$(local_use_mtd) \
40 -DUSE_POWER_MANAGEMENT=$(local_use_power_management) \
41 -DUSE_WEAVE=$(local_use_weave) \
Alex Deymoc372ab62015-10-29 00:43:26 -070042 -D_FILE_OFFSET_BITS=64 \
43 -D_POSIX_C_SOURCE=199309L \
44 -Wa,--noexecstack \
45 -Wall \
46 -Werror \
47 -Wextra \
48 -Wformat=2 \
49 -Wno-psabi \
50 -Wno-unused-parameter \
51 -ffunction-sections \
52 -fstack-protector-strong \
53 -fvisibility=hidden
54ue_common_cppflags := \
55 -Wnon-virtual-dtor \
56 -fno-strict-aliasing \
57 -std=gnu++11
58ue_common_ldflags := \
59 -Wl,--gc-sections
60ue_common_c_includes := \
61 $(LOCAL_PATH)/client_library/include \
62 external/gtest/include \
63 system
64ue_common_shared_libraries := \
65 libbrillo \
Alex Deymoc372ab62015-10-29 00:43:26 -070066 libbrillo-http \
67 libbrillo-stream \
Alex Deymo4218b7e2015-11-17 21:14:42 -030068 libchrome
Alex Deymod5561a52015-09-03 23:17:52 -070069
Alex Deymo78a954f2016-01-21 20:32:40 -080070ifeq ($(local_use_dbus),1)
Alex Deymoc372ab62015-10-29 00:43:26 -070071
72# update_engine_client-dbus-proxies (from generate-dbus-proxies.gypi)
73# ========================================================
74include $(CLEAR_VARS)
75LOCAL_MODULE := update_engine_client-dbus-proxies
76LOCAL_MODULE_CLASS := STATIC_LIBRARIES
77LOCAL_SRC_FILES := \
78 dbus_bindings/dbus-service-config.json \
79 dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml
80LOCAL_DBUS_PROXY_PREFIX := update_engine
81include $(BUILD_STATIC_LIBRARY)
Alex Deymod5561a52015-09-03 23:17:52 -070082
Alex Deymo78a954f2016-01-21 20:32:40 -080083endif # local_use_dbus == 1
Alex Deymo4218b7e2015-11-17 21:14:42 -030084
Alex Deymod5561a52015-09-03 23:17:52 -070085# update_metadata-protos (type: static_library)
86# ========================================================
87# Protobufs.
Alex Deymoc372ab62015-10-29 00:43:26 -070088ue_update_metadata_protos_exported_static_libraries := \
89 update_metadata-protos
90ue_update_metadata_protos_exported_shared_libraries := \
Alex Vakulenkoab5bd662015-12-21 12:24:45 -080091 libprotobuf-cpp-lite
Alex Deymoc372ab62015-10-29 00:43:26 -070092
Alex Deymo05e0e382015-12-07 20:18:16 -080093ue_update_metadata_protos_src_files := \
94 update_metadata.proto
95
96# Build for the host.
Alex Deymod5561a52015-09-03 23:17:52 -070097include $(CLEAR_VARS)
98LOCAL_MODULE := update_metadata-protos
99LOCAL_MODULE_CLASS := STATIC_LIBRARIES
Ying Wangdbd17112015-12-17 11:59:09 -0800100LOCAL_IS_HOST_MODULE := true
Alex Deymod5561a52015-09-03 23:17:52 -0700101generated_sources_dir := $(call local-generated-sources-dir)
Alex Deymoc372ab62015-10-29 00:43:26 -0700102LOCAL_EXPORT_C_INCLUDE_DIRS := $(generated_sources_dir)/proto/system
Alex Deymo05e0e382015-12-07 20:18:16 -0800103LOCAL_SRC_FILES := $(ue_update_metadata_protos_src_files)
104include $(BUILD_HOST_STATIC_LIBRARY)
105
106# Build for the target.
107include $(CLEAR_VARS)
108LOCAL_MODULE := update_metadata-protos
109LOCAL_MODULE_CLASS := STATIC_LIBRARIES
110generated_sources_dir := $(call local-generated-sources-dir)
111LOCAL_EXPORT_C_INCLUDE_DIRS := $(generated_sources_dir)/proto/system
112LOCAL_SRC_FILES := $(ue_update_metadata_protos_src_files)
Alex Deymod5561a52015-09-03 23:17:52 -0700113include $(BUILD_STATIC_LIBRARY)
114
Alex Deymo78a954f2016-01-21 20:32:40 -0800115ifeq ($(local_use_dbus),1)
Alex Deymo4218b7e2015-11-17 21:14:42 -0300116
Alex Deymod5561a52015-09-03 23:17:52 -0700117# update_engine-dbus-adaptor (from generate-dbus-adaptors.gypi)
118# ========================================================
Alex Deymoc372ab62015-10-29 00:43:26 -0700119# Chrome D-Bus bindings.
Alex Deymod5561a52015-09-03 23:17:52 -0700120include $(CLEAR_VARS)
121LOCAL_MODULE := update_engine-dbus-adaptor
Alex Deymoc372ab62015-10-29 00:43:26 -0700122LOCAL_MODULE_CLASS := STATIC_LIBRARIES
Alex Deymod5561a52015-09-03 23:17:52 -0700123LOCAL_SRC_FILES := \
124 dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml
125include $(BUILD_STATIC_LIBRARY)
126
127# update_engine-dbus-libcros-client (from generate-dbus-proxies.gypi)
128# ========================================================
129include $(CLEAR_VARS)
130LOCAL_MODULE := update_engine-dbus-libcros-client
Alex Deymoc372ab62015-10-29 00:43:26 -0700131LOCAL_MODULE_CLASS := STATIC_LIBRARIES
Alex Deymod5561a52015-09-03 23:17:52 -0700132LOCAL_SRC_FILES := \
133 dbus_bindings/org.chromium.LibCrosService.dbus-xml
134LOCAL_DBUS_PROXY_PREFIX := libcros
135include $(BUILD_STATIC_LIBRARY)
136
Alex Deymo78a954f2016-01-21 20:32:40 -0800137endif # local_use_dbus == 1
Alex Deymo4218b7e2015-11-17 21:14:42 -0300138
Alex Deymo39910dc2015-11-09 17:04:30 -0800139# libpayload_consumer (type: static_library)
Alex Deymod5561a52015-09-03 23:17:52 -0700140# ========================================================
Alex Deymo39910dc2015-11-09 17:04:30 -0800141# The payload application component and common dependencies.
Alex Deymo39910dc2015-11-09 17:04:30 -0800142ue_libpayload_consumer_exported_static_libraries := \
143 update_metadata-protos \
Alex Deymo05e0e382015-12-07 20:18:16 -0800144 libxz-host \
Alex Deymo39910dc2015-11-09 17:04:30 -0800145 libbz \
Sen Jiangbc3e6b02016-01-19 18:39:26 +0800146 libimgpatch \
147 libz \
Alex Deymo39910dc2015-11-09 17:04:30 -0800148 $(ue_update_metadata_protos_exported_static_libraries)
149ue_libpayload_consumer_exported_shared_libraries := \
Alex Deymo05e0e382015-12-07 20:18:16 -0800150 libcrypto-host \
151 libcurl-host \
152 libssl-host \
Alex Deymo39910dc2015-11-09 17:04:30 -0800153 $(ue_update_metadata_protos_exported_shared_libraries)
154
Alex Deymo05e0e382015-12-07 20:18:16 -0800155ue_libpayload_consumer_src_files := \
Alex Deymo39910dc2015-11-09 17:04:30 -0800156 common/action_processor.cc \
Alex Deymo39910dc2015-11-09 17:04:30 -0800157 common/boot_control_stub.cc \
158 common/certificate_checker.cc \
159 common/clock.cc \
160 common/constants.cc \
Alex Deymoab0d9762016-02-02 10:52:56 -0800161 common/cpu_limiter.cc \
Alex Deymoe88e9fe2016-02-03 16:38:00 -0800162 common/error_code_utils.cc \
Alex Deymo39910dc2015-11-09 17:04:30 -0800163 common/hash_calculator.cc \
164 common/http_common.cc \
165 common/http_fetcher.cc \
166 common/hwid_override.cc \
167 common/libcurl_http_fetcher.cc \
168 common/multi_range_http_fetcher.cc \
169 common/platform_constants_android.cc \
170 common/prefs.cc \
171 common/subprocess.cc \
172 common/terminator.cc \
173 common/utils.cc \
174 payload_consumer/bzip_extent_writer.cc \
175 payload_consumer/delta_performer.cc \
176 payload_consumer/download_action.cc \
177 payload_consumer/extent_writer.cc \
178 payload_consumer/file_descriptor.cc \
179 payload_consumer/file_writer.cc \
180 payload_consumer/filesystem_verifier_action.cc \
181 payload_consumer/install_plan.cc \
182 payload_consumer/payload_constants.cc \
183 payload_consumer/payload_verifier.cc \
184 payload_consumer/postinstall_runner_action.cc \
185 payload_consumer/xz_extent_writer.cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800186
187ifeq ($(HOST_OS),linux)
188# Build for the host.
189include $(CLEAR_VARS)
190LOCAL_MODULE := libpayload_consumer
191LOCAL_MODULE_CLASS := STATIC_LIBRARIES
192LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800193LOCAL_CLANG := true
194LOCAL_CFLAGS := $(ue_common_cflags)
195LOCAL_CPPFLAGS := $(ue_common_cppflags)
196LOCAL_LDFLAGS := $(ue_common_ldflags)
197LOCAL_C_INCLUDES := \
Sen Jiangdcbc0ae2016-03-18 15:33:19 -0700198 $(ue_common_c_includes)
Alex Deymo05e0e382015-12-07 20:18:16 -0800199LOCAL_STATIC_LIBRARIES := \
200 update_metadata-protos \
201 $(ue_libpayload_consumer_exported_static_libraries) \
202 $(ue_update_metadata_protos_exported_static_libraries)
203LOCAL_SHARED_LIBRARIES := \
204 $(ue_common_shared_libraries) \
205 $(ue_libpayload_consumer_exported_shared_libraries) \
206 $(ue_update_metadata_protos_exported_shared_libraries)
207LOCAL_SRC_FILES := $(ue_libpayload_consumer_src_files)
208include $(BUILD_HOST_STATIC_LIBRARY)
209endif # HOST_OS == linux
210
211# Build for the target.
212include $(CLEAR_VARS)
213LOCAL_MODULE := libpayload_consumer
214LOCAL_MODULE_CLASS := STATIC_LIBRARIES
215LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800216LOCAL_CLANG := true
217LOCAL_CFLAGS := $(ue_common_cflags)
218LOCAL_CPPFLAGS := $(ue_common_cppflags)
219LOCAL_LDFLAGS := $(ue_common_ldflags)
220LOCAL_C_INCLUDES := \
Sen Jiangdcbc0ae2016-03-18 15:33:19 -0700221 $(ue_common_c_includes)
Alex Deymo05e0e382015-12-07 20:18:16 -0800222LOCAL_STATIC_LIBRARIES := \
223 update_metadata-protos \
224 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
225 $(ue_update_metadata_protos_exported_static_libraries)
226LOCAL_SHARED_LIBRARIES := \
227 $(ue_common_shared_libraries) \
228 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
229 $(ue_update_metadata_protos_exported_shared_libraries)
230LOCAL_SRC_FILES := $(ue_libpayload_consumer_src_files)
Alex Deymo39910dc2015-11-09 17:04:30 -0800231include $(BUILD_STATIC_LIBRARY)
232
Alex Deymofa78f142016-01-26 21:36:16 -0800233ifdef BRILLO
Alex Deymo4218b7e2015-11-17 21:14:42 -0300234
Alex Deymo39910dc2015-11-09 17:04:30 -0800235# libupdate_engine (type: static_library)
236# ========================================================
237# The main daemon static_library with all the code used to check for updates
238# with Omaha and expose a DBus daemon.
239ue_libupdate_engine_exported_c_includes := \
240 $(LOCAL_PATH)/include \
Alex Deymob09305e2015-12-02 16:09:13 -0300241 external/cros/system_api/dbus
Alex Deymoc372ab62015-10-29 00:43:26 -0700242ue_libupdate_engine_exported_static_libraries := \
Alex Deymo39910dc2015-11-09 17:04:30 -0800243 libpayload_consumer \
Alex Deymod5561a52015-09-03 23:17:52 -0700244 update_metadata-protos \
245 update_engine-dbus-adaptor \
246 update_engine-dbus-libcros-client \
247 update_engine_client-dbus-proxies \
David Zeuthen753fadc2015-09-15 16:34:09 -0400248 libbz \
Alex Deymoc372ab62015-10-29 00:43:26 -0700249 libfs_mgr \
Alex Deymo39910dc2015-11-09 17:04:30 -0800250 $(ue_libpayload_consumer_exported_static_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700251 $(ue_update_metadata_protos_exported_static_libraries)
252ue_libupdate_engine_exported_shared_libraries := \
Alex Deymod5561a52015-09-03 23:17:52 -0700253 libdbus \
Alex Deymo05e0e382015-12-07 20:18:16 -0800254 libbrillo-dbus \
255 libchrome-dbus \
Alex Deymod5561a52015-09-03 23:17:52 -0700256 libmetrics \
Alex Deymo7eb23052015-10-09 15:27:59 -0700257 libshill-client \
Alex Deymod5561a52015-09-03 23:17:52 -0700258 libexpat \
Alex Vakulenko1bab5a82015-10-27 11:47:28 -0700259 libbrillo-policy \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700260 libhardware \
Alex Deymoc372ab62015-10-29 00:43:26 -0700261 libcutils \
Alex Deymo39910dc2015-11-09 17:04:30 -0800262 $(ue_libpayload_consumer_exported_shared_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700263 $(ue_update_metadata_protos_exported_shared_libraries)
Alex Deymoc0037902016-01-23 17:29:02 -0800264ifeq ($(local_use_binder),1)
265ue_libupdate_engine_exported_shared_libraries += \
266 libbinder \
267 libbinderwrapper \
268 libbrillo-binder \
269 libutils
270endif # local_use_binder == 1
Alex Deymo78a954f2016-01-21 20:32:40 -0800271ifeq ($(local_use_weave),1)
Alex Deymof7ead812015-10-23 17:37:27 -0700272ue_libupdate_engine_exported_shared_libraries += \
Alex Deymo7ff02cf2016-01-22 11:06:51 -0800273 libbinderwrapper \
274 libbrillo-binder \
Alex Deymof7ead812015-10-23 17:37:27 -0700275 libweaved
Alex Deymo78a954f2016-01-21 20:32:40 -0800276endif # local_use_weave == 1
Alex Deymoc372ab62015-10-29 00:43:26 -0700277
278include $(CLEAR_VARS)
279LOCAL_MODULE := libupdate_engine
280LOCAL_MODULE_CLASS := STATIC_LIBRARIES
281LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700282LOCAL_CLANG := true
283LOCAL_EXPORT_C_INCLUDE_DIRS := $(ue_libupdate_engine_exported_c_includes)
284LOCAL_CFLAGS := $(ue_common_cflags)
285LOCAL_CPPFLAGS := $(ue_common_cppflags)
286LOCAL_LDFLAGS := $(ue_common_ldflags)
287LOCAL_C_INCLUDES := \
288 $(ue_common_c_includes) \
Alex Deymob09305e2015-12-02 16:09:13 -0300289 $(ue_libupdate_engine_exported_c_includes)
Alex Deymoc372ab62015-10-29 00:43:26 -0700290LOCAL_STATIC_LIBRARIES := \
Alex Deymo39910dc2015-11-09 17:04:30 -0800291 libpayload_consumer \
Alex Deymoc372ab62015-10-29 00:43:26 -0700292 update_metadata-protos \
293 update_engine-dbus-adaptor \
294 update_engine-dbus-libcros-client \
295 update_engine_client-dbus-proxies \
Alex Deymo05e0e382015-12-07 20:18:16 -0800296 $(ue_libupdate_engine_exported_static_libraries:-host=) \
297 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700298 $(ue_update_metadata_protos_exported_static_libraries)
299LOCAL_SHARED_LIBRARIES := \
300 $(ue_common_shared_libraries) \
Alex Deymo05e0e382015-12-07 20:18:16 -0800301 $(ue_libupdate_engine_exported_shared_libraries:-host=) \
302 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700303 $(ue_update_metadata_protos_exported_shared_libraries)
Alex Deymod5561a52015-09-03 23:17:52 -0700304LOCAL_SRC_FILES := \
Alex Deymo1b03f9f2015-12-09 00:38:36 -0800305 boot_control_android.cc \
Alex Deymo78a954f2016-01-21 20:32:40 -0800306 common_service.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700307 connection_manager.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700308 daemon.cc \
309 dbus_service.cc \
Alex Deymo1b03f9f2015-12-09 00:38:36 -0800310 hardware_android.cc \
Alex Deymo85616652015-10-15 18:48:31 -0700311 image_properties_android.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700312 libcros_proxy.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700313 metrics.cc \
Alex Deymo38429cf2015-11-11 18:27:22 -0800314 metrics_utils.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700315 omaha_request_action.cc \
316 omaha_request_params.cc \
317 omaha_response_handler_action.cc \
318 p2p_manager.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700319 payload_state.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700320 proxy_resolver.cc \
321 real_system_state.cc \
322 shill_proxy.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700323 update_attempter.cc \
324 update_manager/boxed_value.cc \
325 update_manager/chromeos_policy.cc \
326 update_manager/default_policy.cc \
327 update_manager/evaluation_context.cc \
328 update_manager/policy.cc \
329 update_manager/real_config_provider.cc \
330 update_manager/real_device_policy_provider.cc \
331 update_manager/real_random_provider.cc \
332 update_manager/real_shill_provider.cc \
333 update_manager/real_system_provider.cc \
334 update_manager/real_time_provider.cc \
335 update_manager/real_updater_provider.cc \
336 update_manager/state_factory.cc \
337 update_manager/update_manager.cc \
Alex Deymof7ead812015-10-23 17:37:27 -0700338 update_status_utils.cc \
339 weave_service_factory.cc
Alex Deymo78a954f2016-01-21 20:32:40 -0800340ifeq ($(local_use_binder),1)
Casey Dahlina93cd532016-01-14 16:55:11 -0800341LOCAL_AIDL_INCLUDES += $(LOCAL_PATH)/binder_bindings
Casey Dahlina93cd532016-01-14 16:55:11 -0800342LOCAL_SRC_FILES += \
343 binder_bindings/android/brillo/IUpdateEngine.aidl \
344 binder_bindings/android/brillo/IUpdateEngineStatusCallback.aidl \
Alex Deymofa78f142016-01-26 21:36:16 -0800345 binder_service_brillo.cc \
Casey Dahlina93cd532016-01-14 16:55:11 -0800346 parcelable_update_engine_status.cc
Alex Deymo78a954f2016-01-21 20:32:40 -0800347endif # local_use_binder == 1
Alex Deymoaabd81e2016-01-26 20:03:08 -0800348ifeq ($(local_use_weave),1)
349LOCAL_SRC_FILES += \
350 weave_service.cc
351endif # local_use_weave == 1
Alex Deymo0cd976d2016-02-11 18:45:01 -0800352ifeq ($(local_use_libcros),1)
353LOCAL_SRC_FILES += \
354 chrome_browser_proxy_resolver.cc
355endif # local_use_libcros == 1
Alex Deymod5561a52015-09-03 23:17:52 -0700356include $(BUILD_STATIC_LIBRARY)
357
Alex Deymofa78f142016-01-26 21:36:16 -0800358else # !defined(BRILLO)
359
360ifneq ($(local_use_binder),1)
361$(error USE_BINDER is disabled but is required in non-Brillo devices.)
362endif # local_use_binder == 1
363
364# libupdate_engine_android (type: static_library)
365# ========================================================
366# The main daemon static_library used in Android (non-Brillo). This only has a
367# loop to apply payloads provided by the upper layer via a Binder interface.
368ue_libupdate_engine_android_exported_static_libraries := \
369 libpayload_consumer \
Alex Deymo5e3ea272016-01-28 13:42:23 -0800370 libfs_mgr \
Alex Deymofa78f142016-01-26 21:36:16 -0800371 $(ue_libpayload_consumer_exported_static_libraries)
372ue_libupdate_engine_android_exported_shared_libraries := \
373 $(ue_libpayload_consumer_exported_shared_libraries) \
374 libbinder \
375 libbinderwrapper \
376 libbrillo-binder \
Alex Deymo5e3ea272016-01-28 13:42:23 -0800377 libcutils \
378 libhardware \
Alex Deymofa78f142016-01-26 21:36:16 -0800379 libutils
380
381include $(CLEAR_VARS)
382LOCAL_MODULE := libupdate_engine_android
383LOCAL_MODULE_CLASS := STATIC_LIBRARIES
384LOCAL_CPP_EXTENSION := .cc
385LOCAL_CLANG := true
386LOCAL_CFLAGS := $(ue_common_cflags)
387LOCAL_CPPFLAGS := $(ue_common_cppflags)
388LOCAL_LDFLAGS := $(ue_common_ldflags)
389LOCAL_C_INCLUDES := $(ue_common_c_includes)
Alex Deymo3b678db2016-02-09 11:50:06 -0800390#TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
391# out of the DBus interface.
392LOCAL_C_INCLUDES += \
393 external/cros/system_api/dbus
Alex Deymofa78f142016-01-26 21:36:16 -0800394LOCAL_STATIC_LIBRARIES := \
395 $(ue_libupdate_engine_android_exported_static_libraries:-host=)
396LOCAL_SHARED_LIBRARIES += \
397 $(ue_common_shared_libraries) \
398 $(ue_libupdate_engine_android_exported_shared_libraries:-host=)
399LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder_bindings
400LOCAL_SRC_FILES += \
401 binder_bindings/android/os/IUpdateEngine.aidl \
402 binder_bindings/android/os/IUpdateEngineCallback.aidl \
403 binder_service_android.cc \
Alex Deymo5e3ea272016-01-28 13:42:23 -0800404 boot_control_android.cc \
Alex Deymofa78f142016-01-26 21:36:16 -0800405 daemon.cc \
Alex Deymo5e3ea272016-01-28 13:42:23 -0800406 daemon_state_android.cc \
407 hardware_android.cc \
408 proxy_resolver.cc \
Alex Deymo3b678db2016-02-09 11:50:06 -0800409 update_attempter_android.cc \
410 update_status_utils.cc
Alex Deymofa78f142016-01-26 21:36:16 -0800411include $(BUILD_STATIC_LIBRARY)
412
413endif # !defined(BRILLO)
Alex Deymo4218b7e2015-11-17 21:14:42 -0300414
Alex Deymod5561a52015-09-03 23:17:52 -0700415# update_engine (type: executable)
416# ========================================================
417# update_engine daemon.
418include $(CLEAR_VARS)
419LOCAL_MODULE := update_engine
420LOCAL_MODULE_CLASS := EXECUTABLES
Sen Jiang56092772015-11-23 14:41:00 -0800421LOCAL_REQUIRED_MODULES := \
Alex Deymoab494462015-11-30 17:07:36 -0300422 bspatch \
423 cacerts_google
Alex Deymo78a954f2016-01-21 20:32:40 -0800424ifeq ($(local_use_weave),1)
Alex Deymof7ead812015-10-23 17:37:27 -0700425LOCAL_REQUIRED_MODULES += updater.json
Alex Deymo78a954f2016-01-21 20:32:40 -0800426endif # local_use_weave == 1
Alex Deymoc372ab62015-10-29 00:43:26 -0700427LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700428LOCAL_CLANG := true
429LOCAL_CFLAGS := $(ue_common_cflags)
430LOCAL_CPPFLAGS := $(ue_common_cppflags)
431LOCAL_LDFLAGS := $(ue_common_ldflags)
432LOCAL_C_INCLUDES := \
Alex Deymo4218b7e2015-11-17 21:14:42 -0300433 $(ue_common_c_includes)
Alex Deymoe97b39c2016-01-20 13:22:17 -0800434LOCAL_SHARED_LIBRARIES := \
435 $(ue_common_shared_libraries)
436LOCAL_SRC_FILES := \
437 main.cc
Alex Deymo4218b7e2015-11-17 21:14:42 -0300438
439ifdef BRILLO
Alex Deymo4218b7e2015-11-17 21:14:42 -0300440LOCAL_C_INCLUDES += \
Alex Deymoc372ab62015-10-29 00:43:26 -0700441 $(ue_libupdate_engine_exported_c_includes)
442LOCAL_STATIC_LIBRARIES := \
Alex Deymod5561a52015-09-03 23:17:52 -0700443 libupdate_engine \
Alex Deymo05e0e382015-12-07 20:18:16 -0800444 $(ue_libupdate_engine_exported_static_libraries:-host=)
Alex Deymoe97b39c2016-01-20 13:22:17 -0800445LOCAL_SHARED_LIBRARIES += \
Alex Deymo05e0e382015-12-07 20:18:16 -0800446 $(ue_libupdate_engine_exported_shared_libraries:-host=)
Christopher Wiley9e1eda92015-11-16 15:23:37 -0800447else # !defined(BRILLO)
Alex Deymoe97b39c2016-01-20 13:22:17 -0800448LOCAL_STATIC_LIBRARIES := \
Alex Deymofa78f142016-01-26 21:36:16 -0800449 libupdate_engine_android \
450 $(ue_libupdate_engine_android_exported_static_libraries:-host=)
Alex Deymoe97b39c2016-01-20 13:22:17 -0800451LOCAL_SHARED_LIBRARIES += \
Alex Deymofa78f142016-01-26 21:36:16 -0800452 $(ue_libupdate_engine_android_exported_shared_libraries:-host=)
453endif # !defined(BRILLO)
Casey Dahlina93cd532016-01-14 16:55:11 -0800454
Gilad Arnold70141f22015-09-17 09:06:30 -0700455LOCAL_INIT_RC := update_engine.rc
Alex Deymod5561a52015-09-03 23:17:52 -0700456include $(BUILD_EXECUTABLE)
457
Alex Deymoa96ddc12016-02-10 15:59:03 -0800458# libupdate_engine_client (type: shared_library)
459# ========================================================
460include $(CLEAR_VARS)
461LOCAL_MODULE := libupdate_engine_client
462LOCAL_CFLAGS := \
463 -Wall \
464 -Werror \
465 -Wno-unused-parameter \
466 -DUSE_DBUS=$(local_use_dbus) \
467 -DUSE_BINDER=$(local_use_binder)
468LOCAL_CLANG := true
469LOCAL_CPP_EXTENSION := .cc
470# TODO(deymo): Remove "external/cros/system_api/dbus" when dbus is not used.
471LOCAL_C_INCLUDES := \
472 $(LOCAL_PATH)/client_library/include \
473 external/cros/system_api/dbus \
474 system \
475 external/gtest/include
476LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/client_library/include
477LOCAL_SHARED_LIBRARIES := \
478 libchrome \
479 libbrillo
480LOCAL_SRC_FILES := \
481 client_library/client.cc \
482 update_status_utils.cc
483
484# We can only compile support for one IPC mechanism. If both "binder" and "dbus"
485# are defined, we prefer binder.
486ifeq ($(local_use_binder),1)
487LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder_bindings
488LOCAL_SHARED_LIBRARIES += \
489 libbinder \
490 libbrillo-binder \
491 libutils
492LOCAL_SRC_FILES += \
493 binder_bindings/android/brillo/IUpdateEngine.aidl \
494 binder_bindings/android/brillo/IUpdateEngineStatusCallback.aidl \
495 client_library/client_binder.cc \
496 parcelable_update_engine_status.cc
497else # local_use_binder != 1
498LOCAL_STATIC_LIBRARIES := \
499 update_engine_client-dbus-proxies
500LOCAL_SHARED_LIBRARIES += \
501 libchrome-dbus \
502 libbrillo-dbus
503LOCAL_SRC_FILES += \
504 client_library/client_dbus.cc
505endif # local_use_binder == 1
506
507include $(BUILD_SHARED_LIBRARY)
508
Alex Deymod5561a52015-09-03 23:17:52 -0700509# update_engine_client (type: executable)
510# ========================================================
511# update_engine console client.
512include $(CLEAR_VARS)
513LOCAL_MODULE := update_engine_client
514LOCAL_MODULE_CLASS := EXECUTABLES
Alex Deymoc372ab62015-10-29 00:43:26 -0700515LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700516LOCAL_CLANG := true
517LOCAL_CFLAGS := $(ue_common_cflags)
518LOCAL_CPPFLAGS := $(ue_common_cppflags)
519LOCAL_LDFLAGS := $(ue_common_ldflags)
Casey Dahlince90f442016-01-25 16:55:28 -0800520LOCAL_C_INCLUDES := $(ue_common_c_includes)
Alex Deymo5f528112016-01-27 23:32:36 -0800521LOCAL_SHARED_LIBRARIES := $(ue_common_shared_libraries)
522ifdef BRILLO
523LOCAL_SHARED_LIBRARIES += \
Casey Dahline844c1a2015-12-16 14:30:58 -0800524 libupdate_engine_client
Alex Deymod5561a52015-09-03 23:17:52 -0700525LOCAL_SRC_FILES := \
Shuqian Zhao29971732016-02-05 11:29:32 -0800526 update_engine_client.cc \
527 common/error_code_utils.cc
Alex Deymo5f528112016-01-27 23:32:36 -0800528else # !defined(BRILLO)
529#TODO(deymo): Remove external/cros/system_api/dbus once the strings are moved
530# out of the DBus interface.
531LOCAL_C_INCLUDES += \
532 external/cros/system_api/dbus
533LOCAL_SHARED_LIBRARIES += \
534 libbinder \
Alex Deymo2130ee02016-02-02 18:35:50 -0800535 libbinderwrapper \
Alex Deymo5f528112016-01-27 23:32:36 -0800536 libbrillo-binder \
537 libutils
538LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder_bindings
539LOCAL_SRC_FILES := \
540 binder_bindings/android/os/IUpdateEngine.aidl \
541 binder_bindings/android/os/IUpdateEngineCallback.aidl \
Alex Deymoe88e9fe2016-02-03 16:38:00 -0800542 common/error_code_utils.cc \
Alex Deymo5f528112016-01-27 23:32:36 -0800543 update_engine_client_android.cc \
544 update_status_utils.cc
545endif # !defined(BRILLO)
Alex Deymod5561a52015-09-03 23:17:52 -0700546include $(BUILD_EXECUTABLE)
547
548# libpayload_generator (type: static_library)
549# ========================================================
550# server-side code. This is used for delta_generator and unittests but not
551# for any client code.
Alex Deymoc372ab62015-10-29 00:43:26 -0700552ue_libpayload_generator_exported_static_libraries := \
Alex Deymob09305e2015-12-02 16:09:13 -0300553 libpayload_consumer \
Alex Deymoc372ab62015-10-29 00:43:26 -0700554 update_metadata-protos \
Alex Deymo246bf212016-03-22 19:27:33 -0700555 liblzma \
Alex Deymob09305e2015-12-02 16:09:13 -0300556 $(ue_libpayload_consumer_exported_static_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700557 $(ue_update_metadata_protos_exported_static_libraries)
558ue_libpayload_generator_exported_shared_libraries := \
Alex Deymo05e0e382015-12-07 20:18:16 -0800559 libext2fs-host \
Alex Deymob09305e2015-12-02 16:09:13 -0300560 $(ue_libpayload_consumer_exported_shared_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700561 $(ue_update_metadata_protos_exported_shared_libraries)
562
Alex Deymo05e0e382015-12-07 20:18:16 -0800563ue_libpayload_generator_src_files := \
Alex Deymod5561a52015-09-03 23:17:52 -0700564 payload_generator/ab_generator.cc \
565 payload_generator/annotated_operation.cc \
566 payload_generator/blob_file_writer.cc \
567 payload_generator/block_mapping.cc \
Alex Deymo0bc26112015-10-19 20:54:57 -0700568 payload_generator/bzip.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700569 payload_generator/cycle_breaker.cc \
570 payload_generator/delta_diff_generator.cc \
571 payload_generator/delta_diff_utils.cc \
572 payload_generator/ext2_filesystem.cc \
573 payload_generator/extent_ranges.cc \
574 payload_generator/extent_utils.cc \
575 payload_generator/full_update_generator.cc \
576 payload_generator/graph_types.cc \
577 payload_generator/graph_utils.cc \
578 payload_generator/inplace_generator.cc \
579 payload_generator/payload_file.cc \
580 payload_generator/payload_generation_config.cc \
581 payload_generator/payload_signer.cc \
582 payload_generator/raw_filesystem.cc \
583 payload_generator/tarjan.cc \
Alex Deymo246bf212016-03-22 19:27:33 -0700584 payload_generator/topological_sort.cc \
585 payload_generator/xz_android.cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800586
587ifeq ($(HOST_OS),linux)
588# Build for the host.
589include $(CLEAR_VARS)
590LOCAL_MODULE := libpayload_generator
591LOCAL_MODULE_CLASS := STATIC_LIBRARIES
592LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800593LOCAL_CLANG := true
594LOCAL_CFLAGS := $(ue_common_cflags)
595LOCAL_CPPFLAGS := $(ue_common_cppflags)
596LOCAL_LDFLAGS := $(ue_common_ldflags)
597LOCAL_C_INCLUDES := $(ue_common_c_includes)
598LOCAL_STATIC_LIBRARIES := \
599 libpayload_consumer \
600 update_metadata-protos \
Alex Deymo246bf212016-03-22 19:27:33 -0700601 liblzma \
Alex Deymo05e0e382015-12-07 20:18:16 -0800602 $(ue_libpayload_consumer_exported_static_libraries) \
603 $(ue_update_metadata_protos_exported_static_libraries)
604LOCAL_SHARED_LIBRARIES := \
605 $(ue_common_shared_libraries) \
606 $(ue_libpayload_generator_exported_shared_libraries) \
607 $(ue_libpayload_consumer_exported_shared_libraries) \
608 $(ue_update_metadata_protos_exported_shared_libraries)
609LOCAL_SRC_FILES := $(ue_libpayload_generator_src_files)
610include $(BUILD_HOST_STATIC_LIBRARY)
611endif # HOST_OS == linux
612
613# Build for the target.
614include $(CLEAR_VARS)
615LOCAL_MODULE := libpayload_generator
616LOCAL_MODULE_CLASS := STATIC_LIBRARIES
617LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800618LOCAL_CLANG := true
619LOCAL_CFLAGS := $(ue_common_cflags)
620LOCAL_CPPFLAGS := $(ue_common_cppflags)
621LOCAL_LDFLAGS := $(ue_common_ldflags)
622LOCAL_C_INCLUDES := $(ue_common_c_includes)
623LOCAL_STATIC_LIBRARIES := \
624 libpayload_consumer \
625 update_metadata-protos \
Alex Deymo246bf212016-03-22 19:27:33 -0700626 liblzma \
Alex Deymo05e0e382015-12-07 20:18:16 -0800627 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
628 $(ue_update_metadata_protos_exported_static_libraries)
629LOCAL_SHARED_LIBRARIES := \
630 $(ue_common_shared_libraries) \
631 $(ue_libpayload_generator_exported_shared_libraries:-host=) \
632 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
633 $(ue_update_metadata_protos_exported_shared_libraries)
634LOCAL_SRC_FILES := $(ue_libpayload_generator_src_files)
Alex Deymod5561a52015-09-03 23:17:52 -0700635include $(BUILD_STATIC_LIBRARY)
636
637# delta_generator (type: executable)
638# ========================================================
639# server-side delta generator.
Alex Deymo05e0e382015-12-07 20:18:16 -0800640ue_delta_generator_src_files := \
641 payload_generator/generate_delta_main.cc
642
643ifeq ($(HOST_OS),linux)
644# Build for the host.
Alex Deymod5561a52015-09-03 23:17:52 -0700645include $(CLEAR_VARS)
646LOCAL_MODULE := delta_generator
647LOCAL_MODULE_CLASS := EXECUTABLES
Alex Deymoc372ab62015-10-29 00:43:26 -0700648LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700649LOCAL_CLANG := true
650LOCAL_CFLAGS := $(ue_common_cflags)
651LOCAL_CPPFLAGS := $(ue_common_cppflags)
652LOCAL_LDFLAGS := $(ue_common_ldflags)
Alex Deymob09305e2015-12-02 16:09:13 -0300653LOCAL_C_INCLUDES := $(ue_common_c_includes)
Alex Deymoc372ab62015-10-29 00:43:26 -0700654LOCAL_STATIC_LIBRARIES := \
Alex Deymob09305e2015-12-02 16:09:13 -0300655 libpayload_consumer \
Alex Deymoc372ab62015-10-29 00:43:26 -0700656 libpayload_generator \
Alex Deymob09305e2015-12-02 16:09:13 -0300657 $(ue_libpayload_consumer_exported_static_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700658 $(ue_libpayload_generator_exported_static_libraries)
659LOCAL_SHARED_LIBRARIES := \
660 $(ue_common_shared_libraries) \
Alex Deymob09305e2015-12-02 16:09:13 -0300661 $(ue_libpayload_consumer_exported_shared_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700662 $(ue_libpayload_generator_exported_shared_libraries)
Alex Deymo05e0e382015-12-07 20:18:16 -0800663LOCAL_SRC_FILES := $(ue_delta_generator_src_files)
664include $(BUILD_HOST_EXECUTABLE)
665endif # HOST_OS == linux
666
667# Build for the target.
668include $(CLEAR_VARS)
Sen Jiang5a216c12016-03-30 13:08:24 -0700669LOCAL_MODULE := ue_unittest_delta_generator
670LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests
671LOCAL_MODULE_STEM := delta_generator
Alex Deymo05e0e382015-12-07 20:18:16 -0800672LOCAL_MODULE_CLASS := EXECUTABLES
673LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800674LOCAL_CLANG := true
675LOCAL_CFLAGS := $(ue_common_cflags)
676LOCAL_CPPFLAGS := $(ue_common_cppflags)
677LOCAL_LDFLAGS := $(ue_common_ldflags)
678LOCAL_C_INCLUDES := $(ue_common_c_includes)
679LOCAL_STATIC_LIBRARIES := \
680 libpayload_consumer \
681 libpayload_generator \
682 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
683 $(ue_libpayload_generator_exported_static_libraries:-host=)
684LOCAL_SHARED_LIBRARIES := \
685 $(ue_common_shared_libraries) \
686 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
687 $(ue_libpayload_generator_exported_shared_libraries:-host=)
688LOCAL_SRC_FILES := $(ue_delta_generator_src_files)
Alex Deymod5561a52015-09-03 23:17:52 -0700689include $(BUILD_EXECUTABLE)
690
Alex Deymo80f70ff2016-02-10 16:08:11 -0800691# TODO(deymo): Enable the unittest binaries in non-Brillo builds once the DBus
692# dependencies are removed or placed behind the USE_DBUS flag.
693ifdef BRILLO
694
Sen Jiang923886a2016-03-14 15:04:28 -0700695# Private and public keys for unittests.
696# ========================================================
697# Generate a module that installs a prebuilt private key and a module that
698# installs a public key generated from the private key.
699#
700# $(1): The path to the private key in pem format.
701define ue-unittest-keys
702 $(eval include $(CLEAR_VARS)) \
703 $(eval LOCAL_MODULE := ue_$(1).pem) \
704 $(eval LOCAL_MODULE_CLASS := ETC) \
705 $(eval $(ifeq $(BRILLO), 1, LOCAL_MODULE_TAGS := eng)) \
706 $(eval LOCAL_SRC_FILES := $(1).pem) \
707 $(eval LOCAL_MODULE_PATH := \
708 $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests) \
709 $(eval LOCAL_MODULE_STEM := $(1).pem) \
710 $(eval include $(BUILD_PREBUILT)) \
711 \
712 $(eval include $(CLEAR_VARS)) \
713 $(eval LOCAL_MODULE := ue_$(1).pub.pem) \
714 $(eval LOCAL_MODULE_CLASS := ETC) \
715 $(eval $(ifeq $(BRILLO), 1, LOCAL_MODULE_TAGS := eng)) \
716 $(eval LOCAL_MODULE_PATH := \
717 $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests) \
718 $(eval LOCAL_MODULE_STEM := $(1).pub.pem) \
719 $(eval include $(BUILD_SYSTEM)/base_rules.mk) \
720 $(eval $(LOCAL_BUILT_MODULE) : $(LOCAL_PATH)/$(1).pem ; \
721 openssl rsa -in $$< -pubout -out $$@)
722endef
723
724$(call ue-unittest-keys,unittest_key)
725$(call ue-unittest-keys,unittest_key2)
726
Alex Deymoc90be632016-02-17 19:25:20 -0800727# Sample images for unittests.
728# ========================================================
729# Generate a prebuilt module that installs a sample image from the compressed
730# sample_images.tar.bz2 file used by the unittests.
731#
732# $(1): The filename in the sample_images.tar.bz2
733define ue-unittest-sample-image
734 $(eval include $(CLEAR_VARS)) \
735 $(eval LOCAL_MODULE := ue_unittest_$(1)) \
736 $(eval LOCAL_MODULE_CLASS := EXECUTABLES) \
737 $(eval $(ifeq $(BRILLO), 1, LOCAL_MODULE_TAGS := eng)) \
738 $(eval LOCAL_MODULE_PATH := \
739 $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests/gen) \
740 $(eval LOCAL_MODULE_STEM := $(1)) \
Alex Deymoa3553e42016-03-04 18:55:05 -0800741 $(eval include $(BUILD_SYSTEM)/base_rules.mk) \
742 $(eval $(LOCAL_BUILT_MODULE) : \
743 $(LOCAL_PATH)/sample_images/sample_images.tar.bz2 ; \
744 tar -jxf $$< -C $$(dir $$@) $$(notdir $$@) && touch $$@)
Alex Deymoc90be632016-02-17 19:25:20 -0800745endef
746
747$(call ue-unittest-sample-image,disk_ext2_1k.img)
748$(call ue-unittest-sample-image,disk_ext2_4k.img)
749$(call ue-unittest-sample-image,disk_ext2_4k_empty.img)
Alex Deymod15c5462016-03-09 18:11:12 -0800750$(call ue-unittest-sample-image,disk_ext2_unittest.img)
Alex Deymoc90be632016-02-17 19:25:20 -0800751
Sen Jiange0d04282016-03-01 14:22:52 -0800752# Zlib Fingerprint
753# ========================================================
754include $(CLEAR_VARS)
755LOCAL_MODULE := zlib_fingerprint
756LOCAL_MODULE_CLASS := ETC
757LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests
758LOCAL_PREBUILT_MODULE_FILE := $(TARGET_OUT_COMMON_GEN)/zlib_fingerprint
759include $(BUILD_PREBUILT)
760
Sen Jiangee63c6e2016-03-30 14:01:02 -0700761# update_engine.conf
762# ========================================================
763include $(CLEAR_VARS)
764LOCAL_MODULE := ue_unittest_update_engine.conf
765LOCAL_MODULE_CLASS := ETC
766LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests
767LOCAL_MODULE_STEM := update_engine.conf
768LOCAL_SRC_FILES := update_engine.conf
769include $(BUILD_PREBUILT)
770
Alex Deymo80f70ff2016-02-10 16:08:11 -0800771# test_http_server (type: executable)
772# ========================================================
773# Test HTTP Server.
774include $(CLEAR_VARS)
775LOCAL_MODULE := test_http_server
776ifdef BRILLO
777 LOCAL_MODULE_TAGS := eng
778endif
Alex Deymodc873fa2016-03-03 22:32:47 -0800779LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests
Alex Deymo80f70ff2016-02-10 16:08:11 -0800780LOCAL_MODULE_CLASS := EXECUTABLES
781LOCAL_CPP_EXTENSION := .cc
782LOCAL_CLANG := true
783LOCAL_CFLAGS := $(ue_common_cflags)
784LOCAL_CPPFLAGS := $(ue_common_cppflags)
785LOCAL_LDFLAGS := $(ue_common_ldflags)
786LOCAL_C_INCLUDES := $(ue_common_c_includes)
787LOCAL_SHARED_LIBRARIES := $(ue_common_shared_libraries)
788LOCAL_SRC_FILES := \
789 common/http_common.cc \
790 test_http_server.cc
Alex Deymodc873fa2016-03-03 22:32:47 -0800791include $(BUILD_EXECUTABLE)
Alex Deymo80f70ff2016-02-10 16:08:11 -0800792
Sen Jianga78ee102016-04-01 14:15:08 -0700793# bsdiff (type: executable)
794# ========================================================
795# We need bsdiff in the update_engine_unittests directory, so we build it here.
796include $(CLEAR_VARS)
797LOCAL_MODULE := ue_unittest_bsdiff
798LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/update_engine_unittests
799LOCAL_MODULE_STEM := bsdiff
800LOCAL_CPP_EXTENSION := .cc
801LOCAL_SRC_FILES := ../../external/bsdiff/bsdiff_main.cc
802LOCAL_CFLAGS := $(bsdiff_common_cflags)
803LOCAL_STATIC_LIBRARIES := \
804 libbsdiff \
805 $(bsdiff_static_libs)
806include $(BUILD_EXECUTABLE)
807
Alex Deymo80f70ff2016-02-10 16:08:11 -0800808# update_engine_unittests (type: executable)
809# ========================================================
810# Main unittest file.
811include $(CLEAR_VARS)
812LOCAL_MODULE := update_engine_unittests
813ifdef BRILLO
814 LOCAL_MODULE_TAGS := eng
815endif
Alex Deymoc90be632016-02-17 19:25:20 -0800816LOCAL_REQUIRED_MODULES := \
Sen Jianga78ee102016-04-01 14:15:08 -0700817 ue_unittest_bsdiff \
Sen Jiang5a216c12016-03-30 13:08:24 -0700818 ue_unittest_delta_generator \
Alex Deymoc90be632016-02-17 19:25:20 -0800819 ue_unittest_disk_ext2_1k.img \
820 ue_unittest_disk_ext2_4k.img \
821 ue_unittest_disk_ext2_4k_empty.img \
Sen Jiang923886a2016-03-14 15:04:28 -0700822 ue_unittest_disk_ext2_unittest.img \
823 ue_unittest_key.pem \
824 ue_unittest_key.pub.pem \
825 ue_unittest_key2.pem \
Sen Jiange0d04282016-03-01 14:22:52 -0800826 ue_unittest_key2.pub.pem \
Sen Jiangee63c6e2016-03-30 14:01:02 -0700827 ue_unittest_update_engine.conf \
Sen Jiange0d04282016-03-01 14:22:52 -0800828 zlib_fingerprint
Alex Deymo80f70ff2016-02-10 16:08:11 -0800829LOCAL_MODULE_CLASS := EXECUTABLES
830LOCAL_CPP_EXTENSION := .cc
831LOCAL_CLANG := true
832LOCAL_CFLAGS := $(ue_common_cflags)
833LOCAL_CPPFLAGS := $(ue_common_cppflags)
834LOCAL_LDFLAGS := $(ue_common_ldflags)
835LOCAL_C_INCLUDES := \
836 $(ue_common_c_includes) \
837 $(ue_libupdate_engine_exported_c_includes)
838LOCAL_STATIC_LIBRARIES := \
839 libupdate_engine \
840 libpayload_generator \
841 libbrillo-test-helpers \
842 libgmock \
843 libgtest \
844 libchrome_test_helpers \
845 $(ue_libupdate_engine_exported_static_libraries:-host=) \
846 $(ue_libpayload_generator_exported_static_libraries:-host=)
847LOCAL_SHARED_LIBRARIES := \
848 $(ue_common_shared_libraries) \
849 $(ue_libupdate_engine_exported_shared_libraries:-host=) \
850 $(ue_libpayload_generator_exported_shared_libraries:-host=)
851LOCAL_SRC_FILES := \
852 common/action_pipe_unittest.cc \
853 common/action_processor_unittest.cc \
854 common/action_unittest.cc \
855 common/certificate_checker_unittest.cc \
856 common/cpu_limiter_unittest.cc \
857 common/fake_prefs.cc \
858 common/hash_calculator_unittest.cc \
859 common/http_fetcher_unittest.cc \
860 common/hwid_override_unittest.cc \
861 common/mock_http_fetcher.cc \
862 common/prefs_unittest.cc \
863 common/subprocess_unittest.cc \
864 common/terminator_unittest.cc \
865 common/test_utils.cc \
866 common/utils_unittest.cc \
867 common_service_unittest.cc \
868 connection_manager_unittest.cc \
869 fake_shill_proxy.cc \
870 fake_system_state.cc \
871 metrics_utils_unittest.cc \
872 omaha_request_action_unittest.cc \
873 omaha_request_params_unittest.cc \
874 omaha_response_handler_action_unittest.cc \
875 p2p_manager_unittest.cc \
876 payload_consumer/bzip_extent_writer_unittest.cc \
877 payload_consumer/delta_performer_integration_test.cc \
878 payload_consumer/delta_performer_unittest.cc \
879 payload_consumer/download_action_unittest.cc \
880 payload_consumer/extent_writer_unittest.cc \
881 payload_consumer/file_writer_unittest.cc \
882 payload_consumer/filesystem_verifier_action_unittest.cc \
883 payload_consumer/postinstall_runner_action_unittest.cc \
884 payload_consumer/xz_extent_writer_unittest.cc \
885 payload_generator/ab_generator_unittest.cc \
886 payload_generator/blob_file_writer_unittest.cc \
887 payload_generator/block_mapping_unittest.cc \
888 payload_generator/cycle_breaker_unittest.cc \
889 payload_generator/delta_diff_utils_unittest.cc \
890 payload_generator/ext2_filesystem_unittest.cc \
891 payload_generator/extent_ranges_unittest.cc \
892 payload_generator/extent_utils_unittest.cc \
893 payload_generator/fake_filesystem.cc \
894 payload_generator/full_update_generator_unittest.cc \
895 payload_generator/graph_utils_unittest.cc \
896 payload_generator/inplace_generator_unittest.cc \
897 payload_generator/payload_file_unittest.cc \
898 payload_generator/payload_generation_config_unittest.cc \
899 payload_generator/payload_signer_unittest.cc \
900 payload_generator/tarjan_unittest.cc \
901 payload_generator/topological_sort_unittest.cc \
902 payload_generator/zip_unittest.cc \
903 payload_state_unittest.cc \
904 update_attempter_unittest.cc \
905 update_manager/boxed_value_unittest.cc \
906 update_manager/chromeos_policy_unittest.cc \
907 update_manager/evaluation_context_unittest.cc \
908 update_manager/generic_variables_unittest.cc \
909 update_manager/prng_unittest.cc \
910 update_manager/real_config_provider_unittest.cc \
911 update_manager/real_device_policy_provider_unittest.cc \
912 update_manager/real_random_provider_unittest.cc \
913 update_manager/real_shill_provider_unittest.cc \
914 update_manager/real_system_provider_unittest.cc \
915 update_manager/real_time_provider_unittest.cc \
916 update_manager/real_updater_provider_unittest.cc \
917 update_manager/umtest_utils.cc \
918 update_manager/update_manager_unittest.cc \
919 update_manager/variable_unittest.cc \
920 testrunner.cc
921ifeq ($(local_use_libcros),1)
922LOCAL_SRC_FILES += \
923 chrome_browser_proxy_resolver_unittest.cc
924endif # local_use_libcros == 1
925include $(BUILD_NATIVE_TEST)
926endif # BRILLO
927
Alex Deymof7ead812015-10-23 17:37:27 -0700928# Weave schema files
929# ========================================================
930include $(CLEAR_VARS)
931LOCAL_MODULE := updater.json
932LOCAL_MODULE_CLASS := ETC
933LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/weaved/traits
934LOCAL_SRC_FILES := weaved/traits/$(LOCAL_MODULE)
935include $(BUILD_PREBUILT)
936
Gaurav Shah263614f2015-09-24 14:20:38 -0700937# Update payload signing public key.
938# ========================================================
Alex Deymo50e24f42016-01-27 20:48:54 -0800939ifdef BRILLO
Gaurav Shah263614f2015-09-24 14:20:38 -0700940include $(CLEAR_VARS)
941LOCAL_MODULE := brillo-update-payload-key
942LOCAL_MODULE_CLASS := ETC
943LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/update_engine
944LOCAL_MODULE_STEM := update-payload-key.pub.pem
945LOCAL_SRC_FILES := update_payload_key/brillo-update-payload-key.pub.pem
946LOCAL_BUILT_MODULE_STEM := update_payload_key/brillo-update-payload-key.pub.pem
947include $(BUILD_PREBUILT)
Alex Deymo50e24f42016-01-27 20:48:54 -0800948endif # BRILLO
Tao Bao042f8a12016-01-07 16:52:14 -0800949
950# Brillo update payload generation script
951# ========================================================
952ifeq ($(HOST_OS),linux)
953include $(CLEAR_VARS)
954LOCAL_SRC_FILES := scripts/brillo_update_payload
955LOCAL_MODULE := brillo_update_payload
956LOCAL_MODULE_CLASS := EXECUTABLES
957LOCAL_IS_HOST_MODULE := true
958LOCAL_MODULE_TAGS := optional
959LOCAL_REQUIRED_MODULES := \
960 delta_generator \
961 shflags
962include $(BUILD_PREBUILT)
963endif # HOST_OS == linux