blob: 6e7d200b1d81d5fd7e9b356d98fa8c2cc64d1bc4 [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 Deymoc1804002016-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)
26local_use_mtd := $(if $(BRILLO_USE_MTD),$(BRILLO_USE_MTD),0)
27local_use_power_management := \
28 $(if $(BRILLO_USE_POWER_MANAGEMENT),$(BRILLO_USE_POWER_MANAGEMENT),0)
29local_use_weave := $(if $(BRILLO_USE_WEAVE),$(BRILLO_USE_WEAVE),0)
Alex Deymo787dc412015-10-29 11:39:20 -070030
Alex Deymoc372ab62015-10-29 00:43:26 -070031ue_common_cflags := \
Alex Deymo78a954f2016-01-21 20:32:40 -080032 -DUSE_BINDER=$(local_use_binder) \
33 -DUSE_DBUS=$(local_use_dbus) \
34 -DUSE_HWID_OVERRIDE=$(local_use_hwid_override) \
35 -DUSE_MTD=$(local_use_mtd) \
36 -DUSE_POWER_MANAGEMENT=$(local_use_power_management) \
37 -DUSE_WEAVE=$(local_use_weave) \
Alex Deymoc372ab62015-10-29 00:43:26 -070038 -D_FILE_OFFSET_BITS=64 \
39 -D_POSIX_C_SOURCE=199309L \
40 -Wa,--noexecstack \
41 -Wall \
42 -Werror \
43 -Wextra \
44 -Wformat=2 \
45 -Wno-psabi \
46 -Wno-unused-parameter \
47 -ffunction-sections \
48 -fstack-protector-strong \
49 -fvisibility=hidden
50ue_common_cppflags := \
51 -Wnon-virtual-dtor \
52 -fno-strict-aliasing \
53 -std=gnu++11
54ue_common_ldflags := \
55 -Wl,--gc-sections
56ue_common_c_includes := \
57 $(LOCAL_PATH)/client_library/include \
58 external/gtest/include \
59 system
60ue_common_shared_libraries := \
61 libbrillo \
Alex Deymoc372ab62015-10-29 00:43:26 -070062 libbrillo-http \
63 libbrillo-stream \
Alex Deymo4218b7e2015-11-17 21:14:42 -030064 libchrome
Alex Deymod5561a52015-09-03 23:17:52 -070065
Alex Deymo78a954f2016-01-21 20:32:40 -080066ifeq ($(local_use_dbus),1)
Alex Deymoc372ab62015-10-29 00:43:26 -070067
68# update_engine_client-dbus-proxies (from generate-dbus-proxies.gypi)
69# ========================================================
70include $(CLEAR_VARS)
71LOCAL_MODULE := update_engine_client-dbus-proxies
72LOCAL_MODULE_CLASS := STATIC_LIBRARIES
73LOCAL_SRC_FILES := \
74 dbus_bindings/dbus-service-config.json \
75 dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml
76LOCAL_DBUS_PROXY_PREFIX := update_engine
77include $(BUILD_STATIC_LIBRARY)
Alex Deymod5561a52015-09-03 23:17:52 -070078
Alex Deymo78a954f2016-01-21 20:32:40 -080079endif # local_use_dbus == 1
Alex Deymo4218b7e2015-11-17 21:14:42 -030080
Alex Deymod5561a52015-09-03 23:17:52 -070081# update_metadata-protos (type: static_library)
82# ========================================================
83# Protobufs.
Alex Deymoc372ab62015-10-29 00:43:26 -070084ue_update_metadata_protos_exported_static_libraries := \
85 update_metadata-protos
86ue_update_metadata_protos_exported_shared_libraries := \
Alex Vakulenkoab5bd662015-12-21 12:24:45 -080087 libprotobuf-cpp-lite
Alex Deymoc372ab62015-10-29 00:43:26 -070088
Alex Deymo05e0e382015-12-07 20:18:16 -080089ue_update_metadata_protos_src_files := \
90 update_metadata.proto
91
92# Build for the host.
Alex Deymod5561a52015-09-03 23:17:52 -070093include $(CLEAR_VARS)
94LOCAL_MODULE := update_metadata-protos
95LOCAL_MODULE_CLASS := STATIC_LIBRARIES
Ying Wangdbd17112015-12-17 11:59:09 -080096LOCAL_IS_HOST_MODULE := true
Alex Deymod5561a52015-09-03 23:17:52 -070097generated_sources_dir := $(call local-generated-sources-dir)
Alex Deymoc372ab62015-10-29 00:43:26 -070098LOCAL_EXPORT_C_INCLUDE_DIRS := $(generated_sources_dir)/proto/system
Alex Deymo05e0e382015-12-07 20:18:16 -080099LOCAL_SRC_FILES := $(ue_update_metadata_protos_src_files)
100include $(BUILD_HOST_STATIC_LIBRARY)
101
102# Build for the target.
103include $(CLEAR_VARS)
104LOCAL_MODULE := update_metadata-protos
105LOCAL_MODULE_CLASS := STATIC_LIBRARIES
106generated_sources_dir := $(call local-generated-sources-dir)
107LOCAL_EXPORT_C_INCLUDE_DIRS := $(generated_sources_dir)/proto/system
108LOCAL_SRC_FILES := $(ue_update_metadata_protos_src_files)
Alex Deymod5561a52015-09-03 23:17:52 -0700109include $(BUILD_STATIC_LIBRARY)
110
Alex Deymo78a954f2016-01-21 20:32:40 -0800111ifeq ($(local_use_dbus),1)
Alex Deymo4218b7e2015-11-17 21:14:42 -0300112
Alex Deymod5561a52015-09-03 23:17:52 -0700113# update_engine-dbus-adaptor (from generate-dbus-adaptors.gypi)
114# ========================================================
Alex Deymoc372ab62015-10-29 00:43:26 -0700115# Chrome D-Bus bindings.
Alex Deymod5561a52015-09-03 23:17:52 -0700116include $(CLEAR_VARS)
117LOCAL_MODULE := update_engine-dbus-adaptor
Alex Deymoc372ab62015-10-29 00:43:26 -0700118LOCAL_MODULE_CLASS := STATIC_LIBRARIES
Alex Deymod5561a52015-09-03 23:17:52 -0700119LOCAL_SRC_FILES := \
120 dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml
121include $(BUILD_STATIC_LIBRARY)
122
123# update_engine-dbus-libcros-client (from generate-dbus-proxies.gypi)
124# ========================================================
125include $(CLEAR_VARS)
126LOCAL_MODULE := update_engine-dbus-libcros-client
Alex Deymoc372ab62015-10-29 00:43:26 -0700127LOCAL_MODULE_CLASS := STATIC_LIBRARIES
Alex Deymod5561a52015-09-03 23:17:52 -0700128LOCAL_SRC_FILES := \
129 dbus_bindings/org.chromium.LibCrosService.dbus-xml
130LOCAL_DBUS_PROXY_PREFIX := libcros
131include $(BUILD_STATIC_LIBRARY)
132
Alex Deymo78a954f2016-01-21 20:32:40 -0800133endif # local_use_dbus == 1
Alex Deymo4218b7e2015-11-17 21:14:42 -0300134
Alex Deymo39910dc2015-11-09 17:04:30 -0800135# libpayload_consumer (type: static_library)
Alex Deymod5561a52015-09-03 23:17:52 -0700136# ========================================================
Alex Deymo39910dc2015-11-09 17:04:30 -0800137# The payload application component and common dependencies.
Alex Deymo39910dc2015-11-09 17:04:30 -0800138ue_libpayload_consumer_exported_static_libraries := \
139 update_metadata-protos \
Alex Deymo05e0e382015-12-07 20:18:16 -0800140 libxz-host \
Alex Deymo39910dc2015-11-09 17:04:30 -0800141 libbz \
Alex Deymo39910dc2015-11-09 17:04:30 -0800142 $(ue_update_metadata_protos_exported_static_libraries)
143ue_libpayload_consumer_exported_shared_libraries := \
Alex Deymo05e0e382015-12-07 20:18:16 -0800144 libcrypto-host \
145 libcurl-host \
146 libssl-host \
Alex Deymo39910dc2015-11-09 17:04:30 -0800147 $(ue_update_metadata_protos_exported_shared_libraries)
148
Alex Deymo05e0e382015-12-07 20:18:16 -0800149ue_libpayload_consumer_src_files := \
Alex Deymo39910dc2015-11-09 17:04:30 -0800150 common/action_processor.cc \
Alex Deymo39910dc2015-11-09 17:04:30 -0800151 common/boot_control_stub.cc \
152 common/certificate_checker.cc \
153 common/clock.cc \
154 common/constants.cc \
Alex Deymo39910dc2015-11-09 17:04:30 -0800155 common/hash_calculator.cc \
156 common/http_common.cc \
157 common/http_fetcher.cc \
158 common/hwid_override.cc \
159 common/libcurl_http_fetcher.cc \
160 common/multi_range_http_fetcher.cc \
161 common/platform_constants_android.cc \
162 common/prefs.cc \
163 common/subprocess.cc \
164 common/terminator.cc \
165 common/utils.cc \
166 payload_consumer/bzip_extent_writer.cc \
167 payload_consumer/delta_performer.cc \
168 payload_consumer/download_action.cc \
169 payload_consumer/extent_writer.cc \
170 payload_consumer/file_descriptor.cc \
171 payload_consumer/file_writer.cc \
172 payload_consumer/filesystem_verifier_action.cc \
173 payload_consumer/install_plan.cc \
174 payload_consumer/payload_constants.cc \
175 payload_consumer/payload_verifier.cc \
176 payload_consumer/postinstall_runner_action.cc \
177 payload_consumer/xz_extent_writer.cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800178
179ifeq ($(HOST_OS),linux)
180# Build for the host.
181include $(CLEAR_VARS)
182LOCAL_MODULE := libpayload_consumer
183LOCAL_MODULE_CLASS := STATIC_LIBRARIES
184LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800185LOCAL_CLANG := true
186LOCAL_CFLAGS := $(ue_common_cflags)
187LOCAL_CPPFLAGS := $(ue_common_cppflags)
188LOCAL_LDFLAGS := $(ue_common_ldflags)
189LOCAL_C_INCLUDES := \
190 $(ue_common_c_includes) \
191 external/e2fsprogs/lib
192LOCAL_STATIC_LIBRARIES := \
193 update_metadata-protos \
194 $(ue_libpayload_consumer_exported_static_libraries) \
195 $(ue_update_metadata_protos_exported_static_libraries)
196LOCAL_SHARED_LIBRARIES := \
197 $(ue_common_shared_libraries) \
198 $(ue_libpayload_consumer_exported_shared_libraries) \
199 $(ue_update_metadata_protos_exported_shared_libraries)
200LOCAL_SRC_FILES := $(ue_libpayload_consumer_src_files)
201include $(BUILD_HOST_STATIC_LIBRARY)
202endif # HOST_OS == linux
203
204# Build for the target.
205include $(CLEAR_VARS)
206LOCAL_MODULE := libpayload_consumer
207LOCAL_MODULE_CLASS := STATIC_LIBRARIES
208LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800209LOCAL_CLANG := true
210LOCAL_CFLAGS := $(ue_common_cflags)
211LOCAL_CPPFLAGS := $(ue_common_cppflags)
212LOCAL_LDFLAGS := $(ue_common_ldflags)
213LOCAL_C_INCLUDES := \
214 $(ue_common_c_includes) \
215 external/e2fsprogs/lib
216LOCAL_STATIC_LIBRARIES := \
217 update_metadata-protos \
218 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
219 $(ue_update_metadata_protos_exported_static_libraries)
220LOCAL_SHARED_LIBRARIES := \
221 $(ue_common_shared_libraries) \
222 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
223 $(ue_update_metadata_protos_exported_shared_libraries)
224LOCAL_SRC_FILES := $(ue_libpayload_consumer_src_files)
Alex Deymo39910dc2015-11-09 17:04:30 -0800225include $(BUILD_STATIC_LIBRARY)
226
Alex Deymo78a954f2016-01-21 20:32:40 -0800227ifeq ($(local_use_dbus),1)
Alex Deymo4218b7e2015-11-17 21:14:42 -0300228
Alex Deymo39910dc2015-11-09 17:04:30 -0800229# 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.
233ue_libupdate_engine_exported_c_includes := \
234 $(LOCAL_PATH)/include \
Alex Deymob09305e2015-12-02 16:09:13 -0300235 external/cros/system_api/dbus
Alex Deymoc372ab62015-10-29 00:43:26 -0700236ue_libupdate_engine_exported_static_libraries := \
Alex Deymo39910dc2015-11-09 17:04:30 -0800237 libpayload_consumer \
Alex Deymod5561a52015-09-03 23:17:52 -0700238 update_metadata-protos \
239 update_engine-dbus-adaptor \
240 update_engine-dbus-libcros-client \
241 update_engine_client-dbus-proxies \
David Zeuthen753fadc2015-09-15 16:34:09 -0400242 libbz \
Alex Deymoc372ab62015-10-29 00:43:26 -0700243 libfs_mgr \
Alex Deymo39910dc2015-11-09 17:04:30 -0800244 $(ue_libpayload_consumer_exported_static_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700245 $(ue_update_metadata_protos_exported_static_libraries)
246ue_libupdate_engine_exported_shared_libraries := \
Alex Deymod5561a52015-09-03 23:17:52 -0700247 libdbus \
Alex Deymo05e0e382015-12-07 20:18:16 -0800248 libbrillo-dbus \
249 libchrome-dbus \
Alex Deymod5561a52015-09-03 23:17:52 -0700250 libmetrics \
Alex Deymo7eb23052015-10-09 15:27:59 -0700251 libshill-client \
Alex Deymod5561a52015-09-03 23:17:52 -0700252 libexpat \
Alex Vakulenko1bab5a82015-10-27 11:47:28 -0700253 libbrillo-policy \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700254 libhardware \
Alex Deymoc372ab62015-10-29 00:43:26 -0700255 libcutils \
Alex Deymo39910dc2015-11-09 17:04:30 -0800256 $(ue_libpayload_consumer_exported_shared_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700257 $(ue_update_metadata_protos_exported_shared_libraries)
Alex Deymo78a954f2016-01-21 20:32:40 -0800258ifeq ($(local_use_weave),1)
Alex Deymof7ead812015-10-23 17:37:27 -0700259ue_libupdate_engine_exported_shared_libraries += \
260 libweaved
Alex Deymo78a954f2016-01-21 20:32:40 -0800261endif # local_use_weave == 1
Alex Deymoc1804002016-01-20 13:22:17 -0800262ifeq ($(local_use_binder),1)
263ue_libupdate_engine_exported_shared_libraries += \
264 libbinder \
265 libbrillo-binder \
266 libutils
267endif # local_use_binder == 1
Alex Deymoc372ab62015-10-29 00:43:26 -0700268
269include $(CLEAR_VARS)
270LOCAL_MODULE := libupdate_engine
271LOCAL_MODULE_CLASS := STATIC_LIBRARIES
272LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700273LOCAL_CLANG := true
274LOCAL_EXPORT_C_INCLUDE_DIRS := $(ue_libupdate_engine_exported_c_includes)
275LOCAL_CFLAGS := $(ue_common_cflags)
276LOCAL_CPPFLAGS := $(ue_common_cppflags)
277LOCAL_LDFLAGS := $(ue_common_ldflags)
278LOCAL_C_INCLUDES := \
279 $(ue_common_c_includes) \
Alex Deymob09305e2015-12-02 16:09:13 -0300280 $(ue_libupdate_engine_exported_c_includes)
Alex Deymoc372ab62015-10-29 00:43:26 -0700281LOCAL_STATIC_LIBRARIES := \
Alex Deymo39910dc2015-11-09 17:04:30 -0800282 libpayload_consumer \
Alex Deymoc372ab62015-10-29 00:43:26 -0700283 update_metadata-protos \
284 update_engine-dbus-adaptor \
285 update_engine-dbus-libcros-client \
286 update_engine_client-dbus-proxies \
Alex Deymo05e0e382015-12-07 20:18:16 -0800287 $(ue_libupdate_engine_exported_static_libraries:-host=) \
288 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700289 $(ue_update_metadata_protos_exported_static_libraries)
290LOCAL_SHARED_LIBRARIES := \
291 $(ue_common_shared_libraries) \
Alex Deymo05e0e382015-12-07 20:18:16 -0800292 $(ue_libupdate_engine_exported_shared_libraries:-host=) \
293 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700294 $(ue_update_metadata_protos_exported_shared_libraries)
Alex Deymod5561a52015-09-03 23:17:52 -0700295LOCAL_SRC_FILES := \
Alex Deymo1b03f9f2015-12-09 00:38:36 -0800296 boot_control_android.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700297 chrome_browser_proxy_resolver.cc \
Alex Deymo78a954f2016-01-21 20:32:40 -0800298 common_service.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700299 connection_manager.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700300 daemon.cc \
301 dbus_service.cc \
Alex Deymo1b03f9f2015-12-09 00:38:36 -0800302 hardware_android.cc \
Alex Deymo85616652015-10-15 18:48:31 -0700303 image_properties_android.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700304 libcros_proxy.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700305 metrics.cc \
Alex Deymo38429cf2015-11-11 18:27:22 -0800306 metrics_utils.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700307 omaha_request_action.cc \
308 omaha_request_params.cc \
309 omaha_response_handler_action.cc \
310 p2p_manager.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700311 payload_state.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700312 proxy_resolver.cc \
313 real_system_state.cc \
314 shill_proxy.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700315 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 \
324 update_manager/real_shill_provider.cc \
325 update_manager/real_system_provider.cc \
326 update_manager/real_time_provider.cc \
327 update_manager/real_updater_provider.cc \
328 update_manager/state_factory.cc \
329 update_manager/update_manager.cc \
Alex Deymof7ead812015-10-23 17:37:27 -0700330 update_status_utils.cc \
331 weave_service_factory.cc
Alex Deymo78a954f2016-01-21 20:32:40 -0800332ifeq ($(local_use_weave),1)
Alex Deymof7ead812015-10-23 17:37:27 -0700333LOCAL_SRC_FILES += \
334 weave_service.cc
Alex Deymo78a954f2016-01-21 20:32:40 -0800335endif # local_use_weave == 1
Casey Dahlina93cd532016-01-14 16:55:11 -0800336
Alex Deymo78a954f2016-01-21 20:32:40 -0800337ifeq ($(local_use_binder),1)
Casey Dahlina93cd532016-01-14 16:55:11 -0800338LOCAL_AIDL_INCLUDES += $(LOCAL_PATH)/binder_bindings
Casey Dahlina93cd532016-01-14 16:55:11 -0800339LOCAL_SRC_FILES += \
340 binder_bindings/android/brillo/IUpdateEngine.aidl \
341 binder_bindings/android/brillo/IUpdateEngineStatusCallback.aidl \
342 binder_service.cc \
343 parcelable_update_engine_status.cc
Alex Deymo78a954f2016-01-21 20:32:40 -0800344endif # local_use_binder == 1
Casey Dahlina93cd532016-01-14 16:55:11 -0800345
Alex Deymod5561a52015-09-03 23:17:52 -0700346include $(BUILD_STATIC_LIBRARY)
347
Alex Deymo78a954f2016-01-21 20:32:40 -0800348endif # local_use_dbus == 1
Alex Deymo4218b7e2015-11-17 21:14:42 -0300349
Alex Deymod5561a52015-09-03 23:17:52 -0700350# update_engine (type: executable)
351# ========================================================
352# update_engine daemon.
353include $(CLEAR_VARS)
354LOCAL_MODULE := update_engine
355LOCAL_MODULE_CLASS := EXECUTABLES
Sen Jiang56092772015-11-23 14:41:00 -0800356LOCAL_REQUIRED_MODULES := \
Alex Deymoab494462015-11-30 17:07:36 -0300357 bspatch \
358 cacerts_google
Alex Deymo78a954f2016-01-21 20:32:40 -0800359ifeq ($(local_use_weave),1)
Alex Deymof7ead812015-10-23 17:37:27 -0700360LOCAL_REQUIRED_MODULES += updater.json
Alex Deymo78a954f2016-01-21 20:32:40 -0800361endif # local_use_weave == 1
Alex Deymoc372ab62015-10-29 00:43:26 -0700362LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700363LOCAL_CLANG := true
364LOCAL_CFLAGS := $(ue_common_cflags)
365LOCAL_CPPFLAGS := $(ue_common_cppflags)
366LOCAL_LDFLAGS := $(ue_common_ldflags)
367LOCAL_C_INCLUDES := \
Alex Deymo4218b7e2015-11-17 21:14:42 -0300368 $(ue_common_c_includes)
Alex Deymoc1804002016-01-20 13:22:17 -0800369LOCAL_SHARED_LIBRARIES := \
370 $(ue_common_shared_libraries)
371LOCAL_SRC_FILES := \
372 main.cc
Alex Deymo4218b7e2015-11-17 21:14:42 -0300373
374ifdef BRILLO
Alex Deymo4218b7e2015-11-17 21:14:42 -0300375LOCAL_C_INCLUDES += \
Alex Deymoc372ab62015-10-29 00:43:26 -0700376 $(ue_libupdate_engine_exported_c_includes)
377LOCAL_STATIC_LIBRARIES := \
Alex Deymod5561a52015-09-03 23:17:52 -0700378 libupdate_engine \
Alex Deymo05e0e382015-12-07 20:18:16 -0800379 $(ue_libupdate_engine_exported_static_libraries:-host=)
Alex Deymoc1804002016-01-20 13:22:17 -0800380LOCAL_SHARED_LIBRARIES += \
Alex Deymo05e0e382015-12-07 20:18:16 -0800381 $(ue_libupdate_engine_exported_shared_libraries:-host=)
Christopher Wiley9e1eda92015-11-16 15:23:37 -0800382else # !defined(BRILLO)
Christopher Wiley9e1eda92015-11-16 15:23:37 -0800383LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder_bindings
Alex Deymoc1804002016-01-20 13:22:17 -0800384LOCAL_STATIC_LIBRARIES := \
385 libpayload_consumer \
386 $(ue_libpayload_consumer_exported_static_libraries:-host=)
387LOCAL_SHARED_LIBRARIES += \
388 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
Christopher Wiley9e1eda92015-11-16 15:23:37 -0800389 libbinder \
Alex Deymoc1804002016-01-20 13:22:17 -0800390 libbrillo-binder \
Christopher Wiley9e1eda92015-11-16 15:23:37 -0800391 libutils
Alex Deymoc1804002016-01-20 13:22:17 -0800392LOCAL_SRC_FILES += \
Christopher Wiley9e1eda92015-11-16 15:23:37 -0800393 binder_bindings/android/os/IUpdateEngine.aidl \
Tao Baoe78e3fb2016-01-04 17:57:53 -0800394 binder_bindings/android/os/IUpdateEngineCallback.aidl \
Alex Deymoc1804002016-01-20 13:22:17 -0800395 binder_service_android.cc \
396 daemon.cc
Christopher Wiley9e1eda92015-11-16 15:23:37 -0800397endif # defined(BRILLO)
398
Alex Deymo78a954f2016-01-21 20:32:40 -0800399ifeq ($(local_use_binder),1)
Casey Dahlina93cd532016-01-14 16:55:11 -0800400LOCAL_SHARED_LIBRARIES += \
401 libbinder \
Alex Deymoc1804002016-01-20 13:22:17 -0800402 libbinderwrapper \
Casey Dahlina93cd532016-01-14 16:55:11 -0800403 libutils
Alex Deymo78a954f2016-01-21 20:32:40 -0800404endif # local_use_binder == 1
Casey Dahlina93cd532016-01-14 16:55:11 -0800405
Gilad Arnold70141f22015-09-17 09:06:30 -0700406LOCAL_INIT_RC := update_engine.rc
Alex Deymod5561a52015-09-03 23:17:52 -0700407include $(BUILD_EXECUTABLE)
408
Alex Deymo78a954f2016-01-21 20:32:40 -0800409ifeq ($(local_use_dbus),1)
Alex Deymo4218b7e2015-11-17 21:14:42 -0300410
Alex Deymod5561a52015-09-03 23:17:52 -0700411# update_engine_client (type: executable)
412# ========================================================
413# update_engine console client.
414include $(CLEAR_VARS)
415LOCAL_MODULE := update_engine_client
416LOCAL_MODULE_CLASS := EXECUTABLES
Alex Deymoc372ab62015-10-29 00:43:26 -0700417LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700418LOCAL_CLANG := true
419LOCAL_CFLAGS := $(ue_common_cflags)
420LOCAL_CPPFLAGS := $(ue_common_cppflags)
421LOCAL_LDFLAGS := $(ue_common_ldflags)
422LOCAL_C_INCLUDES := \
423 $(ue_common_c_includes) \
Alex Deymod5561a52015-09-03 23:17:52 -0700424 $(LOCAL_PATH)/include
Alex Deymoc372ab62015-10-29 00:43:26 -0700425LOCAL_STATIC_LIBRARIES := update_engine_client-dbus-proxies
Alex Deymo05e0e382015-12-07 20:18:16 -0800426LOCAL_SHARED_LIBRARIES := \
427 $(ue_common_shared_libraries) \
428 libdbus \
429 libbrillo-dbus \
Casey Dahline844c1a2015-12-16 14:30:58 -0800430 libchrome-dbus \
431 libupdate_engine_client
Alex Deymod5561a52015-09-03 23:17:52 -0700432LOCAL_SRC_FILES := \
433 update_engine_client.cc
Alex Deymod5561a52015-09-03 23:17:52 -0700434include $(BUILD_EXECUTABLE)
435
Alex Deymo78a954f2016-01-21 20:32:40 -0800436endif # local_use_dbus == 1
Alex Deymo4218b7e2015-11-17 21:14:42 -0300437
Alex Deymod5561a52015-09-03 23:17:52 -0700438# libpayload_generator (type: static_library)
439# ========================================================
440# server-side code. This is used for delta_generator and unittests but not
441# for any client code.
Alex Deymoc372ab62015-10-29 00:43:26 -0700442ue_libpayload_generator_exported_static_libraries := \
Alex Deymob09305e2015-12-02 16:09:13 -0300443 libpayload_consumer \
Alex Deymoc372ab62015-10-29 00:43:26 -0700444 update_metadata-protos \
Alex Deymob09305e2015-12-02 16:09:13 -0300445 $(ue_libpayload_consumer_exported_static_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700446 $(ue_update_metadata_protos_exported_static_libraries)
447ue_libpayload_generator_exported_shared_libraries := \
Alex Deymo05e0e382015-12-07 20:18:16 -0800448 libext2fs-host \
Alex Deymob09305e2015-12-02 16:09:13 -0300449 $(ue_libpayload_consumer_exported_shared_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700450 $(ue_update_metadata_protos_exported_shared_libraries)
451
Alex Deymo05e0e382015-12-07 20:18:16 -0800452ue_libpayload_generator_src_files := \
Alex Deymod5561a52015-09-03 23:17:52 -0700453 payload_generator/ab_generator.cc \
454 payload_generator/annotated_operation.cc \
455 payload_generator/blob_file_writer.cc \
456 payload_generator/block_mapping.cc \
Alex Deymo0bc26112015-10-19 20:54:57 -0700457 payload_generator/bzip.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700458 payload_generator/cycle_breaker.cc \
459 payload_generator/delta_diff_generator.cc \
460 payload_generator/delta_diff_utils.cc \
461 payload_generator/ext2_filesystem.cc \
462 payload_generator/extent_ranges.cc \
463 payload_generator/extent_utils.cc \
464 payload_generator/full_update_generator.cc \
465 payload_generator/graph_types.cc \
466 payload_generator/graph_utils.cc \
467 payload_generator/inplace_generator.cc \
468 payload_generator/payload_file.cc \
469 payload_generator/payload_generation_config.cc \
470 payload_generator/payload_signer.cc \
471 payload_generator/raw_filesystem.cc \
472 payload_generator/tarjan.cc \
473 payload_generator/topological_sort.cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800474
475ifeq ($(HOST_OS),linux)
476# Build for the host.
477include $(CLEAR_VARS)
478LOCAL_MODULE := libpayload_generator
479LOCAL_MODULE_CLASS := STATIC_LIBRARIES
480LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800481LOCAL_CLANG := true
482LOCAL_CFLAGS := $(ue_common_cflags)
483LOCAL_CPPFLAGS := $(ue_common_cppflags)
484LOCAL_LDFLAGS := $(ue_common_ldflags)
485LOCAL_C_INCLUDES := $(ue_common_c_includes)
486LOCAL_STATIC_LIBRARIES := \
487 libpayload_consumer \
488 update_metadata-protos \
489 $(ue_libpayload_consumer_exported_static_libraries) \
490 $(ue_update_metadata_protos_exported_static_libraries)
491LOCAL_SHARED_LIBRARIES := \
492 $(ue_common_shared_libraries) \
493 $(ue_libpayload_generator_exported_shared_libraries) \
494 $(ue_libpayload_consumer_exported_shared_libraries) \
495 $(ue_update_metadata_protos_exported_shared_libraries)
496LOCAL_SRC_FILES := $(ue_libpayload_generator_src_files)
497include $(BUILD_HOST_STATIC_LIBRARY)
498endif # HOST_OS == linux
499
500# Build for the target.
501include $(CLEAR_VARS)
502LOCAL_MODULE := libpayload_generator
503LOCAL_MODULE_CLASS := STATIC_LIBRARIES
504LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800505LOCAL_CLANG := true
506LOCAL_CFLAGS := $(ue_common_cflags)
507LOCAL_CPPFLAGS := $(ue_common_cppflags)
508LOCAL_LDFLAGS := $(ue_common_ldflags)
509LOCAL_C_INCLUDES := $(ue_common_c_includes)
510LOCAL_STATIC_LIBRARIES := \
511 libpayload_consumer \
512 update_metadata-protos \
513 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
514 $(ue_update_metadata_protos_exported_static_libraries)
515LOCAL_SHARED_LIBRARIES := \
516 $(ue_common_shared_libraries) \
517 $(ue_libpayload_generator_exported_shared_libraries:-host=) \
518 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
519 $(ue_update_metadata_protos_exported_shared_libraries)
520LOCAL_SRC_FILES := $(ue_libpayload_generator_src_files)
Alex Deymod5561a52015-09-03 23:17:52 -0700521include $(BUILD_STATIC_LIBRARY)
522
523# delta_generator (type: executable)
524# ========================================================
525# server-side delta generator.
Alex Deymo05e0e382015-12-07 20:18:16 -0800526ue_delta_generator_src_files := \
527 payload_generator/generate_delta_main.cc
528
529ifeq ($(HOST_OS),linux)
530# Build for the host.
Alex Deymod5561a52015-09-03 23:17:52 -0700531include $(CLEAR_VARS)
532LOCAL_MODULE := delta_generator
533LOCAL_MODULE_CLASS := EXECUTABLES
Alex Deymoc372ab62015-10-29 00:43:26 -0700534LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700535LOCAL_CLANG := true
536LOCAL_CFLAGS := $(ue_common_cflags)
537LOCAL_CPPFLAGS := $(ue_common_cppflags)
538LOCAL_LDFLAGS := $(ue_common_ldflags)
Alex Deymob09305e2015-12-02 16:09:13 -0300539LOCAL_C_INCLUDES := $(ue_common_c_includes)
Alex Deymoc372ab62015-10-29 00:43:26 -0700540LOCAL_STATIC_LIBRARIES := \
Alex Deymob09305e2015-12-02 16:09:13 -0300541 libpayload_consumer \
Alex Deymoc372ab62015-10-29 00:43:26 -0700542 libpayload_generator \
Alex Deymob09305e2015-12-02 16:09:13 -0300543 $(ue_libpayload_consumer_exported_static_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700544 $(ue_libpayload_generator_exported_static_libraries)
545LOCAL_SHARED_LIBRARIES := \
546 $(ue_common_shared_libraries) \
Alex Deymob09305e2015-12-02 16:09:13 -0300547 $(ue_libpayload_consumer_exported_shared_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700548 $(ue_libpayload_generator_exported_shared_libraries)
Alex Deymo05e0e382015-12-07 20:18:16 -0800549LOCAL_SRC_FILES := $(ue_delta_generator_src_files)
550include $(BUILD_HOST_EXECUTABLE)
551endif # HOST_OS == linux
552
553# Build for the target.
554include $(CLEAR_VARS)
555LOCAL_MODULE := delta_generator
556LOCAL_MODULE_CLASS := EXECUTABLES
557LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800558LOCAL_CLANG := true
559LOCAL_CFLAGS := $(ue_common_cflags)
560LOCAL_CPPFLAGS := $(ue_common_cppflags)
561LOCAL_LDFLAGS := $(ue_common_ldflags)
562LOCAL_C_INCLUDES := $(ue_common_c_includes)
563LOCAL_STATIC_LIBRARIES := \
564 libpayload_consumer \
565 libpayload_generator \
566 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
567 $(ue_libpayload_generator_exported_static_libraries:-host=)
568LOCAL_SHARED_LIBRARIES := \
569 $(ue_common_shared_libraries) \
570 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
571 $(ue_libpayload_generator_exported_shared_libraries:-host=)
572LOCAL_SRC_FILES := $(ue_delta_generator_src_files)
Alex Deymod5561a52015-09-03 23:17:52 -0700573include $(BUILD_EXECUTABLE)
574
Alex Deymo78a954f2016-01-21 20:32:40 -0800575ifeq ($(local_use_dbus),1)
Alex Deymo4218b7e2015-11-17 21:14:42 -0300576
Christopher Wiley16daa082015-10-01 17:18:40 -0700577# libupdate_engine_client
578# ========================================================
579include $(CLEAR_VARS)
580LOCAL_MODULE := libupdate_engine_client
Christopher Wiley16daa082015-10-01 17:18:40 -0700581LOCAL_CFLAGS := \
582 -Wall \
583 -Werror \
Casey Dahlina93cd532016-01-14 16:55:11 -0800584 -Wno-unused-parameter \
Alex Deymo78a954f2016-01-21 20:32:40 -0800585 -DUSE_BINDER=$(local_use_binder)
Christopher Wiley16daa082015-10-01 17:18:40 -0700586LOCAL_CLANG := true
587LOCAL_CPP_EXTENSION := .cc
588LOCAL_C_INCLUDES := \
589 $(LOCAL_PATH)/client_library/include \
590 external/cros/system_api/dbus \
591 system \
592 external/gtest/include
593LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/client_library/include
594LOCAL_SHARED_LIBRARIES := \
595 libchrome \
596 libchrome-dbus \
Alex Vakulenko1bab5a82015-10-27 11:47:28 -0700597 libbrillo \
598 libbrillo-dbus
Christopher Wiley16daa082015-10-01 17:18:40 -0700599LOCAL_STATIC_LIBRARIES := \
600 update_engine_client-dbus-proxies
601LOCAL_SRC_FILES := \
602 client_library/client.cc \
Christopher Wiley16daa082015-10-01 17:18:40 -0700603 update_status_utils.cc
Casey Dahlina93cd532016-01-14 16:55:11 -0800604
Alex Deymo78a954f2016-01-21 20:32:40 -0800605ifeq ($(local_use_binder),1)
Casey Dahlina93cd532016-01-14 16:55:11 -0800606LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder_bindings
607LOCAL_SRC_FILES += \
608 client_library/client_binder.cc \
609 parcelable_update_engine_status.cc \
610 binder_bindings/android/brillo/IUpdateEngine.aidl \
611 binder_bindings/android/brillo/IUpdateEngineStatusCallback.aidl
612LOCAL_SHARED_LIBRARIES += \
613 libbinder \
614 libutils
Alex Deymo78a954f2016-01-21 20:32:40 -0800615else # local_use_binder != 1
Casey Dahlina93cd532016-01-14 16:55:11 -0800616LOCAL_SRC_FILES += client_library/client_dbus.cc
Alex Deymo78a954f2016-01-21 20:32:40 -0800617endif # local_use_binder == 1
Casey Dahlina93cd532016-01-14 16:55:11 -0800618
Christopher Wiley16daa082015-10-01 17:18:40 -0700619include $(BUILD_SHARED_LIBRARY)
620
Alex Deymo78a954f2016-01-21 20:32:40 -0800621endif # local_use_dbus == 1
Gaurav Shah263614f2015-09-24 14:20:38 -0700622
Alex Deymof7ead812015-10-23 17:37:27 -0700623# Weave schema files
624# ========================================================
625include $(CLEAR_VARS)
626LOCAL_MODULE := updater.json
627LOCAL_MODULE_CLASS := ETC
628LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/weaved/traits
629LOCAL_SRC_FILES := weaved/traits/$(LOCAL_MODULE)
630include $(BUILD_PREBUILT)
631
Gaurav Shah263614f2015-09-24 14:20:38 -0700632# Update payload signing public key.
633# ========================================================
634include $(CLEAR_VARS)
635LOCAL_MODULE := brillo-update-payload-key
636LOCAL_MODULE_CLASS := ETC
637LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/update_engine
638LOCAL_MODULE_STEM := update-payload-key.pub.pem
639LOCAL_SRC_FILES := update_payload_key/brillo-update-payload-key.pub.pem
640LOCAL_BUILT_MODULE_STEM := update_payload_key/brillo-update-payload-key.pub.pem
641include $(BUILD_PREBUILT)
Tao Bao042f8a12016-01-07 16:52:14 -0800642
643# Brillo update payload generation script
644# ========================================================
645ifeq ($(HOST_OS),linux)
646include $(CLEAR_VARS)
647LOCAL_SRC_FILES := scripts/brillo_update_payload
648LOCAL_MODULE := brillo_update_payload
649LOCAL_MODULE_CLASS := EXECUTABLES
650LOCAL_IS_HOST_MODULE := true
651LOCAL_MODULE_TAGS := optional
652LOCAL_REQUIRED_MODULES := \
653 delta_generator \
654 shflags
655include $(BUILD_PREBUILT)
656endif # HOST_OS == linux