blob: fa6c067e6c469772aac2a3f79500bd69cb917de0 [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 += \
Alex Vakulenkoe119e6a2016-01-06 17:13:11 -0800254 libbinderwrapper \
255 libbrillo-binder \
Alex Deymof7ead812015-10-23 17:37:27 -0700256 libweaved
257endif # BRILLO_USE_WEAVE == 1
Alex Deymoc372ab62015-10-29 00:43:26 -0700258
259include $(CLEAR_VARS)
260LOCAL_MODULE := libupdate_engine
261LOCAL_MODULE_CLASS := STATIC_LIBRARIES
262LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700263LOCAL_CLANG := true
264LOCAL_EXPORT_C_INCLUDE_DIRS := $(ue_libupdate_engine_exported_c_includes)
265LOCAL_CFLAGS := $(ue_common_cflags)
266LOCAL_CPPFLAGS := $(ue_common_cppflags)
267LOCAL_LDFLAGS := $(ue_common_ldflags)
268LOCAL_C_INCLUDES := \
269 $(ue_common_c_includes) \
Alex Deymob09305e2015-12-02 16:09:13 -0300270 $(ue_libupdate_engine_exported_c_includes)
Alex Deymoc372ab62015-10-29 00:43:26 -0700271LOCAL_STATIC_LIBRARIES := \
Alex Deymo39910dc2015-11-09 17:04:30 -0800272 libpayload_consumer \
Alex Deymoc372ab62015-10-29 00:43:26 -0700273 update_metadata-protos \
274 update_engine-dbus-adaptor \
275 update_engine-dbus-libcros-client \
276 update_engine_client-dbus-proxies \
Alex Deymo05e0e382015-12-07 20:18:16 -0800277 $(ue_libupdate_engine_exported_static_libraries:-host=) \
278 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700279 $(ue_update_metadata_protos_exported_static_libraries)
280LOCAL_SHARED_LIBRARIES := \
281 $(ue_common_shared_libraries) \
Alex Deymo05e0e382015-12-07 20:18:16 -0800282 $(ue_libupdate_engine_exported_shared_libraries:-host=) \
283 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700284 $(ue_update_metadata_protos_exported_shared_libraries)
Alex Deymod5561a52015-09-03 23:17:52 -0700285LOCAL_SRC_FILES := \
Alex Deymo1b03f9f2015-12-09 00:38:36 -0800286 boot_control_android.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700287 chrome_browser_proxy_resolver.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700288 connection_manager.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700289 daemon.cc \
290 dbus_service.cc \
Alex Deymo1b03f9f2015-12-09 00:38:36 -0800291 hardware_android.cc \
Alex Deymo85616652015-10-15 18:48:31 -0700292 image_properties_android.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700293 libcros_proxy.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700294 metrics.cc \
Alex Deymo38429cf2015-11-11 18:27:22 -0800295 metrics_utils.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700296 omaha_request_action.cc \
297 omaha_request_params.cc \
298 omaha_response_handler_action.cc \
299 p2p_manager.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700300 payload_state.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700301 proxy_resolver.cc \
302 real_system_state.cc \
303 shill_proxy.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700304 update_attempter.cc \
305 update_manager/boxed_value.cc \
306 update_manager/chromeos_policy.cc \
307 update_manager/default_policy.cc \
308 update_manager/evaluation_context.cc \
309 update_manager/policy.cc \
310 update_manager/real_config_provider.cc \
311 update_manager/real_device_policy_provider.cc \
312 update_manager/real_random_provider.cc \
313 update_manager/real_shill_provider.cc \
314 update_manager/real_system_provider.cc \
315 update_manager/real_time_provider.cc \
316 update_manager/real_updater_provider.cc \
317 update_manager/state_factory.cc \
318 update_manager/update_manager.cc \
Alex Deymof7ead812015-10-23 17:37:27 -0700319 update_status_utils.cc \
320 weave_service_factory.cc
321ifeq ($(BRILLO_USE_WEAVE),1)
322LOCAL_SRC_FILES += \
323 weave_service.cc
324endif # BRILLO_USE_WEAVE == 1
Alex Deymod5561a52015-09-03 23:17:52 -0700325include $(BUILD_STATIC_LIBRARY)
326
Alex Deymocd60dca2015-11-18 00:57:20 -0300327endif # BRILLO_USE_DBUS == 1
Alex Deymo4218b7e2015-11-17 21:14:42 -0300328
Alex Deymod5561a52015-09-03 23:17:52 -0700329# update_engine (type: executable)
330# ========================================================
331# update_engine daemon.
332include $(CLEAR_VARS)
333LOCAL_MODULE := update_engine
334LOCAL_MODULE_CLASS := EXECUTABLES
Sen Jiang56092772015-11-23 14:41:00 -0800335LOCAL_REQUIRED_MODULES := \
Alex Deymoab494462015-11-30 17:07:36 -0300336 bspatch \
337 cacerts_google
Alex Deymof7ead812015-10-23 17:37:27 -0700338ifeq ($(BRILLO_USE_WEAVE),1)
339LOCAL_REQUIRED_MODULES += updater.json
340endif # BRILLO_USE_WEAVE == 1
Alex Deymoc372ab62015-10-29 00:43:26 -0700341LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700342LOCAL_CLANG := true
343LOCAL_CFLAGS := $(ue_common_cflags)
344LOCAL_CPPFLAGS := $(ue_common_cppflags)
345LOCAL_LDFLAGS := $(ue_common_ldflags)
346LOCAL_C_INCLUDES := \
Alex Deymo4218b7e2015-11-17 21:14:42 -0300347 $(ue_common_c_includes)
348
349ifdef BRILLO
350
351LOCAL_C_INCLUDES += \
Alex Deymoc372ab62015-10-29 00:43:26 -0700352 $(ue_libupdate_engine_exported_c_includes)
353LOCAL_STATIC_LIBRARIES := \
Alex Deymod5561a52015-09-03 23:17:52 -0700354 libupdate_engine \
Alex Deymo05e0e382015-12-07 20:18:16 -0800355 $(ue_libupdate_engine_exported_static_libraries:-host=)
Christopher Wiley9e1eda92015-11-16 15:23:37 -0800356
Alex Deymoc372ab62015-10-29 00:43:26 -0700357LOCAL_SHARED_LIBRARIES := \
358 $(ue_common_shared_libraries) \
Alex Deymo05e0e382015-12-07 20:18:16 -0800359 $(ue_libupdate_engine_exported_shared_libraries:-host=)
Alex Deymod5561a52015-09-03 23:17:52 -0700360LOCAL_SRC_FILES := \
361 main.cc
Christopher Wiley9e1eda92015-11-16 15:23:37 -0800362
363else # !defined(BRILLO)
364
365LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder_bindings
366LOCAL_SHARED_LIBRARIES := \
367 libbinder \
368 liblog \
369 libutils
370LOCAL_SRC_FILES := \
371 binder_bindings/android/os/IUpdateEngine.aidl \
372 binder_bindings/android/os/IUpdateEnginePayloadApplicationCallback.aidl \
373 binder_main.cc \
374 binder_service.cc
375
376endif # defined(BRILLO)
377
Gilad Arnold70141f22015-09-17 09:06:30 -0700378LOCAL_INIT_RC := update_engine.rc
Alex Deymod5561a52015-09-03 23:17:52 -0700379include $(BUILD_EXECUTABLE)
380
Alex Deymo4218b7e2015-11-17 21:14:42 -0300381ifeq ($(BRILLO_USE_DBUS),1)
382
Alex Deymod5561a52015-09-03 23:17:52 -0700383# update_engine_client (type: executable)
384# ========================================================
385# update_engine console client.
386include $(CLEAR_VARS)
387LOCAL_MODULE := update_engine_client
388LOCAL_MODULE_CLASS := EXECUTABLES
Alex Deymoc372ab62015-10-29 00:43:26 -0700389LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700390LOCAL_CLANG := true
391LOCAL_CFLAGS := $(ue_common_cflags)
392LOCAL_CPPFLAGS := $(ue_common_cppflags)
393LOCAL_LDFLAGS := $(ue_common_ldflags)
394LOCAL_C_INCLUDES := \
395 $(ue_common_c_includes) \
Alex Deymod5561a52015-09-03 23:17:52 -0700396 $(LOCAL_PATH)/include
Alex Deymoc372ab62015-10-29 00:43:26 -0700397LOCAL_STATIC_LIBRARIES := update_engine_client-dbus-proxies
Alex Deymo05e0e382015-12-07 20:18:16 -0800398LOCAL_SHARED_LIBRARIES := \
399 $(ue_common_shared_libraries) \
400 libdbus \
401 libbrillo-dbus \
Casey Dahline844c1a2015-12-16 14:30:58 -0800402 libchrome-dbus \
403 libupdate_engine_client
Alex Deymod5561a52015-09-03 23:17:52 -0700404LOCAL_SRC_FILES := \
405 update_engine_client.cc
Alex Deymod5561a52015-09-03 23:17:52 -0700406include $(BUILD_EXECUTABLE)
407
Alex Deymo4218b7e2015-11-17 21:14:42 -0300408endif # BRILLO_USE_DBUS == 1
409
Alex Deymod5561a52015-09-03 23:17:52 -0700410# libpayload_generator (type: static_library)
411# ========================================================
412# server-side code. This is used for delta_generator and unittests but not
413# for any client code.
Alex Deymoc372ab62015-10-29 00:43:26 -0700414ue_libpayload_generator_exported_static_libraries := \
Alex Deymob09305e2015-12-02 16:09:13 -0300415 libpayload_consumer \
Alex Deymoc372ab62015-10-29 00:43:26 -0700416 update_metadata-protos \
Alex Deymob09305e2015-12-02 16:09:13 -0300417 $(ue_libpayload_consumer_exported_static_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700418 $(ue_update_metadata_protos_exported_static_libraries)
419ue_libpayload_generator_exported_shared_libraries := \
Alex Deymo05e0e382015-12-07 20:18:16 -0800420 libext2fs-host \
Alex Deymob09305e2015-12-02 16:09:13 -0300421 $(ue_libpayload_consumer_exported_shared_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700422 $(ue_update_metadata_protos_exported_shared_libraries)
423
Alex Deymo05e0e382015-12-07 20:18:16 -0800424ue_libpayload_generator_src_files := \
Alex Deymod5561a52015-09-03 23:17:52 -0700425 payload_generator/ab_generator.cc \
426 payload_generator/annotated_operation.cc \
427 payload_generator/blob_file_writer.cc \
428 payload_generator/block_mapping.cc \
Alex Deymo0bc26112015-10-19 20:54:57 -0700429 payload_generator/bzip.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700430 payload_generator/cycle_breaker.cc \
431 payload_generator/delta_diff_generator.cc \
432 payload_generator/delta_diff_utils.cc \
433 payload_generator/ext2_filesystem.cc \
434 payload_generator/extent_ranges.cc \
435 payload_generator/extent_utils.cc \
436 payload_generator/full_update_generator.cc \
437 payload_generator/graph_types.cc \
438 payload_generator/graph_utils.cc \
439 payload_generator/inplace_generator.cc \
440 payload_generator/payload_file.cc \
441 payload_generator/payload_generation_config.cc \
442 payload_generator/payload_signer.cc \
443 payload_generator/raw_filesystem.cc \
444 payload_generator/tarjan.cc \
445 payload_generator/topological_sort.cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800446
447ifeq ($(HOST_OS),linux)
448# Build for the host.
449include $(CLEAR_VARS)
450LOCAL_MODULE := libpayload_generator
451LOCAL_MODULE_CLASS := STATIC_LIBRARIES
452LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800453LOCAL_CLANG := true
454LOCAL_CFLAGS := $(ue_common_cflags)
455LOCAL_CPPFLAGS := $(ue_common_cppflags)
456LOCAL_LDFLAGS := $(ue_common_ldflags)
457LOCAL_C_INCLUDES := $(ue_common_c_includes)
458LOCAL_STATIC_LIBRARIES := \
459 libpayload_consumer \
460 update_metadata-protos \
461 $(ue_libpayload_consumer_exported_static_libraries) \
462 $(ue_update_metadata_protos_exported_static_libraries)
463LOCAL_SHARED_LIBRARIES := \
464 $(ue_common_shared_libraries) \
465 $(ue_libpayload_generator_exported_shared_libraries) \
466 $(ue_libpayload_consumer_exported_shared_libraries) \
467 $(ue_update_metadata_protos_exported_shared_libraries)
468LOCAL_SRC_FILES := $(ue_libpayload_generator_src_files)
469include $(BUILD_HOST_STATIC_LIBRARY)
470endif # HOST_OS == linux
471
472# Build for the target.
473include $(CLEAR_VARS)
474LOCAL_MODULE := libpayload_generator
475LOCAL_MODULE_CLASS := STATIC_LIBRARIES
476LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800477LOCAL_CLANG := true
478LOCAL_CFLAGS := $(ue_common_cflags)
479LOCAL_CPPFLAGS := $(ue_common_cppflags)
480LOCAL_LDFLAGS := $(ue_common_ldflags)
481LOCAL_C_INCLUDES := $(ue_common_c_includes)
482LOCAL_STATIC_LIBRARIES := \
483 libpayload_consumer \
484 update_metadata-protos \
485 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
486 $(ue_update_metadata_protos_exported_static_libraries)
487LOCAL_SHARED_LIBRARIES := \
488 $(ue_common_shared_libraries) \
489 $(ue_libpayload_generator_exported_shared_libraries:-host=) \
490 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
491 $(ue_update_metadata_protos_exported_shared_libraries)
492LOCAL_SRC_FILES := $(ue_libpayload_generator_src_files)
Alex Deymod5561a52015-09-03 23:17:52 -0700493include $(BUILD_STATIC_LIBRARY)
494
495# delta_generator (type: executable)
496# ========================================================
497# server-side delta generator.
Alex Deymo05e0e382015-12-07 20:18:16 -0800498ue_delta_generator_src_files := \
499 payload_generator/generate_delta_main.cc
500
501ifeq ($(HOST_OS),linux)
502# Build for the host.
Alex Deymod5561a52015-09-03 23:17:52 -0700503include $(CLEAR_VARS)
504LOCAL_MODULE := delta_generator
505LOCAL_MODULE_CLASS := EXECUTABLES
Alex Deymoc372ab62015-10-29 00:43:26 -0700506LOCAL_CPP_EXTENSION := .cc
Alex Deymoc372ab62015-10-29 00:43:26 -0700507LOCAL_CLANG := true
508LOCAL_CFLAGS := $(ue_common_cflags)
509LOCAL_CPPFLAGS := $(ue_common_cppflags)
510LOCAL_LDFLAGS := $(ue_common_ldflags)
Alex Deymob09305e2015-12-02 16:09:13 -0300511LOCAL_C_INCLUDES := $(ue_common_c_includes)
Alex Deymoc372ab62015-10-29 00:43:26 -0700512LOCAL_STATIC_LIBRARIES := \
Alex Deymob09305e2015-12-02 16:09:13 -0300513 libpayload_consumer \
Alex Deymoc372ab62015-10-29 00:43:26 -0700514 libpayload_generator \
Alex Deymob09305e2015-12-02 16:09:13 -0300515 $(ue_libpayload_consumer_exported_static_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700516 $(ue_libpayload_generator_exported_static_libraries)
517LOCAL_SHARED_LIBRARIES := \
518 $(ue_common_shared_libraries) \
Alex Deymob09305e2015-12-02 16:09:13 -0300519 $(ue_libpayload_consumer_exported_shared_libraries) \
Alex Deymoc372ab62015-10-29 00:43:26 -0700520 $(ue_libpayload_generator_exported_shared_libraries)
Alex Deymo05e0e382015-12-07 20:18:16 -0800521LOCAL_SRC_FILES := $(ue_delta_generator_src_files)
522include $(BUILD_HOST_EXECUTABLE)
523endif # HOST_OS == linux
524
525# Build for the target.
526include $(CLEAR_VARS)
527LOCAL_MODULE := delta_generator
528LOCAL_MODULE_CLASS := EXECUTABLES
529LOCAL_CPP_EXTENSION := .cc
Alex Deymo05e0e382015-12-07 20:18:16 -0800530LOCAL_CLANG := true
531LOCAL_CFLAGS := $(ue_common_cflags)
532LOCAL_CPPFLAGS := $(ue_common_cppflags)
533LOCAL_LDFLAGS := $(ue_common_ldflags)
534LOCAL_C_INCLUDES := $(ue_common_c_includes)
535LOCAL_STATIC_LIBRARIES := \
536 libpayload_consumer \
537 libpayload_generator \
538 $(ue_libpayload_consumer_exported_static_libraries:-host=) \
539 $(ue_libpayload_generator_exported_static_libraries:-host=)
540LOCAL_SHARED_LIBRARIES := \
541 $(ue_common_shared_libraries) \
542 $(ue_libpayload_consumer_exported_shared_libraries:-host=) \
543 $(ue_libpayload_generator_exported_shared_libraries:-host=)
544LOCAL_SRC_FILES := $(ue_delta_generator_src_files)
Alex Deymod5561a52015-09-03 23:17:52 -0700545include $(BUILD_EXECUTABLE)
546
Alex Deymo4218b7e2015-11-17 21:14:42 -0300547ifeq ($(BRILLO_USE_DBUS),1)
548
Christopher Wiley16daa082015-10-01 17:18:40 -0700549# libupdate_engine_client
550# ========================================================
551include $(CLEAR_VARS)
552LOCAL_MODULE := libupdate_engine_client
Christopher Wiley16daa082015-10-01 17:18:40 -0700553LOCAL_CFLAGS := \
554 -Wall \
555 -Werror \
556 -Wno-unused-parameter
557LOCAL_CLANG := true
558LOCAL_CPP_EXTENSION := .cc
559LOCAL_C_INCLUDES := \
560 $(LOCAL_PATH)/client_library/include \
561 external/cros/system_api/dbus \
562 system \
563 external/gtest/include
564LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/client_library/include
565LOCAL_SHARED_LIBRARIES := \
566 libchrome \
567 libchrome-dbus \
Alex Vakulenko1bab5a82015-10-27 11:47:28 -0700568 libbrillo \
569 libbrillo-dbus
Christopher Wiley16daa082015-10-01 17:18:40 -0700570LOCAL_STATIC_LIBRARIES := \
571 update_engine_client-dbus-proxies
572LOCAL_SRC_FILES := \
573 client_library/client.cc \
574 client_library/client_impl.cc \
575 update_status_utils.cc
576include $(BUILD_SHARED_LIBRARY)
577
Alex Deymo4218b7e2015-11-17 21:14:42 -0300578endif # BRILLO_USE_DBUS == 1
Gaurav Shah263614f2015-09-24 14:20:38 -0700579
Alex Deymof7ead812015-10-23 17:37:27 -0700580# Weave schema files
581# ========================================================
582include $(CLEAR_VARS)
583LOCAL_MODULE := updater.json
584LOCAL_MODULE_CLASS := ETC
585LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/weaved/traits
586LOCAL_SRC_FILES := weaved/traits/$(LOCAL_MODULE)
587include $(BUILD_PREBUILT)
588
Gaurav Shah263614f2015-09-24 14:20:38 -0700589# Update payload signing public key.
590# ========================================================
591include $(CLEAR_VARS)
592LOCAL_MODULE := brillo-update-payload-key
593LOCAL_MODULE_CLASS := ETC
594LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/update_engine
595LOCAL_MODULE_STEM := update-payload-key.pub.pem
596LOCAL_SRC_FILES := update_payload_key/brillo-update-payload-key.pub.pem
597LOCAL_BUILT_MODULE_STEM := update_payload_key/brillo-update-payload-key.pub.pem
598include $(BUILD_PREBUILT)
Tao Bao042f8a12016-01-07 16:52:14 -0800599
600# Brillo update payload generation script
601# ========================================================
602ifeq ($(HOST_OS),linux)
603include $(CLEAR_VARS)
604LOCAL_SRC_FILES := scripts/brillo_update_payload
605LOCAL_MODULE := brillo_update_payload
606LOCAL_MODULE_CLASS := EXECUTABLES
607LOCAL_IS_HOST_MODULE := true
608LOCAL_MODULE_TAGS := optional
609LOCAL_REQUIRED_MODULES := \
610 delta_generator \
611 shflags
612include $(BUILD_PREBUILT)
613endif # HOST_OS == linux