blob: c3b0fda0ec564cdd819fa993cf09a07bdd10cdb3 [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
19# Definitions applying to all targets. $(eval) this last.
20define update_engine_common
21 LOCAL_CPP_EXTENSION := .cc
22 LOCAL_RTTI_FLAG := -frtti
23 LOCAL_CLANG := true
24
25 LOCAL_CFLAGS += \
26 -DUSE_HWID_OVERRIDE=0 \
27 -DUSE_MTD=0 \
28 -DUSE_POWER_MANAGEMENT=0 \
29 -D_FILE_OFFSET_BITS=64 \
30 -D_POSIX_C_SOURCE=199309L \
31 -Wa,--noexecstack \
32 -Wall \
33 -Werror \
34 -Wextra \
35 -Wformat=2 \
36 -Wno-psabi \
37 -Wno-unused-parameter \
38 -ffunction-sections \
39 -fstack-protector-strong \
40 -fvisibility=hidden
41 LOCAL_CPPFLAGS += \
42 -Wnon-virtual-dtor \
43 -fno-strict-aliasing \
44 -std=gnu++11
45 LOCAL_LDFLAGS += \
46 -Wl,--gc-sections
47 LOCAL_C_INCLUDES += \
Christopher Wileycc8ce0e2015-10-01 16:48:47 -070048 $(LOCAL_PATH)/client_library/include \
Alex Deymod5561a52015-09-03 23:17:52 -070049 external/gtest/include \
50 system
51 LOCAL_SHARED_LIBRARIES += \
52 libchrome \
53 libchrome-dbus \
54 libchromeos \
55 libchromeos-dbus \
56 libchromeos-http \
57 libchromeos-stream
58endef
59
60# update_metadata-protos (type: static_library)
61# ========================================================
62# Protobufs.
63include $(CLEAR_VARS)
64LOCAL_MODULE := update_metadata-protos
65LOCAL_MODULE_CLASS := STATIC_LIBRARIES
66generated_sources_dir := $(call local-generated-sources-dir)
67LOCAL_EXPORT_C_INCLUDE_DIRS += \
68 $(generated_sources_dir)/proto/system
69LOCAL_SHARED_LIBRARIES += \
70 libprotobuf-cpp-lite-rtti
71LOCAL_SRC_FILES := \
72 update_metadata.proto
73$(eval $(update_engine_common))
74include $(BUILD_STATIC_LIBRARY)
75
76# update_engine-dbus-adaptor (from generate-dbus-adaptors.gypi)
77# ========================================================
78include $(CLEAR_VARS)
79LOCAL_MODULE := update_engine-dbus-adaptor
80LOCAL_SRC_FILES := \
81 dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml
82include $(BUILD_STATIC_LIBRARY)
83
84# update_engine-dbus-libcros-client (from generate-dbus-proxies.gypi)
85# ========================================================
86include $(CLEAR_VARS)
87LOCAL_MODULE := update_engine-dbus-libcros-client
88LOCAL_SRC_FILES := \
89 dbus_bindings/org.chromium.LibCrosService.dbus-xml
90LOCAL_DBUS_PROXY_PREFIX := libcros
91include $(BUILD_STATIC_LIBRARY)
92
93# libupdate_engine (type: static_library)
94# ========================================================
95# The main static_library with all the code.
96include $(CLEAR_VARS)
97LOCAL_MODULE := libupdate_engine
98LOCAL_MODULE_CLASS := STATIC_LIBRARIES
99LOCAL_C_INCLUDES += \
Alex Deymo7eb23052015-10-09 15:27:59 -0700100 $(LOCAL_PATH)/include \
101 external/cros/system_api/dbus \
102 external/e2fsprogs/lib
Alex Deymod5561a52015-09-03 23:17:52 -0700103LOCAL_EXPORT_C_INCLUDE_DIRS += \
Alex Deymo7eb23052015-10-09 15:27:59 -0700104 $(LOCAL_PATH)/include \
105 external/cros/system_api/dbus
Alex Deymod5561a52015-09-03 23:17:52 -0700106LOCAL_STATIC_LIBRARIES += \
107 update_metadata-protos \
108 update_engine-dbus-adaptor \
109 update_engine-dbus-libcros-client \
110 update_engine_client-dbus-proxies \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700111 libxz \
David Zeuthen753fadc2015-09-15 16:34:09 -0400112 libbz \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700113 libfs_mgr
Alex Deymod5561a52015-09-03 23:17:52 -0700114LOCAL_SHARED_LIBRARIES += \
115 libprotobuf-cpp-lite-rtti \
116 libdbus \
117 libcrypto \
118 libcurl \
119 libmetrics \
Alex Deymo7eb23052015-10-09 15:27:59 -0700120 libshill-client \
Alex Deymod5561a52015-09-03 23:17:52 -0700121 libssl \
122 libexpat \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700123 libchromeos-policy \
124 libhardware \
125 libcutils
Alex Deymod5561a52015-09-03 23:17:52 -0700126LOCAL_SRC_FILES := \
127 action_processor.cc \
128 boot_control_android.cc \
David Zeuthen6eddf262015-10-16 15:23:53 -0400129 boot_control_stub.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700130 bzip.cc \
131 bzip_extent_writer.cc \
132 certificate_checker.cc \
133 chrome_browser_proxy_resolver.cc \
134 clock.cc \
135 connection_manager.cc \
136 constants.cc \
137 daemon.cc \
138 dbus_service.cc \
139 delta_performer.cc \
140 download_action.cc \
141 extent_writer.cc \
142 file_descriptor.cc \
143 file_writer.cc \
144 filesystem_verifier_action.cc \
145 hardware_android.cc \
146 http_common.cc \
147 http_fetcher.cc \
148 hwid_override.cc \
Alex Deymo85616652015-10-15 18:48:31 -0700149 image_properties_android.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700150 install_plan.cc \
151 libcros_proxy.cc \
152 libcurl_http_fetcher.cc \
153 metrics.cc \
154 multi_range_http_fetcher.cc \
155 omaha_hash_calculator.cc \
156 omaha_request_action.cc \
157 omaha_request_params.cc \
158 omaha_response_handler_action.cc \
159 p2p_manager.cc \
160 payload_constants.cc \
161 payload_state.cc \
162 payload_verifier.cc \
Alex Deymoac41a822015-09-15 20:52:53 -0700163 platform_constants_android.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700164 postinstall_runner_action.cc \
165 prefs.cc \
166 proxy_resolver.cc \
167 real_system_state.cc \
168 shill_proxy.cc \
169 subprocess.cc \
170 terminator.cc \
171 update_attempter.cc \
172 update_manager/boxed_value.cc \
173 update_manager/chromeos_policy.cc \
174 update_manager/default_policy.cc \
175 update_manager/evaluation_context.cc \
176 update_manager/policy.cc \
177 update_manager/real_config_provider.cc \
178 update_manager/real_device_policy_provider.cc \
179 update_manager/real_random_provider.cc \
180 update_manager/real_shill_provider.cc \
181 update_manager/real_system_provider.cc \
182 update_manager/real_time_provider.cc \
183 update_manager/real_updater_provider.cc \
184 update_manager/state_factory.cc \
185 update_manager/update_manager.cc \
Christopher Wileycc8ce0e2015-10-01 16:48:47 -0700186 update_status_utils.cc \
Alex Deymo2e71f902015-09-30 01:25:48 -0700187 utils.cc \
188 xz_extent_writer.cc
Alex Deymod5561a52015-09-03 23:17:52 -0700189$(eval $(update_engine_common))
190include $(BUILD_STATIC_LIBRARY)
191
192# update_engine (type: executable)
193# ========================================================
194# update_engine daemon.
195include $(CLEAR_VARS)
196LOCAL_MODULE := update_engine
197LOCAL_MODULE_CLASS := EXECUTABLES
198LOCAL_STATIC_LIBRARIES += \
199 libupdate_engine \
200 libbz \
David Zeuthen753fadc2015-09-15 16:34:09 -0400201 libfs_mgr \
Alex Deymod5561a52015-09-03 23:17:52 -0700202 update_metadata-protos \
203 update_engine-dbus-adaptor \
204 update_engine-dbus-libcros-client \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700205 update_engine_client-dbus-proxies \
206 libxz
Alex Deymod5561a52015-09-03 23:17:52 -0700207LOCAL_SHARED_LIBRARIES += \
208 libprotobuf-cpp-lite-rtti \
209 libdbus \
210 libcrypto \
211 libcurl \
212 libmetrics \
Alex Deymo7eb23052015-10-09 15:27:59 -0700213 libshill-client \
Alex Deymod5561a52015-09-03 23:17:52 -0700214 libssl \
215 libexpat \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700216 libchromeos-policy \
217 libhardware \
218 libcutils
Alex Deymod5561a52015-09-03 23:17:52 -0700219LOCAL_SRC_FILES := \
220 main.cc
Gilad Arnold70141f22015-09-17 09:06:30 -0700221LOCAL_INIT_RC := update_engine.rc
Alex Deymod5561a52015-09-03 23:17:52 -0700222$(eval $(update_engine_common))
223include $(BUILD_EXECUTABLE)
224
225# update_engine_client (type: executable)
226# ========================================================
227# update_engine console client.
228include $(CLEAR_VARS)
229LOCAL_MODULE := update_engine_client
230LOCAL_MODULE_CLASS := EXECUTABLES
231LOCAL_C_INCLUDES += \
232 $(LOCAL_PATH)/include
233LOCAL_STATIC_LIBRARIES += \
234 update_engine_client-dbus-proxies
235LOCAL_SRC_FILES := \
236 update_engine_client.cc
237$(eval $(update_engine_common))
238include $(BUILD_EXECUTABLE)
239
240# libpayload_generator (type: static_library)
241# ========================================================
242# server-side code. This is used for delta_generator and unittests but not
243# for any client code.
244include $(CLEAR_VARS)
245LOCAL_MODULE := libpayload_generator
246LOCAL_MODULE_CLASS := STATIC_LIBRARIES
247LOCAL_STATIC_LIBRARIES += \
248 libupdate_engine \
249 libbz \
David Zeuthen753fadc2015-09-15 16:34:09 -0400250 libfs_mgr \
Alex Deymod5561a52015-09-03 23:17:52 -0700251 update_metadata-protos \
252 update_engine-dbus-adaptor \
253 update_engine-dbus-libcros-client \
254 update_engine_client-dbus-proxies \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700255 libxz \
Alex Deymod5561a52015-09-03 23:17:52 -0700256 update_metadata-protos
257LOCAL_SHARED_LIBRARIES += \
258 libdbus \
259 libcrypto \
260 libcurl \
261 libmetrics \
Alex Deymo7eb23052015-10-09 15:27:59 -0700262 libshill-client \
Alex Deymod5561a52015-09-03 23:17:52 -0700263 libssl \
264 libexpat \
265 libchromeos-policy \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700266 libhardware \
267 libcutils \
Alex Deymod5561a52015-09-03 23:17:52 -0700268 libprotobuf-cpp-lite-rtti \
269 libext2fs
270LOCAL_SRC_FILES := \
271 payload_generator/ab_generator.cc \
272 payload_generator/annotated_operation.cc \
273 payload_generator/blob_file_writer.cc \
274 payload_generator/block_mapping.cc \
275 payload_generator/cycle_breaker.cc \
276 payload_generator/delta_diff_generator.cc \
277 payload_generator/delta_diff_utils.cc \
278 payload_generator/ext2_filesystem.cc \
279 payload_generator/extent_ranges.cc \
280 payload_generator/extent_utils.cc \
281 payload_generator/full_update_generator.cc \
282 payload_generator/graph_types.cc \
283 payload_generator/graph_utils.cc \
284 payload_generator/inplace_generator.cc \
285 payload_generator/payload_file.cc \
286 payload_generator/payload_generation_config.cc \
287 payload_generator/payload_signer.cc \
288 payload_generator/raw_filesystem.cc \
289 payload_generator/tarjan.cc \
290 payload_generator/topological_sort.cc
291$(eval $(update_engine_common))
292include $(BUILD_STATIC_LIBRARY)
293
294# delta_generator (type: executable)
295# ========================================================
296# server-side delta generator.
297include $(CLEAR_VARS)
298LOCAL_MODULE := delta_generator
299LOCAL_MODULE_CLASS := EXECUTABLES
300LOCAL_STATIC_LIBRARIES += \
301 libpayload_generator \
302 libupdate_engine \
303 libbz \
David Zeuthen753fadc2015-09-15 16:34:09 -0400304 libfs_mgr \
Alex Deymod5561a52015-09-03 23:17:52 -0700305 update_metadata-protos \
306 update_engine-dbus-adaptor \
307 update_engine-dbus-libcros-client \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700308 update_engine_client-dbus-proxies \
309 libxz
Alex Deymod5561a52015-09-03 23:17:52 -0700310LOCAL_SHARED_LIBRARIES += \
311 libdbus \
312 libcrypto \
313 libcurl \
314 libmetrics \
Alex Deymo7eb23052015-10-09 15:27:59 -0700315 libshill-client \
Alex Deymod5561a52015-09-03 23:17:52 -0700316 libssl \
317 libexpat \
318 libchromeos-policy \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700319 libhardware \
320 libcutils \
Alex Deymod5561a52015-09-03 23:17:52 -0700321 libprotobuf-cpp-lite-rtti \
322 libext2fs
323LOCAL_SRC_FILES := \
324 payload_generator/generate_delta_main.cc
325$(eval $(update_engine_common))
326include $(BUILD_EXECUTABLE)
327
328# update_engine_client-dbus-proxies (from generate-dbus-proxies.gypi)
329# ========================================================
330include $(CLEAR_VARS)
331LOCAL_MODULE := update_engine_client-dbus-proxies
332LOCAL_SRC_FILES := \
333 dbus_bindings/dbus-service-config.json \
334 dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml
335LOCAL_DBUS_PROXY_PREFIX := update_engine
336include $(BUILD_STATIC_LIBRARY)
Alex Deymo0290c1f2015-09-14 17:45:38 -0700337
Christopher Wiley16daa082015-10-01 17:18:40 -0700338# libupdate_engine_client
339# ========================================================
340include $(CLEAR_VARS)
341LOCAL_MODULE := libupdate_engine_client
342LOCAL_RTTI_FLAG := -frtti
343LOCAL_CFLAGS := \
344 -Wall \
345 -Werror \
346 -Wno-unused-parameter
347LOCAL_CLANG := true
348LOCAL_CPP_EXTENSION := .cc
349LOCAL_C_INCLUDES := \
350 $(LOCAL_PATH)/client_library/include \
351 external/cros/system_api/dbus \
352 system \
353 external/gtest/include
354LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/client_library/include
355LOCAL_SHARED_LIBRARIES := \
356 libchrome \
357 libchrome-dbus \
358 libchromeos \
359 libchromeos-dbus
360LOCAL_STATIC_LIBRARIES := \
361 update_engine_client-dbus-proxies
362LOCAL_SRC_FILES := \
363 client_library/client.cc \
364 client_library/client_impl.cc \
365 update_status_utils.cc
366include $(BUILD_SHARED_LIBRARY)
367
Gaurav Shah263614f2015-09-24 14:20:38 -0700368
369# Update payload signing public key.
370# ========================================================
371include $(CLEAR_VARS)
372LOCAL_MODULE := brillo-update-payload-key
373LOCAL_MODULE_CLASS := ETC
374LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/update_engine
375LOCAL_MODULE_STEM := update-payload-key.pub.pem
376LOCAL_SRC_FILES := update_payload_key/brillo-update-payload-key.pub.pem
377LOCAL_BUILT_MODULE_STEM := update_payload_key/brillo-update-payload-key.pub.pem
378include $(BUILD_PREBUILT)