blob: 9755896774e09a209b3fbafb60580a0188382c28 [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 += \
100 external/e2fsprogs/lib \
101 $(LOCAL_PATH)/include
102LOCAL_EXPORT_C_INCLUDE_DIRS += \
103 $(LOCAL_PATH)/include
104LOCAL_STATIC_LIBRARIES += \
105 update_metadata-protos \
106 update_engine-dbus-adaptor \
107 update_engine-dbus-libcros-client \
108 update_engine_client-dbus-proxies \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700109 libxz \
David Zeuthen753fadc2015-09-15 16:34:09 -0400110 libbz \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700111 libfs_mgr
Alex Deymod5561a52015-09-03 23:17:52 -0700112LOCAL_SHARED_LIBRARIES += \
113 libprotobuf-cpp-lite-rtti \
114 libdbus \
115 libcrypto \
116 libcurl \
117 libmetrics \
118 libssl \
119 libexpat \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700120 libchromeos-policy \
121 libhardware \
122 libcutils
Alex Deymod5561a52015-09-03 23:17:52 -0700123LOCAL_SRC_FILES := \
124 action_processor.cc \
125 boot_control_android.cc \
126 bzip.cc \
127 bzip_extent_writer.cc \
128 certificate_checker.cc \
129 chrome_browser_proxy_resolver.cc \
130 clock.cc \
131 connection_manager.cc \
132 constants.cc \
133 daemon.cc \
134 dbus_service.cc \
135 delta_performer.cc \
136 download_action.cc \
137 extent_writer.cc \
138 file_descriptor.cc \
139 file_writer.cc \
140 filesystem_verifier_action.cc \
141 hardware_android.cc \
142 http_common.cc \
143 http_fetcher.cc \
144 hwid_override.cc \
145 install_plan.cc \
146 libcros_proxy.cc \
147 libcurl_http_fetcher.cc \
148 metrics.cc \
149 multi_range_http_fetcher.cc \
150 omaha_hash_calculator.cc \
151 omaha_request_action.cc \
152 omaha_request_params.cc \
153 omaha_response_handler_action.cc \
154 p2p_manager.cc \
155 payload_constants.cc \
156 payload_state.cc \
157 payload_verifier.cc \
Alex Deymoac41a822015-09-15 20:52:53 -0700158 platform_constants_android.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700159 postinstall_runner_action.cc \
160 prefs.cc \
161 proxy_resolver.cc \
162 real_system_state.cc \
163 shill_proxy.cc \
164 subprocess.cc \
165 terminator.cc \
166 update_attempter.cc \
167 update_manager/boxed_value.cc \
168 update_manager/chromeos_policy.cc \
169 update_manager/default_policy.cc \
170 update_manager/evaluation_context.cc \
171 update_manager/policy.cc \
172 update_manager/real_config_provider.cc \
173 update_manager/real_device_policy_provider.cc \
174 update_manager/real_random_provider.cc \
175 update_manager/real_shill_provider.cc \
176 update_manager/real_system_provider.cc \
177 update_manager/real_time_provider.cc \
178 update_manager/real_updater_provider.cc \
179 update_manager/state_factory.cc \
180 update_manager/update_manager.cc \
Christopher Wileycc8ce0e2015-10-01 16:48:47 -0700181 update_status_utils.cc \
Alex Deymo2e71f902015-09-30 01:25:48 -0700182 utils.cc \
183 xz_extent_writer.cc
Alex Deymod5561a52015-09-03 23:17:52 -0700184$(eval $(update_engine_common))
185include $(BUILD_STATIC_LIBRARY)
186
187# update_engine (type: executable)
188# ========================================================
189# update_engine daemon.
190include $(CLEAR_VARS)
191LOCAL_MODULE := update_engine
192LOCAL_MODULE_CLASS := EXECUTABLES
193LOCAL_STATIC_LIBRARIES += \
194 libupdate_engine \
195 libbz \
David Zeuthen753fadc2015-09-15 16:34:09 -0400196 libfs_mgr \
Alex Deymod5561a52015-09-03 23:17:52 -0700197 update_metadata-protos \
198 update_engine-dbus-adaptor \
199 update_engine-dbus-libcros-client \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700200 update_engine_client-dbus-proxies \
201 libxz
Alex Deymod5561a52015-09-03 23:17:52 -0700202LOCAL_SHARED_LIBRARIES += \
203 libprotobuf-cpp-lite-rtti \
204 libdbus \
205 libcrypto \
206 libcurl \
207 libmetrics \
208 libssl \
209 libexpat \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700210 libchromeos-policy \
211 libhardware \
212 libcutils
Alex Deymod5561a52015-09-03 23:17:52 -0700213LOCAL_SRC_FILES := \
214 main.cc
Gilad Arnold70141f22015-09-17 09:06:30 -0700215LOCAL_INIT_RC := update_engine.rc
Alex Deymod5561a52015-09-03 23:17:52 -0700216$(eval $(update_engine_common))
217include $(BUILD_EXECUTABLE)
218
219# update_engine_client (type: executable)
220# ========================================================
221# update_engine console client.
222include $(CLEAR_VARS)
223LOCAL_MODULE := update_engine_client
224LOCAL_MODULE_CLASS := EXECUTABLES
225LOCAL_C_INCLUDES += \
226 $(LOCAL_PATH)/include
227LOCAL_STATIC_LIBRARIES += \
228 update_engine_client-dbus-proxies
229LOCAL_SRC_FILES := \
230 update_engine_client.cc
231$(eval $(update_engine_common))
232include $(BUILD_EXECUTABLE)
233
234# libpayload_generator (type: static_library)
235# ========================================================
236# server-side code. This is used for delta_generator and unittests but not
237# for any client code.
238include $(CLEAR_VARS)
239LOCAL_MODULE := libpayload_generator
240LOCAL_MODULE_CLASS := STATIC_LIBRARIES
241LOCAL_STATIC_LIBRARIES += \
242 libupdate_engine \
243 libbz \
David Zeuthen753fadc2015-09-15 16:34:09 -0400244 libfs_mgr \
Alex Deymod5561a52015-09-03 23:17:52 -0700245 update_metadata-protos \
246 update_engine-dbus-adaptor \
247 update_engine-dbus-libcros-client \
248 update_engine_client-dbus-proxies \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700249 libxz \
Alex Deymod5561a52015-09-03 23:17:52 -0700250 update_metadata-protos
251LOCAL_SHARED_LIBRARIES += \
252 libdbus \
253 libcrypto \
254 libcurl \
255 libmetrics \
256 libssl \
257 libexpat \
258 libchromeos-policy \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700259 libhardware \
260 libcutils \
Alex Deymod5561a52015-09-03 23:17:52 -0700261 libprotobuf-cpp-lite-rtti \
262 libext2fs
263LOCAL_SRC_FILES := \
264 payload_generator/ab_generator.cc \
265 payload_generator/annotated_operation.cc \
266 payload_generator/blob_file_writer.cc \
267 payload_generator/block_mapping.cc \
268 payload_generator/cycle_breaker.cc \
269 payload_generator/delta_diff_generator.cc \
270 payload_generator/delta_diff_utils.cc \
271 payload_generator/ext2_filesystem.cc \
272 payload_generator/extent_ranges.cc \
273 payload_generator/extent_utils.cc \
274 payload_generator/full_update_generator.cc \
275 payload_generator/graph_types.cc \
276 payload_generator/graph_utils.cc \
277 payload_generator/inplace_generator.cc \
278 payload_generator/payload_file.cc \
279 payload_generator/payload_generation_config.cc \
280 payload_generator/payload_signer.cc \
281 payload_generator/raw_filesystem.cc \
282 payload_generator/tarjan.cc \
283 payload_generator/topological_sort.cc
284$(eval $(update_engine_common))
285include $(BUILD_STATIC_LIBRARY)
286
287# delta_generator (type: executable)
288# ========================================================
289# server-side delta generator.
290include $(CLEAR_VARS)
291LOCAL_MODULE := delta_generator
292LOCAL_MODULE_CLASS := EXECUTABLES
293LOCAL_STATIC_LIBRARIES += \
294 libpayload_generator \
295 libupdate_engine \
296 libbz \
David Zeuthen753fadc2015-09-15 16:34:09 -0400297 libfs_mgr \
Alex Deymod5561a52015-09-03 23:17:52 -0700298 update_metadata-protos \
299 update_engine-dbus-adaptor \
300 update_engine-dbus-libcros-client \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700301 update_engine_client-dbus-proxies \
302 libxz
Alex Deymod5561a52015-09-03 23:17:52 -0700303LOCAL_SHARED_LIBRARIES += \
304 libdbus \
305 libcrypto \
306 libcurl \
307 libmetrics \
308 libssl \
309 libexpat \
310 libchromeos-policy \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700311 libhardware \
312 libcutils \
Alex Deymod5561a52015-09-03 23:17:52 -0700313 libprotobuf-cpp-lite-rtti \
314 libext2fs
315LOCAL_SRC_FILES := \
316 payload_generator/generate_delta_main.cc
317$(eval $(update_engine_common))
318include $(BUILD_EXECUTABLE)
319
320# update_engine_client-dbus-proxies (from generate-dbus-proxies.gypi)
321# ========================================================
322include $(CLEAR_VARS)
323LOCAL_MODULE := update_engine_client-dbus-proxies
324LOCAL_SRC_FILES := \
325 dbus_bindings/dbus-service-config.json \
326 dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml
327LOCAL_DBUS_PROXY_PREFIX := update_engine
328include $(BUILD_STATIC_LIBRARY)
Alex Deymo0290c1f2015-09-14 17:45:38 -0700329
Christopher Wiley16daa082015-10-01 17:18:40 -0700330# libupdate_engine_client
331# ========================================================
332include $(CLEAR_VARS)
333LOCAL_MODULE := libupdate_engine_client
334LOCAL_RTTI_FLAG := -frtti
335LOCAL_CFLAGS := \
336 -Wall \
337 -Werror \
338 -Wno-unused-parameter
339LOCAL_CLANG := true
340LOCAL_CPP_EXTENSION := .cc
341LOCAL_C_INCLUDES := \
342 $(LOCAL_PATH)/client_library/include \
343 external/cros/system_api/dbus \
344 system \
345 external/gtest/include
346LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/client_library/include
347LOCAL_SHARED_LIBRARIES := \
348 libchrome \
349 libchrome-dbus \
350 libchromeos \
351 libchromeos-dbus
352LOCAL_STATIC_LIBRARIES := \
353 update_engine_client-dbus-proxies
354LOCAL_SRC_FILES := \
355 client_library/client.cc \
356 client_library/client_impl.cc \
357 update_status_utils.cc
358include $(BUILD_SHARED_LIBRARY)
359
Gaurav Shah263614f2015-09-24 14:20:38 -0700360
361# Update payload signing public key.
362# ========================================================
363include $(CLEAR_VARS)
364LOCAL_MODULE := brillo-update-payload-key
365LOCAL_MODULE_CLASS := ETC
366LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/update_engine
367LOCAL_MODULE_STEM := update-payload-key.pub.pem
368LOCAL_SRC_FILES := update_payload_key/brillo-update-payload-key.pub.pem
369LOCAL_BUILT_MODULE_STEM := update_payload_key/brillo-update-payload-key.pub.pem
370include $(BUILD_PREBUILT)