blob: eefcec169cc2ccb6b1be51b53a8eedc5ad77bdcd [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 Deymo787dc412015-10-29 11:39:20 -070019# Default values for the USE flags. Override these USE flags from your product.
Casey Dahlina93cd532016-01-14 16:55:11 -080020BRILLO_USE_BINDER ?= 1
Alex Deymo4218b7e2015-11-17 21:14:42 -030021BRILLO_USE_DBUS ?= 1
Alex Deymo787dc412015-10-29 11:39:20 -070022BRILLO_USE_HWID_OVERRIDE ?= 0
23BRILLO_USE_MTD ?= 0
24BRILLO_USE_POWER_MANAGEMENT ?= 0
Alex Deymof7ead812015-10-23 17:37:27 -070025BRILLO_USE_WEAVE ?= 0
Alex Deymo787dc412015-10-29 11:39:20 -070026
Alex Deymoc372ab62015-10-29 00:43:26 -070027ue_common_cflags := \
Casey Dahlina93cd532016-01-14 16:55:11 -080028 -DUSE_BINDER=$(BRILLO_USE_BINDER) \
Alex Deymo4218b7e2015-11-17 21:14:42 -030029 -DUSE_DBUS=$(BRILLO_USE_DBUS) \
Alex Deymo787dc412015-10-29 11:39:20 -070030 -DUSE_HWID_OVERRIDE=$(BRILLO_USE_HWID_OVERRIDE) \
31 -DUSE_MTD=$(BRILLO_USE_MTD) \
32 -DUSE_POWER_MANAGEMENT=$(BRILLO_USE_POWER_MANAGEMENT) \
Alex Deymof7ead812015-10-23 17:37:27 -070033 -DUSE_WEAVE=$(BRILLO_USE_WEAVE) \
Alex Deymoc372ab62015-10-29 00:43:26 -070034 -D_FILE_OFFSET_BITS=64 \
35 -D_POSIX_C_SOURCE=199309L \
36 -Wa,--noexecstack \
37 -Wall \
38 -Werror \
39 -Wextra \
40 -Wformat=2 \
41 -Wno-psabi \
42 -Wno-unused-parameter \
43 -ffunction-sections \
44 -fstack-protector-strong \
45 -fvisibility=hidden
46ue_common_cppflags := \
47 -Wnon-virtual-dtor \
48 -fno-strict-aliasing \
49 -std=gnu++11
50ue_common_ldflags := \
51 -Wl,--gc-sections
52ue_common_c_includes := \
53 $(LOCAL_PATH)/client_library/include \
54 external/gtest/include \
55 system
56ue_common_shared_libraries := \
57 libbrillo \
Alex Deymoc372ab62015-10-29 00:43:26 -070058 libbrillo-http \
59 libbrillo-stream \
Alex Deymo4218b7e2015-11-17 21:14:42 -030060 libchrome
Alex Deymod5561a52015-09-03 23:17:52 -070061
Alex Deymo4218b7e2015-11-17 21:14:42 -030062ifeq ($(BRILLO_USE_DBUS),1)
Alex Deymoc372ab62015-10-29 00:43:26 -070063
64# update_engine_client-dbus-proxies (from generate-dbus-proxies.gypi)
65# ========================================================
66include $(CLEAR_VARS)
67LOCAL_MODULE := update_engine_client-dbus-proxies
68LOCAL_MODULE_CLASS := STATIC_LIBRARIES
69LOCAL_SRC_FILES := \
70 dbus_bindings/dbus-service-config.json \
71 dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml
72LOCAL_DBUS_PROXY_PREFIX := update_engine
73include $(BUILD_STATIC_LIBRARY)
Alex Deymod5561a52015-09-03 23:17:52 -070074
Alex Deymo4218b7e2015-11-17 21:14:42 -030075endif # BRILLO_USE_DBUS == 1
76
Alex Deymod5561a52015-09-03 23:17:52 -070077# update_metadata-protos (type: static_library)
78# ========================================================
79# Protobufs.
Alex Deymoc372ab62015-10-29 00:43:26 -070080ue_update_metadata_protos_exported_static_libraries := \
81 update_metadata-protos
82ue_update_metadata_protos_exported_shared_libraries := \
Alex Vakulenkoab5bd662015-12-21 12:24:45 -080083 libprotobuf-cpp-lite
Alex Deymoc372ab62015-10-29 00:43:26 -070084
Alex Deymo05e0e382015-12-07 20:18:16 -080085ue_update_metadata_protos_src_files := \
86 update_metadata.proto
87
88# Build for the host.
Alex Deymod5561a52015-09-03 23:17:52 -070089include $(CLEAR_VARS)
90LOCAL_MODULE := update_metadata-protos
91LOCAL_MODULE_CLASS := STATIC_LIBRARIES
Ying Wangdbd17112015-12-17 11:59:09 -080092LOCAL_IS_HOST_MODULE := true
Alex Deymod5561a52015-09-03 23:17:52 -070093generated_sources_dir := $(call local-generated-sources-dir)
Alex Deymoc372ab62015-10-29 00:43:26 -070094LOCAL_EXPORT_C_INCLUDE_DIRS := $(generated_sources_dir)/proto/system
Alex Deymo05e0e382015-12-07 20:18:16 -080095LOCAL_SRC_FILES := $(ue_update_metadata_protos_src_files)
96include $(BUILD_HOST_STATIC_LIBRARY)
97
98# Build for the target.
99include $(CLEAR_VARS)
100LOCAL_MODULE := update_metadata-protos
101LOCAL_MODULE_CLASS := STATIC_LIBRARIES
102generated_sources_dir := $(call local-generated-sources-dir)
103LOCAL_EXPORT_C_INCLUDE_DIRS := $(generated_sources_dir)/proto/system
104LOCAL_SRC_FILES := $(ue_update_metadata_protos_src_files)
Alex Deymod5561a52015-09-03 23:17:52 -0700105include $(BUILD_STATIC_LIBRARY)
106
Alex Deymo4218b7e2015-11-17 21:14:42 -0300107ifeq ($(BRILLO_USE_DBUS),1)
108
Alex Deymod5561a52015-09-03 23:17:52 -0700109# update_engine-dbus-adaptor (from generate-dbus-adaptors.gypi)
110# ========================================================
Alex Deymoc372ab62015-10-29 00:43:26 -0700111# Chrome D-Bus bindings.
Alex Deymod5561a52015-09-03 23:17:52 -0700112include $(CLEAR_VARS)
113LOCAL_MODULE := update_engine-dbus-adaptor
Alex Deymoc372ab62015-10-29 00:43:26 -0700114LOCAL_MODULE_CLASS := STATIC_LIBRARIES
Alex Deymod5561a52015-09-03 23:17:52 -0700115LOCAL_SRC_FILES := \
116 dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml
117include $(BUILD_STATIC_LIBRARY)
118
119# update_engine-dbus-libcros-client (from generate-dbus-proxies.gypi)
120# ========================================================
121include $(CLEAR_VARS)
122LOCAL_MODULE := update_engine-dbus-libcros-client
Alex Deymoc372ab62015-10-29 00:43:26 -0700123LOCAL_MODULE_CLASS := STATIC_LIBRARIES
Alex Deymod5561a52015-09-03 23:17:52 -0700124LOCAL_SRC_FILES := \
125 dbus_bindings/org.chromium.LibCrosService.dbus-xml
126LOCAL_DBUS_PROXY_PREFIX := libcros
127include $(BUILD_STATIC_LIBRARY)
128
Alex Deymo4218b7e2015-11-17 21:14:42 -0300129endif # BRILLO_USE_DBUS == 1
130
Alex Deymo39910dc2015-11-09 17:04:30 -0800131# libpayload_consumer (type: static_library)
Alex Deymod5561a52015-09-03 23:17:52 -0700132# ========================================================
Alex Deymo39910dc2015-11-09 17:04:30 -0800133# The payload application component and common dependencies.
Alex Deymo39910dc2015-11-09 17:04:30 -0800134ue_libpayload_consumer_exported_static_libraries := \
135 update_metadata-protos \
Alex Deymo05e0e382015-12-07 20:18:16 -0800136 libxz-host \
Alex Deymo39910dc2015-11-09 17:04:30 -0800137 libbz \
Alex Deymo39910dc2015-11-09 17:04:30 -0800138 $(ue_update_metadata_protos_exported_static_libraries)
139ue_libpayload_consumer_exported_shared_libraries := \
Alex Deymo05e0e382015-12-07 20:18:16 -0800140 libcrypto-host \
141 libcurl-host \
142 libssl-host \
Alex Deymo39910dc2015-11-09 17:04:30 -0800143 $(ue_update_metadata_protos_exported_shared_libraries)
144
Alex Deymo05e0e382015-12-07 20:18:16 -0800145ue_libpayload_consumer_src_files := \
Alex Deymo39910dc2015-11-09 17:04:30 -0800146 common/action_processor.cc \
Alex Deymo39910dc2015-11-09 17:04:30 -0800147 common/boot_control_stub.cc \
148 common/certificate_checker.cc \
149 common/clock.cc \
150 common/constants.cc \
Alex Deymo39910dc2015-11-09 17:04:30 -0800151 common/hash_calculator.cc \
152 common/http_common.cc \
153 common/http_fetcher.cc \
154 common/hwid_override.cc \
155 common/libcurl_http_fetcher.cc \
156 common/multi_range_http_fetcher.cc \
157 common/platform_constants_android.cc \
158 common/prefs.cc \
159 common/subprocess.cc \
160 common/terminator.cc \
161 common/utils.cc \
162 payload_consumer/bzip_extent_writer.cc \
163 payload_consumer/delta_performer.cc \
164 payload_consumer/download_action.cc \
165 payload_consumer/extent_writer.cc \
166 payload_consumer/file_descriptor.cc \
167 payload_consumer/file_writer.cc \
168 payload_consumer/filesystem_verifier_action.cc \
169 payload_consumer/install_plan.cc \
170 payload_consumer/payload_constants.cc \
171 payload_consumer/payload_verifier.cc \
172 payload_consumer/postinstall_runner_action.cc \
173 payload_consumer/xz_extent_writer.cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800174
175ifeq ($(HOST_OS),linux)
176# Build for the host.
177include $(CLEAR_VARS)
178LOCAL_MODULE := libpayload_consumer
179LOCAL_MODULE_CLASS := STATIC_LIBRARIES
180LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800181LOCAL_CLANG := true
182LOCAL_CFLAGS := $(ue_common_cflags)
183LOCAL_CPPFLAGS := $(ue_common_cppflags)
184LOCAL_LDFLAGS := $(ue_common_ldflags)
185LOCAL_C_INCLUDES := \
186 $(ue_common_c_includes) \
187 external/e2fsprogs/lib
188LOCAL_STATIC_LIBRARIES := \
189 update_metadata-protos \
190 $(ue_libpayload_consumer_exported_static_libraries) \
191 $(ue_update_metadata_protos_exported_static_libraries)
192LOCAL_SHARED_LIBRARIES := \
193 $(ue_common_shared_libraries) \
194 $(ue_libpayload_consumer_exported_shared_libraries) \
195 $(ue_update_metadata_protos_exported_shared_libraries)
196LOCAL_SRC_FILES := $(ue_libpayload_consumer_src_files)
197include $(BUILD_HOST_STATIC_LIBRARY)
198endif # HOST_OS == linux
199
200# Build for the target.
201include $(CLEAR_VARS)
202LOCAL_MODULE := libpayload_consumer
203LOCAL_MODULE_CLASS := STATIC_LIBRARIES
204LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800205LOCAL_CLANG := true
206LOCAL_CFLAGS := $(ue_common_cflags)
207LOCAL_CPPFLAGS := $(ue_common_cppflags)
208LOCAL_LDFLAGS := $(ue_common_ldflags)
209LOCAL_C_INCLUDES := \
210 $(ue_common_c_includes) \
211 external/e2fsprogs/lib
212LOCAL_STATIC_LIBRARIES := \
213 update_metadata-protos \
214 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
215 $(ue_update_metadata_protos_exported_static_libraries)
216LOCAL_SHARED_LIBRARIES := \
217 $(ue_common_shared_libraries) \
218 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
219 $(ue_update_metadata_protos_exported_shared_libraries)
220LOCAL_SRC_FILES := $(ue_libpayload_consumer_src_files)
Alex Deymo39910dc2015-11-09 17:04:30 -0800221include $(BUILD_STATIC_LIBRARY)
222
Alex Deymocd60dca2015-11-18 00:57:20 -0300223ifeq ($(BRILLO_USE_DBUS),1)
Alex Deymo4218b7e2015-11-17 21:14:42 -0300224
Alex Deymo39910dc2015-11-09 17:04:30 -0800225# libupdate_engine (type: static_library)
226# ========================================================
227# The main daemon static_library with all the code used to check for updates
228# with Omaha and expose a DBus daemon.
229ue_libupdate_engine_exported_c_includes := \
230 $(LOCAL_PATH)/include \
Alex Deymob09305e2015-12-02 16:09:13 -0300231 external/cros/system_api/dbus
Alex Deymoc372ab62015-10-29 00:43:26 -0700232ue_libupdate_engine_exported_static_libraries := \
Alex Deymo39910dc2015-11-09 17:04:30 -0800233 libpayload_consumer \
Alex Deymod5561a52015-09-03 23:17:52 -0700234 update_metadata-protos \
235 update_engine-dbus-adaptor \
236 update_engine-dbus-libcros-client \
237 update_engine_client-dbus-proxies \
David Zeuthen753fadc2015-09-15 16:34:09 -0400238 libbz \
Alex Deymoc372ab62015-10-29 00:43:26 -0700239 libfs_mgr \
Alex Deymo39910dc2015-11-09 17:04:30 -0800240 $(ue_libpayload_consumer_exported_static_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700241 $(ue_update_metadata_protos_exported_static_libraries)
242ue_libupdate_engine_exported_shared_libraries := \
Alex Deymod5561a52015-09-03 23:17:52 -0700243 libdbus \
Alex Deymo05e0e382015-12-07 20:18:16 -0800244 libbrillo-dbus \
245 libchrome-dbus \
Alex Deymod5561a52015-09-03 23:17:52 -0700246 libmetrics \
Alex Deymo7eb23052015-10-09 15:27:59 -0700247 libshill-client \
Alex Deymod5561a52015-09-03 23:17:52 -0700248 libexpat \
Alex Vakulenko1bab5a82015-10-27 11:47:28 -0700249 libbrillo-policy \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700250 libhardware \
Alex Deymoc372ab62015-10-29 00:43:26 -0700251 libcutils \
Alex Deymo39910dc2015-11-09 17:04:30 -0800252 $(ue_libpayload_consumer_exported_shared_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700253 $(ue_update_metadata_protos_exported_shared_libraries)
Alex Deymof7ead812015-10-23 17:37:27 -0700254ifeq ($(BRILLO_USE_WEAVE),1)
255ue_libupdate_engine_exported_shared_libraries += \
Alex Vakulenkoe119e6a2016-01-06 17:13:11 -0800256 libbinderwrapper \
257 libbrillo-binder \
Alex Deymof7ead812015-10-23 17:37:27 -0700258 libweaved
259endif # BRILLO_USE_WEAVE == 1
Alex Deymoc372ab62015-10-29 00:43:26 -0700260
261include $(CLEAR_VARS)
262LOCAL_MODULE := libupdate_engine
263LOCAL_MODULE_CLASS := STATIC_LIBRARIES
264LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700265LOCAL_CLANG := true
266LOCAL_EXPORT_C_INCLUDE_DIRS := $(ue_libupdate_engine_exported_c_includes)
267LOCAL_CFLAGS := $(ue_common_cflags)
268LOCAL_CPPFLAGS := $(ue_common_cppflags)
269LOCAL_LDFLAGS := $(ue_common_ldflags)
270LOCAL_C_INCLUDES := \
271 $(ue_common_c_includes) \
Alex Deymob09305e2015-12-02 16:09:13 -0300272 $(ue_libupdate_engine_exported_c_includes)
Alex Deymoc372ab62015-10-29 00:43:26 -0700273LOCAL_STATIC_LIBRARIES := \
Alex Deymo39910dc2015-11-09 17:04:30 -0800274 libpayload_consumer \
Alex Deymoc372ab62015-10-29 00:43:26 -0700275 update_metadata-protos \
276 update_engine-dbus-adaptor \
277 update_engine-dbus-libcros-client \
278 update_engine_client-dbus-proxies \
Alex Deymo05e0e382015-12-07 20:18:16 -0800279 $(ue_libupdate_engine_exported_static_libraries:-host=) \
280 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700281 $(ue_update_metadata_protos_exported_static_libraries)
282LOCAL_SHARED_LIBRARIES := \
283 $(ue_common_shared_libraries) \
Alex Deymo05e0e382015-12-07 20:18:16 -0800284 $(ue_libupdate_engine_exported_shared_libraries:-host=) \
285 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700286 $(ue_update_metadata_protos_exported_shared_libraries)
Alex Deymod5561a52015-09-03 23:17:52 -0700287LOCAL_SRC_FILES := \
Alex Deymo1b03f9f2015-12-09 00:38:36 -0800288 boot_control_android.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700289 chrome_browser_proxy_resolver.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700290 connection_manager.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700291 daemon.cc \
Casey Dahlina93cd532016-01-14 16:55:11 -0800292 common_service.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700293 dbus_service.cc \
Alex Deymo1b03f9f2015-12-09 00:38:36 -0800294 hardware_android.cc \
Alex Deymo85616652015-10-15 18:48:31 -0700295 image_properties_android.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700296 libcros_proxy.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700297 metrics.cc \
Alex Deymo38429cf2015-11-11 18:27:22 -0800298 metrics_utils.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700299 omaha_request_action.cc \
300 omaha_request_params.cc \
301 omaha_response_handler_action.cc \
302 p2p_manager.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700303 payload_state.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700304 proxy_resolver.cc \
305 real_system_state.cc \
306 shill_proxy.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700307 update_attempter.cc \
308 update_manager/boxed_value.cc \
309 update_manager/chromeos_policy.cc \
310 update_manager/default_policy.cc \
311 update_manager/evaluation_context.cc \
312 update_manager/policy.cc \
313 update_manager/real_config_provider.cc \
314 update_manager/real_device_policy_provider.cc \
315 update_manager/real_random_provider.cc \
316 update_manager/real_shill_provider.cc \
317 update_manager/real_system_provider.cc \
318 update_manager/real_time_provider.cc \
319 update_manager/real_updater_provider.cc \
320 update_manager/state_factory.cc \
321 update_manager/update_manager.cc \
Alex Deymof7ead812015-10-23 17:37:27 -0700322 update_status_utils.cc \
323 weave_service_factory.cc
324ifeq ($(BRILLO_USE_WEAVE),1)
325LOCAL_SRC_FILES += \
326 weave_service.cc
327endif # BRILLO_USE_WEAVE == 1
Casey Dahlina93cd532016-01-14 16:55:11 -0800328
329ifeq ($(BRILLO_USE_BINDER),1)
330LOCAL_AIDL_INCLUDES += $(LOCAL_PATH)/binder_bindings
331
332LOCAL_SRC_FILES += \
333 binder_bindings/android/brillo/IUpdateEngine.aidl \
334 binder_bindings/android/brillo/IUpdateEngineStatusCallback.aidl \
335 binder_service.cc \
336 parcelable_update_engine_status.cc
337
338LOCAL_SHARED_LIBRARIES += \
339 libbinder \
340 libutils
341endif # BRILLO_USE_BINDER == 1
342
Alex Deymod5561a52015-09-03 23:17:52 -0700343include $(BUILD_STATIC_LIBRARY)
344
Alex Deymocd60dca2015-11-18 00:57:20 -0300345endif # BRILLO_USE_DBUS == 1
Alex Deymo4218b7e2015-11-17 21:14:42 -0300346
Alex Deymod5561a52015-09-03 23:17:52 -0700347# update_engine (type: executable)
348# ========================================================
349# update_engine daemon.
350include $(CLEAR_VARS)
351LOCAL_MODULE := update_engine
352LOCAL_MODULE_CLASS := EXECUTABLES
Sen Jiang56092772015-11-23 14:41:00 -0800353LOCAL_REQUIRED_MODULES := \
Alex Deymoab494462015-11-30 17:07:36 -0300354 bspatch \
355 cacerts_google
Alex Deymof7ead812015-10-23 17:37:27 -0700356ifeq ($(BRILLO_USE_WEAVE),1)
357LOCAL_REQUIRED_MODULES += updater.json
358endif # BRILLO_USE_WEAVE == 1
Alex Deymoc372ab62015-10-29 00:43:26 -0700359LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700360LOCAL_CLANG := true
361LOCAL_CFLAGS := $(ue_common_cflags)
362LOCAL_CPPFLAGS := $(ue_common_cppflags)
363LOCAL_LDFLAGS := $(ue_common_ldflags)
364LOCAL_C_INCLUDES := \
Alex Deymo4218b7e2015-11-17 21:14:42 -0300365 $(ue_common_c_includes)
366
367ifdef BRILLO
368
369LOCAL_C_INCLUDES += \
Alex Deymoc372ab62015-10-29 00:43:26 -0700370 $(ue_libupdate_engine_exported_c_includes)
371LOCAL_STATIC_LIBRARIES := \
Alex Deymod5561a52015-09-03 23:17:52 -0700372 libupdate_engine \
Alex Deymo05e0e382015-12-07 20:18:16 -0800373 $(ue_libupdate_engine_exported_static_libraries:-host=)
Christopher Wiley9e1eda92015-11-16 15:23:37 -0800374
Alex Deymoc372ab62015-10-29 00:43:26 -0700375LOCAL_SHARED_LIBRARIES := \
376 $(ue_common_shared_libraries) \
Alex Deymo05e0e382015-12-07 20:18:16 -0800377 $(ue_libupdate_engine_exported_shared_libraries:-host=)
Alex Deymod5561a52015-09-03 23:17:52 -0700378LOCAL_SRC_FILES := \
379 main.cc
Christopher Wiley9e1eda92015-11-16 15:23:37 -0800380
381else # !defined(BRILLO)
382
383LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder_bindings
384LOCAL_SHARED_LIBRARIES := \
385 libbinder \
386 liblog \
387 libutils
388LOCAL_SRC_FILES := \
389 binder_bindings/android/os/IUpdateEngine.aidl \
Tao Baoe78e3fb2016-01-04 17:57:53 -0800390 binder_bindings/android/os/IUpdateEngineCallback.aidl \
Christopher Wiley9e1eda92015-11-16 15:23:37 -0800391 binder_main.cc \
Casey Dahlina93cd532016-01-14 16:55:11 -0800392 binder_service_android.cc
Christopher Wiley9e1eda92015-11-16 15:23:37 -0800393
394endif # defined(BRILLO)
395
Casey Dahlina93cd532016-01-14 16:55:11 -0800396ifeq ($(BRILLO_USE_BINDER),1)
397LOCAL_SHARED_LIBRARIES += \
398 libbinder \
399 libutils
400endif # BRILLO_USE_BINDER == 1
401
402
Gilad Arnold70141f22015-09-17 09:06:30 -0700403LOCAL_INIT_RC := update_engine.rc
Alex Deymod5561a52015-09-03 23:17:52 -0700404include $(BUILD_EXECUTABLE)
405
Alex Deymo4218b7e2015-11-17 21:14:42 -0300406ifeq ($(BRILLO_USE_DBUS),1)
407
Alex Deymod5561a52015-09-03 23:17:52 -0700408# update_engine_client (type: executable)
409# ========================================================
410# update_engine console client.
411include $(CLEAR_VARS)
412LOCAL_MODULE := update_engine_client
413LOCAL_MODULE_CLASS := EXECUTABLES
Alex Deymoc372ab62015-10-29 00:43:26 -0700414LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700415LOCAL_CLANG := true
416LOCAL_CFLAGS := $(ue_common_cflags)
417LOCAL_CPPFLAGS := $(ue_common_cppflags)
418LOCAL_LDFLAGS := $(ue_common_ldflags)
419LOCAL_C_INCLUDES := \
420 $(ue_common_c_includes) \
Alex Deymod5561a52015-09-03 23:17:52 -0700421 $(LOCAL_PATH)/include
Alex Deymoc372ab62015-10-29 00:43:26 -0700422LOCAL_STATIC_LIBRARIES := update_engine_client-dbus-proxies
Alex Deymo05e0e382015-12-07 20:18:16 -0800423LOCAL_SHARED_LIBRARIES := \
424 $(ue_common_shared_libraries) \
425 libdbus \
426 libbrillo-dbus \
Casey Dahline844c1a2015-12-16 14:30:58 -0800427 libchrome-dbus \
428 libupdate_engine_client
Alex Deymod5561a52015-09-03 23:17:52 -0700429LOCAL_SRC_FILES := \
430 update_engine_client.cc
Alex Deymod5561a52015-09-03 23:17:52 -0700431include $(BUILD_EXECUTABLE)
432
Alex Deymo4218b7e2015-11-17 21:14:42 -0300433endif # BRILLO_USE_DBUS == 1
434
Alex Deymod5561a52015-09-03 23:17:52 -0700435# libpayload_generator (type: static_library)
436# ========================================================
437# server-side code. This is used for delta_generator and unittests but not
438# for any client code.
Alex Deymoc372ab62015-10-29 00:43:26 -0700439ue_libpayload_generator_exported_static_libraries := \
Alex Deymob09305e2015-12-02 16:09:13 -0300440 libpayload_consumer \
Alex Deymoc372ab62015-10-29 00:43:26 -0700441 update_metadata-protos \
Alex Deymob09305e2015-12-02 16:09:13 -0300442 $(ue_libpayload_consumer_exported_static_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700443 $(ue_update_metadata_protos_exported_static_libraries)
444ue_libpayload_generator_exported_shared_libraries := \
Alex Deymo05e0e382015-12-07 20:18:16 -0800445 libext2fs-host \
Alex Deymob09305e2015-12-02 16:09:13 -0300446 $(ue_libpayload_consumer_exported_shared_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700447 $(ue_update_metadata_protos_exported_shared_libraries)
448
Alex Deymo05e0e382015-12-07 20:18:16 -0800449ue_libpayload_generator_src_files := \
Alex Deymod5561a52015-09-03 23:17:52 -0700450 payload_generator/ab_generator.cc \
451 payload_generator/annotated_operation.cc \
452 payload_generator/blob_file_writer.cc \
453 payload_generator/block_mapping.cc \
Alex Deymo0bc26112015-10-19 20:54:57 -0700454 payload_generator/bzip.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700455 payload_generator/cycle_breaker.cc \
456 payload_generator/delta_diff_generator.cc \
457 payload_generator/delta_diff_utils.cc \
458 payload_generator/ext2_filesystem.cc \
459 payload_generator/extent_ranges.cc \
460 payload_generator/extent_utils.cc \
461 payload_generator/full_update_generator.cc \
462 payload_generator/graph_types.cc \
463 payload_generator/graph_utils.cc \
464 payload_generator/inplace_generator.cc \
465 payload_generator/payload_file.cc \
466 payload_generator/payload_generation_config.cc \
467 payload_generator/payload_signer.cc \
468 payload_generator/raw_filesystem.cc \
469 payload_generator/tarjan.cc \
470 payload_generator/topological_sort.cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800471
472ifeq ($(HOST_OS),linux)
473# Build for the host.
474include $(CLEAR_VARS)
475LOCAL_MODULE := libpayload_generator
476LOCAL_MODULE_CLASS := STATIC_LIBRARIES
477LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800478LOCAL_CLANG := true
479LOCAL_CFLAGS := $(ue_common_cflags)
480LOCAL_CPPFLAGS := $(ue_common_cppflags)
481LOCAL_LDFLAGS := $(ue_common_ldflags)
482LOCAL_C_INCLUDES := $(ue_common_c_includes)
483LOCAL_STATIC_LIBRARIES := \
484 libpayload_consumer \
485 update_metadata-protos \
486 $(ue_libpayload_consumer_exported_static_libraries) \
487 $(ue_update_metadata_protos_exported_static_libraries)
488LOCAL_SHARED_LIBRARIES := \
489 $(ue_common_shared_libraries) \
490 $(ue_libpayload_generator_exported_shared_libraries) \
491 $(ue_libpayload_consumer_exported_shared_libraries) \
492 $(ue_update_metadata_protos_exported_shared_libraries)
493LOCAL_SRC_FILES := $(ue_libpayload_generator_src_files)
494include $(BUILD_HOST_STATIC_LIBRARY)
495endif # HOST_OS == linux
496
497# Build for the target.
498include $(CLEAR_VARS)
499LOCAL_MODULE := libpayload_generator
500LOCAL_MODULE_CLASS := STATIC_LIBRARIES
501LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800502LOCAL_CLANG := true
503LOCAL_CFLAGS := $(ue_common_cflags)
504LOCAL_CPPFLAGS := $(ue_common_cppflags)
505LOCAL_LDFLAGS := $(ue_common_ldflags)
506LOCAL_C_INCLUDES := $(ue_common_c_includes)
507LOCAL_STATIC_LIBRARIES := \
508 libpayload_consumer \
509 update_metadata-protos \
510 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
511 $(ue_update_metadata_protos_exported_static_libraries)
512LOCAL_SHARED_LIBRARIES := \
513 $(ue_common_shared_libraries) \
514 $(ue_libpayload_generator_exported_shared_libraries:-host=) \
515 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
516 $(ue_update_metadata_protos_exported_shared_libraries)
517LOCAL_SRC_FILES := $(ue_libpayload_generator_src_files)
Alex Deymod5561a52015-09-03 23:17:52 -0700518include $(BUILD_STATIC_LIBRARY)
519
520# delta_generator (type: executable)
521# ========================================================
522# server-side delta generator.
Alex Deymo05e0e382015-12-07 20:18:16 -0800523ue_delta_generator_src_files := \
524 payload_generator/generate_delta_main.cc
525
526ifeq ($(HOST_OS),linux)
527# Build for the host.
Alex Deymod5561a52015-09-03 23:17:52 -0700528include $(CLEAR_VARS)
529LOCAL_MODULE := delta_generator
530LOCAL_MODULE_CLASS := EXECUTABLES
Alex Deymoc372ab62015-10-29 00:43:26 -0700531LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700532LOCAL_CLANG := true
533LOCAL_CFLAGS := $(ue_common_cflags)
534LOCAL_CPPFLAGS := $(ue_common_cppflags)
535LOCAL_LDFLAGS := $(ue_common_ldflags)
Alex Deymob09305e2015-12-02 16:09:13 -0300536LOCAL_C_INCLUDES := $(ue_common_c_includes)
Alex Deymoc372ab62015-10-29 00:43:26 -0700537LOCAL_STATIC_LIBRARIES := \
Alex Deymob09305e2015-12-02 16:09:13 -0300538 libpayload_consumer \
Alex Deymoc372ab62015-10-29 00:43:26 -0700539 libpayload_generator \
Alex Deymob09305e2015-12-02 16:09:13 -0300540 $(ue_libpayload_consumer_exported_static_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700541 $(ue_libpayload_generator_exported_static_libraries)
542LOCAL_SHARED_LIBRARIES := \
543 $(ue_common_shared_libraries) \
Alex Deymob09305e2015-12-02 16:09:13 -0300544 $(ue_libpayload_consumer_exported_shared_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700545 $(ue_libpayload_generator_exported_shared_libraries)
Alex Deymo05e0e382015-12-07 20:18:16 -0800546LOCAL_SRC_FILES := $(ue_delta_generator_src_files)
547include $(BUILD_HOST_EXECUTABLE)
548endif # HOST_OS == linux
549
550# Build for the target.
551include $(CLEAR_VARS)
552LOCAL_MODULE := delta_generator
553LOCAL_MODULE_CLASS := EXECUTABLES
554LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800555LOCAL_CLANG := true
556LOCAL_CFLAGS := $(ue_common_cflags)
557LOCAL_CPPFLAGS := $(ue_common_cppflags)
558LOCAL_LDFLAGS := $(ue_common_ldflags)
559LOCAL_C_INCLUDES := $(ue_common_c_includes)
560LOCAL_STATIC_LIBRARIES := \
561 libpayload_consumer \
562 libpayload_generator \
563 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
564 $(ue_libpayload_generator_exported_static_libraries:-host=)
565LOCAL_SHARED_LIBRARIES := \
566 $(ue_common_shared_libraries) \
567 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
568 $(ue_libpayload_generator_exported_shared_libraries:-host=)
569LOCAL_SRC_FILES := $(ue_delta_generator_src_files)
Alex Deymod5561a52015-09-03 23:17:52 -0700570include $(BUILD_EXECUTABLE)
571
Alex Deymo4218b7e2015-11-17 21:14:42 -0300572ifeq ($(BRILLO_USE_DBUS),1)
573
Christopher Wiley16daa082015-10-01 17:18:40 -0700574# libupdate_engine_client
575# ========================================================
576include $(CLEAR_VARS)
577LOCAL_MODULE := libupdate_engine_client
Christopher Wiley16daa082015-10-01 17:18:40 -0700578LOCAL_CFLAGS := \
579 -Wall \
580 -Werror \
Casey Dahlina93cd532016-01-14 16:55:11 -0800581 -Wno-unused-parameter \
582 -DUSE_BINDER=$(BRILLO_USE_BINDER)
Christopher Wiley16daa082015-10-01 17:18:40 -0700583LOCAL_CLANG := true
584LOCAL_CPP_EXTENSION := .cc
585LOCAL_C_INCLUDES := \
586 $(LOCAL_PATH)/client_library/include \
587 external/cros/system_api/dbus \
588 system \
589 external/gtest/include
590LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/client_library/include
591LOCAL_SHARED_LIBRARIES := \
592 libchrome \
593 libchrome-dbus \
Alex Vakulenko1bab5a82015-10-27 11:47:28 -0700594 libbrillo \
595 libbrillo-dbus
Christopher Wiley16daa082015-10-01 17:18:40 -0700596LOCAL_STATIC_LIBRARIES := \
597 update_engine_client-dbus-proxies
598LOCAL_SRC_FILES := \
599 client_library/client.cc \
Christopher Wiley16daa082015-10-01 17:18:40 -0700600 update_status_utils.cc
Casey Dahlina93cd532016-01-14 16:55:11 -0800601
602ifeq ($(BRILLO_USE_BINDER),1)
603LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder_bindings
604LOCAL_SRC_FILES += \
605 client_library/client_binder.cc \
606 parcelable_update_engine_status.cc \
607 binder_bindings/android/brillo/IUpdateEngine.aidl \
608 binder_bindings/android/brillo/IUpdateEngineStatusCallback.aidl
609LOCAL_SHARED_LIBRARIES += \
610 libbinder \
611 libutils
612else # BRILLO_USE_BINDER != 1
613LOCAL_SRC_FILES += client_library/client_dbus.cc
614endif # BRILLO_USE_BINDER == 1
615
Christopher Wiley16daa082015-10-01 17:18:40 -0700616include $(BUILD_SHARED_LIBRARY)
617
Alex Deymo4218b7e2015-11-17 21:14:42 -0300618endif # BRILLO_USE_DBUS == 1
Gaurav Shah263614f2015-09-24 14:20:38 -0700619
Alex Deymof7ead812015-10-23 17:37:27 -0700620# Weave schema files
621# ========================================================
622include $(CLEAR_VARS)
623LOCAL_MODULE := updater.json
624LOCAL_MODULE_CLASS := ETC
625LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/weaved/traits
626LOCAL_SRC_FILES := weaved/traits/$(LOCAL_MODULE)
627include $(BUILD_PREBUILT)
628
Gaurav Shah263614f2015-09-24 14:20:38 -0700629# Update payload signing public key.
630# ========================================================
631include $(CLEAR_VARS)
632LOCAL_MODULE := brillo-update-payload-key
633LOCAL_MODULE_CLASS := ETC
634LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/update_engine
635LOCAL_MODULE_STEM := update-payload-key.pub.pem
636LOCAL_SRC_FILES := update_payload_key/brillo-update-payload-key.pub.pem
637LOCAL_BUILT_MODULE_STEM := update_payload_key/brillo-update-payload-key.pub.pem
638include $(BUILD_PREBUILT)
Tao Bao042f8a12016-01-07 16:52:14 -0800639
640# Brillo update payload generation script
641# ========================================================
642ifeq ($(HOST_OS),linux)
643include $(CLEAR_VARS)
644LOCAL_SRC_FILES := scripts/brillo_update_payload
645LOCAL_MODULE := brillo_update_payload
646LOCAL_MODULE_CLASS := EXECUTABLES
647LOCAL_IS_HOST_MODULE := true
648LOCAL_MODULE_TAGS := optional
649LOCAL_REQUIRED_MODULES := \
650 delta_generator \
651 shflags
652include $(BUILD_PREBUILT)
653endif # HOST_OS == linux