blob: e4a957425f85025c12953c1a250f7b2625a23296 [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.
Alex Deymo4218b7e2015-11-17 21:14:42 -030020BRILLO_USE_DBUS ?= 1
Alex Deymo787dc412015-10-29 11:39:20 -070021BRILLO_USE_HWID_OVERRIDE ?= 0
22BRILLO_USE_MTD ?= 0
23BRILLO_USE_POWER_MANAGEMENT ?= 0
Alex Deymof7ead812015-10-23 17:37:27 -070024BRILLO_USE_WEAVE ?= 0
Alex Deymo787dc412015-10-29 11:39:20 -070025
Alex Deymoc372ab62015-10-29 00:43:26 -070026ue_common_cflags := \
Alex Deymo4218b7e2015-11-17 21:14:42 -030027 -DUSE_DBUS=$(BRILLO_USE_DBUS) \
Alex Deymo787dc412015-10-29 11:39:20 -070028 -DUSE_HWID_OVERRIDE=$(BRILLO_USE_HWID_OVERRIDE) \
29 -DUSE_MTD=$(BRILLO_USE_MTD) \
30 -DUSE_POWER_MANAGEMENT=$(BRILLO_USE_POWER_MANAGEMENT) \
Alex Deymof7ead812015-10-23 17:37:27 -070031 -DUSE_WEAVE=$(BRILLO_USE_WEAVE) \
Alex Deymoc372ab62015-10-29 00:43:26 -070032 -D_FILE_OFFSET_BITS=64 \
33 -D_POSIX_C_SOURCE=199309L \
34 -Wa,--noexecstack \
35 -Wall \
36 -Werror \
37 -Wextra \
38 -Wformat=2 \
39 -Wno-psabi \
40 -Wno-unused-parameter \
41 -ffunction-sections \
42 -fstack-protector-strong \
43 -fvisibility=hidden
44ue_common_cppflags := \
45 -Wnon-virtual-dtor \
46 -fno-strict-aliasing \
47 -std=gnu++11
48ue_common_ldflags := \
49 -Wl,--gc-sections
50ue_common_c_includes := \
51 $(LOCAL_PATH)/client_library/include \
52 external/gtest/include \
53 system
54ue_common_shared_libraries := \
55 libbrillo \
Alex Deymoc372ab62015-10-29 00:43:26 -070056 libbrillo-http \
57 libbrillo-stream \
Alex Deymo4218b7e2015-11-17 21:14:42 -030058 libchrome
Alex Deymod5561a52015-09-03 23:17:52 -070059
Alex Deymo4218b7e2015-11-17 21:14:42 -030060ifeq ($(BRILLO_USE_DBUS),1)
Alex Deymoc372ab62015-10-29 00:43:26 -070061
62# update_engine_client-dbus-proxies (from generate-dbus-proxies.gypi)
63# ========================================================
64include $(CLEAR_VARS)
65LOCAL_MODULE := update_engine_client-dbus-proxies
66LOCAL_MODULE_CLASS := STATIC_LIBRARIES
67LOCAL_SRC_FILES := \
68 dbus_bindings/dbus-service-config.json \
69 dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml
70LOCAL_DBUS_PROXY_PREFIX := update_engine
71include $(BUILD_STATIC_LIBRARY)
Alex Deymod5561a52015-09-03 23:17:52 -070072
Alex Deymo4218b7e2015-11-17 21:14:42 -030073endif # BRILLO_USE_DBUS == 1
74
Alex Deymod5561a52015-09-03 23:17:52 -070075# update_metadata-protos (type: static_library)
76# ========================================================
77# Protobufs.
Alex Deymoc372ab62015-10-29 00:43:26 -070078ue_update_metadata_protos_exported_static_libraries := \
79 update_metadata-protos
80ue_update_metadata_protos_exported_shared_libraries := \
Alex Vakulenkoab5bd662015-12-21 12:24:45 -080081 libprotobuf-cpp-lite
Alex Deymoc372ab62015-10-29 00:43:26 -070082
Alex Deymo05e0e382015-12-07 20:18:16 -080083ue_update_metadata_protos_src_files := \
84 update_metadata.proto
85
86# Build for the host.
Alex Deymod5561a52015-09-03 23:17:52 -070087include $(CLEAR_VARS)
88LOCAL_MODULE := update_metadata-protos
89LOCAL_MODULE_CLASS := STATIC_LIBRARIES
Ying Wangdbd17112015-12-17 11:59:09 -080090LOCAL_IS_HOST_MODULE := true
Alex Deymod5561a52015-09-03 23:17:52 -070091generated_sources_dir := $(call local-generated-sources-dir)
Alex Deymoc372ab62015-10-29 00:43:26 -070092LOCAL_EXPORT_C_INCLUDE_DIRS := $(generated_sources_dir)/proto/system
Alex Deymo05e0e382015-12-07 20:18:16 -080093LOCAL_SRC_FILES := $(ue_update_metadata_protos_src_files)
94include $(BUILD_HOST_STATIC_LIBRARY)
95
96# Build for the target.
97include $(CLEAR_VARS)
98LOCAL_MODULE := update_metadata-protos
99LOCAL_MODULE_CLASS := STATIC_LIBRARIES
100generated_sources_dir := $(call local-generated-sources-dir)
101LOCAL_EXPORT_C_INCLUDE_DIRS := $(generated_sources_dir)/proto/system
102LOCAL_SRC_FILES := $(ue_update_metadata_protos_src_files)
Alex Deymod5561a52015-09-03 23:17:52 -0700103include $(BUILD_STATIC_LIBRARY)
104
Alex Deymo4218b7e2015-11-17 21:14:42 -0300105ifeq ($(BRILLO_USE_DBUS),1)
106
Alex Deymod5561a52015-09-03 23:17:52 -0700107# update_engine-dbus-adaptor (from generate-dbus-adaptors.gypi)
108# ========================================================
Alex Deymoc372ab62015-10-29 00:43:26 -0700109# Chrome D-Bus bindings.
Alex Deymod5561a52015-09-03 23:17:52 -0700110include $(CLEAR_VARS)
111LOCAL_MODULE := update_engine-dbus-adaptor
Alex Deymoc372ab62015-10-29 00:43:26 -0700112LOCAL_MODULE_CLASS := STATIC_LIBRARIES
Alex Deymod5561a52015-09-03 23:17:52 -0700113LOCAL_SRC_FILES := \
114 dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml
115include $(BUILD_STATIC_LIBRARY)
116
117# update_engine-dbus-libcros-client (from generate-dbus-proxies.gypi)
118# ========================================================
119include $(CLEAR_VARS)
120LOCAL_MODULE := update_engine-dbus-libcros-client
Alex Deymoc372ab62015-10-29 00:43:26 -0700121LOCAL_MODULE_CLASS := STATIC_LIBRARIES
Alex Deymod5561a52015-09-03 23:17:52 -0700122LOCAL_SRC_FILES := \
123 dbus_bindings/org.chromium.LibCrosService.dbus-xml
124LOCAL_DBUS_PROXY_PREFIX := libcros
125include $(BUILD_STATIC_LIBRARY)
126
Alex Deymo4218b7e2015-11-17 21:14:42 -0300127endif # BRILLO_USE_DBUS == 1
128
Alex Deymo39910dc2015-11-09 17:04:30 -0800129# libpayload_consumer (type: static_library)
Alex Deymod5561a52015-09-03 23:17:52 -0700130# ========================================================
Alex Deymo39910dc2015-11-09 17:04:30 -0800131# The payload application component and common dependencies.
Alex Deymo39910dc2015-11-09 17:04:30 -0800132ue_libpayload_consumer_exported_static_libraries := \
133 update_metadata-protos \
Alex Deymo05e0e382015-12-07 20:18:16 -0800134 libxz-host \
Alex Deymo39910dc2015-11-09 17:04:30 -0800135 libbz \
Alex Deymo39910dc2015-11-09 17:04:30 -0800136 $(ue_update_metadata_protos_exported_static_libraries)
137ue_libpayload_consumer_exported_shared_libraries := \
Alex Deymo05e0e382015-12-07 20:18:16 -0800138 libcrypto-host \
139 libcurl-host \
140 libssl-host \
Alex Deymo39910dc2015-11-09 17:04:30 -0800141 $(ue_update_metadata_protos_exported_shared_libraries)
142
Alex Deymo05e0e382015-12-07 20:18:16 -0800143ue_libpayload_consumer_src_files := \
Alex Deymo39910dc2015-11-09 17:04:30 -0800144 common/action_processor.cc \
Alex Deymo39910dc2015-11-09 17:04:30 -0800145 common/boot_control_stub.cc \
146 common/certificate_checker.cc \
147 common/clock.cc \
148 common/constants.cc \
Alex Deymo39910dc2015-11-09 17:04:30 -0800149 common/hash_calculator.cc \
150 common/http_common.cc \
151 common/http_fetcher.cc \
152 common/hwid_override.cc \
153 common/libcurl_http_fetcher.cc \
154 common/multi_range_http_fetcher.cc \
155 common/platform_constants_android.cc \
156 common/prefs.cc \
157 common/subprocess.cc \
158 common/terminator.cc \
159 common/utils.cc \
160 payload_consumer/bzip_extent_writer.cc \
161 payload_consumer/delta_performer.cc \
162 payload_consumer/download_action.cc \
163 payload_consumer/extent_writer.cc \
164 payload_consumer/file_descriptor.cc \
165 payload_consumer/file_writer.cc \
166 payload_consumer/filesystem_verifier_action.cc \
167 payload_consumer/install_plan.cc \
168 payload_consumer/payload_constants.cc \
169 payload_consumer/payload_verifier.cc \
170 payload_consumer/postinstall_runner_action.cc \
171 payload_consumer/xz_extent_writer.cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800172
173ifeq ($(HOST_OS),linux)
174# Build for the host.
175include $(CLEAR_VARS)
176LOCAL_MODULE := libpayload_consumer
177LOCAL_MODULE_CLASS := STATIC_LIBRARIES
178LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800179LOCAL_CLANG := true
180LOCAL_CFLAGS := $(ue_common_cflags)
181LOCAL_CPPFLAGS := $(ue_common_cppflags)
182LOCAL_LDFLAGS := $(ue_common_ldflags)
183LOCAL_C_INCLUDES := \
184 $(ue_common_c_includes) \
185 external/e2fsprogs/lib
186LOCAL_STATIC_LIBRARIES := \
187 update_metadata-protos \
188 $(ue_libpayload_consumer_exported_static_libraries) \
189 $(ue_update_metadata_protos_exported_static_libraries)
190LOCAL_SHARED_LIBRARIES := \
191 $(ue_common_shared_libraries) \
192 $(ue_libpayload_consumer_exported_shared_libraries) \
193 $(ue_update_metadata_protos_exported_shared_libraries)
194LOCAL_SRC_FILES := $(ue_libpayload_consumer_src_files)
195include $(BUILD_HOST_STATIC_LIBRARY)
196endif # HOST_OS == linux
197
198# Build for the target.
199include $(CLEAR_VARS)
200LOCAL_MODULE := libpayload_consumer
201LOCAL_MODULE_CLASS := STATIC_LIBRARIES
202LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800203LOCAL_CLANG := true
204LOCAL_CFLAGS := $(ue_common_cflags)
205LOCAL_CPPFLAGS := $(ue_common_cppflags)
206LOCAL_LDFLAGS := $(ue_common_ldflags)
207LOCAL_C_INCLUDES := \
208 $(ue_common_c_includes) \
209 external/e2fsprogs/lib
210LOCAL_STATIC_LIBRARIES := \
211 update_metadata-protos \
212 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
213 $(ue_update_metadata_protos_exported_static_libraries)
214LOCAL_SHARED_LIBRARIES := \
215 $(ue_common_shared_libraries) \
216 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
217 $(ue_update_metadata_protos_exported_shared_libraries)
218LOCAL_SRC_FILES := $(ue_libpayload_consumer_src_files)
Alex Deymo39910dc2015-11-09 17:04:30 -0800219include $(BUILD_STATIC_LIBRARY)
220
Alex Deymocd60dca2015-11-18 00:57:20 -0300221ifeq ($(BRILLO_USE_DBUS),1)
Alex Deymo4218b7e2015-11-17 21:14:42 -0300222
Alex Deymo39910dc2015-11-09 17:04:30 -0800223# libupdate_engine (type: static_library)
224# ========================================================
225# The main daemon static_library with all the code used to check for updates
226# with Omaha and expose a DBus daemon.
227ue_libupdate_engine_exported_c_includes := \
228 $(LOCAL_PATH)/include \
Alex Deymob09305e2015-12-02 16:09:13 -0300229 external/cros/system_api/dbus
Alex Deymoc372ab62015-10-29 00:43:26 -0700230ue_libupdate_engine_exported_static_libraries := \
Alex Deymo39910dc2015-11-09 17:04:30 -0800231 libpayload_consumer \
Alex Deymod5561a52015-09-03 23:17:52 -0700232 update_metadata-protos \
233 update_engine-dbus-adaptor \
234 update_engine-dbus-libcros-client \
235 update_engine_client-dbus-proxies \
David Zeuthen753fadc2015-09-15 16:34:09 -0400236 libbz \
Alex Deymoc372ab62015-10-29 00:43:26 -0700237 libfs_mgr \
Alex Deymo39910dc2015-11-09 17:04:30 -0800238 $(ue_libpayload_consumer_exported_static_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700239 $(ue_update_metadata_protos_exported_static_libraries)
240ue_libupdate_engine_exported_shared_libraries := \
Alex Deymod5561a52015-09-03 23:17:52 -0700241 libdbus \
Alex Deymo05e0e382015-12-07 20:18:16 -0800242 libbrillo-dbus \
243 libchrome-dbus \
Alex Deymod5561a52015-09-03 23:17:52 -0700244 libmetrics \
Alex Deymo7eb23052015-10-09 15:27:59 -0700245 libshill-client \
Alex Deymod5561a52015-09-03 23:17:52 -0700246 libexpat \
Alex Vakulenko1bab5a82015-10-27 11:47:28 -0700247 libbrillo-policy \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700248 libhardware \
Alex Deymoc372ab62015-10-29 00:43:26 -0700249 libcutils \
Alex Deymo39910dc2015-11-09 17:04:30 -0800250 $(ue_libpayload_consumer_exported_shared_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700251 $(ue_update_metadata_protos_exported_shared_libraries)
Alex Deymof7ead812015-10-23 17:37:27 -0700252ifeq ($(BRILLO_USE_WEAVE),1)
253ue_libupdate_engine_exported_shared_libraries += \
254 libweaved
255endif # BRILLO_USE_WEAVE == 1
Alex Deymoc372ab62015-10-29 00:43:26 -0700256
257include $(CLEAR_VARS)
258LOCAL_MODULE := libupdate_engine
259LOCAL_MODULE_CLASS := STATIC_LIBRARIES
260LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700261LOCAL_CLANG := true
262LOCAL_EXPORT_C_INCLUDE_DIRS := $(ue_libupdate_engine_exported_c_includes)
263LOCAL_CFLAGS := $(ue_common_cflags)
264LOCAL_CPPFLAGS := $(ue_common_cppflags)
265LOCAL_LDFLAGS := $(ue_common_ldflags)
266LOCAL_C_INCLUDES := \
267 $(ue_common_c_includes) \
Alex Deymob09305e2015-12-02 16:09:13 -0300268 $(ue_libupdate_engine_exported_c_includes)
Alex Deymoc372ab62015-10-29 00:43:26 -0700269LOCAL_STATIC_LIBRARIES := \
Alex Deymo39910dc2015-11-09 17:04:30 -0800270 libpayload_consumer \
Alex Deymoc372ab62015-10-29 00:43:26 -0700271 update_metadata-protos \
272 update_engine-dbus-adaptor \
273 update_engine-dbus-libcros-client \
274 update_engine_client-dbus-proxies \
Alex Deymo05e0e382015-12-07 20:18:16 -0800275 $(ue_libupdate_engine_exported_static_libraries:-host=) \
276 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700277 $(ue_update_metadata_protos_exported_static_libraries)
278LOCAL_SHARED_LIBRARIES := \
279 $(ue_common_shared_libraries) \
Alex Deymo05e0e382015-12-07 20:18:16 -0800280 $(ue_libupdate_engine_exported_shared_libraries:-host=) \
281 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700282 $(ue_update_metadata_protos_exported_shared_libraries)
Alex Deymod5561a52015-09-03 23:17:52 -0700283LOCAL_SRC_FILES := \
Alex Deymo1b03f9f2015-12-09 00:38:36 -0800284 boot_control_android.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700285 chrome_browser_proxy_resolver.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700286 connection_manager.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700287 daemon.cc \
288 dbus_service.cc \
Alex Deymo1b03f9f2015-12-09 00:38:36 -0800289 hardware_android.cc \
Alex Deymo85616652015-10-15 18:48:31 -0700290 image_properties_android.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700291 libcros_proxy.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700292 metrics.cc \
Alex Deymo38429cf2015-11-11 18:27:22 -0800293 metrics_utils.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700294 omaha_request_action.cc \
295 omaha_request_params.cc \
296 omaha_response_handler_action.cc \
297 p2p_manager.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700298 payload_state.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700299 proxy_resolver.cc \
300 real_system_state.cc \
301 shill_proxy.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700302 update_attempter.cc \
303 update_manager/boxed_value.cc \
304 update_manager/chromeos_policy.cc \
305 update_manager/default_policy.cc \
306 update_manager/evaluation_context.cc \
307 update_manager/policy.cc \
308 update_manager/real_config_provider.cc \
309 update_manager/real_device_policy_provider.cc \
310 update_manager/real_random_provider.cc \
311 update_manager/real_shill_provider.cc \
312 update_manager/real_system_provider.cc \
313 update_manager/real_time_provider.cc \
314 update_manager/real_updater_provider.cc \
315 update_manager/state_factory.cc \
316 update_manager/update_manager.cc \
Alex Deymof7ead812015-10-23 17:37:27 -0700317 update_status_utils.cc \
318 weave_service_factory.cc
319ifeq ($(BRILLO_USE_WEAVE),1)
320LOCAL_SRC_FILES += \
321 weave_service.cc
322endif # BRILLO_USE_WEAVE == 1
Alex Deymod5561a52015-09-03 23:17:52 -0700323include $(BUILD_STATIC_LIBRARY)
324
Alex Deymocd60dca2015-11-18 00:57:20 -0300325endif # BRILLO_USE_DBUS == 1
Alex Deymo4218b7e2015-11-17 21:14:42 -0300326
Alex Deymod5561a52015-09-03 23:17:52 -0700327# update_engine (type: executable)
328# ========================================================
329# update_engine daemon.
330include $(CLEAR_VARS)
331LOCAL_MODULE := update_engine
332LOCAL_MODULE_CLASS := EXECUTABLES
Sen Jiang56092772015-11-23 14:41:00 -0800333LOCAL_REQUIRED_MODULES := \
Alex Deymoab494462015-11-30 17:07:36 -0300334 bspatch \
335 cacerts_google
Alex Deymof7ead812015-10-23 17:37:27 -0700336ifeq ($(BRILLO_USE_WEAVE),1)
337LOCAL_REQUIRED_MODULES += updater.json
338endif # BRILLO_USE_WEAVE == 1
Alex Deymoc372ab62015-10-29 00:43:26 -0700339LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700340LOCAL_CLANG := true
341LOCAL_CFLAGS := $(ue_common_cflags)
342LOCAL_CPPFLAGS := $(ue_common_cppflags)
343LOCAL_LDFLAGS := $(ue_common_ldflags)
344LOCAL_C_INCLUDES := \
Alex Deymo4218b7e2015-11-17 21:14:42 -0300345 $(ue_common_c_includes)
346
347ifdef BRILLO
348
349LOCAL_C_INCLUDES += \
Alex Deymoc372ab62015-10-29 00:43:26 -0700350 $(ue_libupdate_engine_exported_c_includes)
351LOCAL_STATIC_LIBRARIES := \
Alex Deymod5561a52015-09-03 23:17:52 -0700352 libupdate_engine \
Alex Deymo05e0e382015-12-07 20:18:16 -0800353 $(ue_libupdate_engine_exported_static_libraries:-host=)
Christopher Wiley9e1eda92015-11-16 15:23:37 -0800354
Alex Deymoc372ab62015-10-29 00:43:26 -0700355LOCAL_SHARED_LIBRARIES := \
356 $(ue_common_shared_libraries) \
Alex Deymo05e0e382015-12-07 20:18:16 -0800357 $(ue_libupdate_engine_exported_shared_libraries:-host=)
Alex Deymod5561a52015-09-03 23:17:52 -0700358LOCAL_SRC_FILES := \
359 main.cc
Christopher Wiley9e1eda92015-11-16 15:23:37 -0800360
361else # !defined(BRILLO)
362
363LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder_bindings
364LOCAL_SHARED_LIBRARIES := \
365 libbinder \
366 liblog \
367 libutils
368LOCAL_SRC_FILES := \
369 binder_bindings/android/os/IUpdateEngine.aidl \
370 binder_bindings/android/os/IUpdateEnginePayloadApplicationCallback.aidl \
371 binder_main.cc \
372 binder_service.cc
373
374endif # defined(BRILLO)
375
Gilad Arnold70141f22015-09-17 09:06:30 -0700376LOCAL_INIT_RC := update_engine.rc
Alex Deymod5561a52015-09-03 23:17:52 -0700377include $(BUILD_EXECUTABLE)
378
Alex Deymo4218b7e2015-11-17 21:14:42 -0300379ifeq ($(BRILLO_USE_DBUS),1)
380
Alex Deymod5561a52015-09-03 23:17:52 -0700381# update_engine_client (type: executable)
382# ========================================================
383# update_engine console client.
384include $(CLEAR_VARS)
385LOCAL_MODULE := update_engine_client
386LOCAL_MODULE_CLASS := EXECUTABLES
Alex Deymoc372ab62015-10-29 00:43:26 -0700387LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700388LOCAL_CLANG := true
389LOCAL_CFLAGS := $(ue_common_cflags)
390LOCAL_CPPFLAGS := $(ue_common_cppflags)
391LOCAL_LDFLAGS := $(ue_common_ldflags)
392LOCAL_C_INCLUDES := \
393 $(ue_common_c_includes) \
Alex Deymod5561a52015-09-03 23:17:52 -0700394 $(LOCAL_PATH)/include
Alex Deymoc372ab62015-10-29 00:43:26 -0700395LOCAL_STATIC_LIBRARIES := update_engine_client-dbus-proxies
Alex Deymo05e0e382015-12-07 20:18:16 -0800396LOCAL_SHARED_LIBRARIES := \
397 $(ue_common_shared_libraries) \
398 libdbus \
399 libbrillo-dbus \
Casey Dahline844c1a2015-12-16 14:30:58 -0800400 libchrome-dbus \
401 libupdate_engine_client
Alex Deymod5561a52015-09-03 23:17:52 -0700402LOCAL_SRC_FILES := \
403 update_engine_client.cc
Alex Deymod5561a52015-09-03 23:17:52 -0700404include $(BUILD_EXECUTABLE)
405
Alex Deymo4218b7e2015-11-17 21:14:42 -0300406endif # BRILLO_USE_DBUS == 1
407
Alex Deymod5561a52015-09-03 23:17:52 -0700408# libpayload_generator (type: static_library)
409# ========================================================
410# server-side code. This is used for delta_generator and unittests but not
411# for any client code.
Alex Deymoc372ab62015-10-29 00:43:26 -0700412ue_libpayload_generator_exported_static_libraries := \
Alex Deymob09305e2015-12-02 16:09:13 -0300413 libpayload_consumer \
Alex Deymoc372ab62015-10-29 00:43:26 -0700414 update_metadata-protos \
Alex Deymob09305e2015-12-02 16:09:13 -0300415 $(ue_libpayload_consumer_exported_static_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700416 $(ue_update_metadata_protos_exported_static_libraries)
417ue_libpayload_generator_exported_shared_libraries := \
Alex Deymo05e0e382015-12-07 20:18:16 -0800418 libext2fs-host \
Alex Deymob09305e2015-12-02 16:09:13 -0300419 $(ue_libpayload_consumer_exported_shared_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700420 $(ue_update_metadata_protos_exported_shared_libraries)
421
Alex Deymo05e0e382015-12-07 20:18:16 -0800422ue_libpayload_generator_src_files := \
Alex Deymod5561a52015-09-03 23:17:52 -0700423 payload_generator/ab_generator.cc \
424 payload_generator/annotated_operation.cc \
425 payload_generator/blob_file_writer.cc \
426 payload_generator/block_mapping.cc \
Alex Deymo0bc26112015-10-19 20:54:57 -0700427 payload_generator/bzip.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700428 payload_generator/cycle_breaker.cc \
429 payload_generator/delta_diff_generator.cc \
430 payload_generator/delta_diff_utils.cc \
431 payload_generator/ext2_filesystem.cc \
432 payload_generator/extent_ranges.cc \
433 payload_generator/extent_utils.cc \
434 payload_generator/full_update_generator.cc \
435 payload_generator/graph_types.cc \
436 payload_generator/graph_utils.cc \
437 payload_generator/inplace_generator.cc \
438 payload_generator/payload_file.cc \
439 payload_generator/payload_generation_config.cc \
440 payload_generator/payload_signer.cc \
441 payload_generator/raw_filesystem.cc \
442 payload_generator/tarjan.cc \
443 payload_generator/topological_sort.cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800444
445ifeq ($(HOST_OS),linux)
446# Build for the host.
447include $(CLEAR_VARS)
448LOCAL_MODULE := libpayload_generator
449LOCAL_MODULE_CLASS := STATIC_LIBRARIES
450LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800451LOCAL_CLANG := true
452LOCAL_CFLAGS := $(ue_common_cflags)
453LOCAL_CPPFLAGS := $(ue_common_cppflags)
454LOCAL_LDFLAGS := $(ue_common_ldflags)
455LOCAL_C_INCLUDES := $(ue_common_c_includes)
456LOCAL_STATIC_LIBRARIES := \
457 libpayload_consumer \
458 update_metadata-protos \
459 $(ue_libpayload_consumer_exported_static_libraries) \
460 $(ue_update_metadata_protos_exported_static_libraries)
461LOCAL_SHARED_LIBRARIES := \
462 $(ue_common_shared_libraries) \
463 $(ue_libpayload_generator_exported_shared_libraries) \
464 $(ue_libpayload_consumer_exported_shared_libraries) \
465 $(ue_update_metadata_protos_exported_shared_libraries)
466LOCAL_SRC_FILES := $(ue_libpayload_generator_src_files)
467include $(BUILD_HOST_STATIC_LIBRARY)
468endif # HOST_OS == linux
469
470# Build for the target.
471include $(CLEAR_VARS)
472LOCAL_MODULE := libpayload_generator
473LOCAL_MODULE_CLASS := STATIC_LIBRARIES
474LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800475LOCAL_CLANG := true
476LOCAL_CFLAGS := $(ue_common_cflags)
477LOCAL_CPPFLAGS := $(ue_common_cppflags)
478LOCAL_LDFLAGS := $(ue_common_ldflags)
479LOCAL_C_INCLUDES := $(ue_common_c_includes)
480LOCAL_STATIC_LIBRARIES := \
481 libpayload_consumer \
482 update_metadata-protos \
483 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
484 $(ue_update_metadata_protos_exported_static_libraries)
485LOCAL_SHARED_LIBRARIES := \
486 $(ue_common_shared_libraries) \
487 $(ue_libpayload_generator_exported_shared_libraries:-host=) \
488 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
489 $(ue_update_metadata_protos_exported_shared_libraries)
490LOCAL_SRC_FILES := $(ue_libpayload_generator_src_files)
Alex Deymod5561a52015-09-03 23:17:52 -0700491include $(BUILD_STATIC_LIBRARY)
492
493# delta_generator (type: executable)
494# ========================================================
495# server-side delta generator.
Alex Deymo05e0e382015-12-07 20:18:16 -0800496ue_delta_generator_src_files := \
497 payload_generator/generate_delta_main.cc
498
499ifeq ($(HOST_OS),linux)
500# Build for the host.
Alex Deymod5561a52015-09-03 23:17:52 -0700501include $(CLEAR_VARS)
502LOCAL_MODULE := delta_generator
503LOCAL_MODULE_CLASS := EXECUTABLES
Alex Deymoc372ab62015-10-29 00:43:26 -0700504LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700505LOCAL_CLANG := true
506LOCAL_CFLAGS := $(ue_common_cflags)
507LOCAL_CPPFLAGS := $(ue_common_cppflags)
508LOCAL_LDFLAGS := $(ue_common_ldflags)
Alex Deymob09305e2015-12-02 16:09:13 -0300509LOCAL_C_INCLUDES := $(ue_common_c_includes)
Alex Deymoc372ab62015-10-29 00:43:26 -0700510LOCAL_STATIC_LIBRARIES := \
Alex Deymob09305e2015-12-02 16:09:13 -0300511 libpayload_consumer \
Alex Deymoc372ab62015-10-29 00:43:26 -0700512 libpayload_generator \
Alex Deymob09305e2015-12-02 16:09:13 -0300513 $(ue_libpayload_consumer_exported_static_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700514 $(ue_libpayload_generator_exported_static_libraries)
515LOCAL_SHARED_LIBRARIES := \
516 $(ue_common_shared_libraries) \
Alex Deymob09305e2015-12-02 16:09:13 -0300517 $(ue_libpayload_consumer_exported_shared_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700518 $(ue_libpayload_generator_exported_shared_libraries)
Alex Deymo05e0e382015-12-07 20:18:16 -0800519LOCAL_SRC_FILES := $(ue_delta_generator_src_files)
520include $(BUILD_HOST_EXECUTABLE)
521endif # HOST_OS == linux
522
523# Build for the target.
524include $(CLEAR_VARS)
525LOCAL_MODULE := delta_generator
526LOCAL_MODULE_CLASS := EXECUTABLES
527LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800528LOCAL_CLANG := true
529LOCAL_CFLAGS := $(ue_common_cflags)
530LOCAL_CPPFLAGS := $(ue_common_cppflags)
531LOCAL_LDFLAGS := $(ue_common_ldflags)
532LOCAL_C_INCLUDES := $(ue_common_c_includes)
533LOCAL_STATIC_LIBRARIES := \
534 libpayload_consumer \
535 libpayload_generator \
536 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
537 $(ue_libpayload_generator_exported_static_libraries:-host=)
538LOCAL_SHARED_LIBRARIES := \
539 $(ue_common_shared_libraries) \
540 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
541 $(ue_libpayload_generator_exported_shared_libraries:-host=)
542LOCAL_SRC_FILES := $(ue_delta_generator_src_files)
Alex Deymod5561a52015-09-03 23:17:52 -0700543include $(BUILD_EXECUTABLE)
544
Alex Deymo4218b7e2015-11-17 21:14:42 -0300545ifeq ($(BRILLO_USE_DBUS),1)
546
Christopher Wiley16daa082015-10-01 17:18:40 -0700547# libupdate_engine_client
548# ========================================================
549include $(CLEAR_VARS)
550LOCAL_MODULE := libupdate_engine_client
Christopher Wiley16daa082015-10-01 17:18:40 -0700551LOCAL_CFLAGS := \
552 -Wall \
553 -Werror \
554 -Wno-unused-parameter
555LOCAL_CLANG := true
556LOCAL_CPP_EXTENSION := .cc
557LOCAL_C_INCLUDES := \
558 $(LOCAL_PATH)/client_library/include \
559 external/cros/system_api/dbus \
560 system \
561 external/gtest/include
562LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/client_library/include
563LOCAL_SHARED_LIBRARIES := \
564 libchrome \
565 libchrome-dbus \
Alex Vakulenko1bab5a82015-10-27 11:47:28 -0700566 libbrillo \
567 libbrillo-dbus
Christopher Wiley16daa082015-10-01 17:18:40 -0700568LOCAL_STATIC_LIBRARIES := \
569 update_engine_client-dbus-proxies
570LOCAL_SRC_FILES := \
571 client_library/client.cc \
572 client_library/client_impl.cc \
573 update_status_utils.cc
574include $(BUILD_SHARED_LIBRARY)
575
Alex Deymo4218b7e2015-11-17 21:14:42 -0300576endif # BRILLO_USE_DBUS == 1
Gaurav Shah263614f2015-09-24 14:20:38 -0700577
Alex Deymof7ead812015-10-23 17:37:27 -0700578# Weave schema files
579# ========================================================
580include $(CLEAR_VARS)
581LOCAL_MODULE := updater.json
582LOCAL_MODULE_CLASS := ETC
583LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/weaved/traits
584LOCAL_SRC_FILES := weaved/traits/$(LOCAL_MODULE)
585include $(BUILD_PREBUILT)
586
Gaurav Shah263614f2015-09-24 14:20:38 -0700587# Update payload signing public key.
588# ========================================================
589include $(CLEAR_VARS)
590LOCAL_MODULE := brillo-update-payload-key
591LOCAL_MODULE_CLASS := ETC
592LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/update_engine
593LOCAL_MODULE_STEM := update-payload-key.pub.pem
594LOCAL_SRC_FILES := update_payload_key/brillo-update-payload-key.pub.pem
595LOCAL_BUILT_MODULE_STEM := update_payload_key/brillo-update-payload-key.pub.pem
596include $(BUILD_PREBUILT)
Tao Bao042f8a12016-01-07 16:52:14 -0800597
598# Brillo update payload generation script
599# ========================================================
600ifeq ($(HOST_OS),linux)
601include $(CLEAR_VARS)
602LOCAL_SRC_FILES := scripts/brillo_update_payload
603LOCAL_MODULE := brillo_update_payload
604LOCAL_MODULE_CLASS := EXECUTABLES
605LOCAL_IS_HOST_MODULE := true
606LOCAL_MODULE_TAGS := optional
607LOCAL_REQUIRED_MODULES := \
608 delta_generator \
609 shflags
610include $(BUILD_PREBUILT)
611endif # HOST_OS == linux