blob: abbae2668e53c75aaf837a4cfdf2931113fe5fa6 [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 += \
48 external/gtest/include \
49 system
50 LOCAL_SHARED_LIBRARIES += \
51 libchrome \
52 libchrome-dbus \
53 libchromeos \
54 libchromeos-dbus \
55 libchromeos-http \
56 libchromeos-stream
57endef
58
59# update_metadata-protos (type: static_library)
60# ========================================================
61# Protobufs.
62include $(CLEAR_VARS)
63LOCAL_MODULE := update_metadata-protos
64LOCAL_MODULE_CLASS := STATIC_LIBRARIES
65generated_sources_dir := $(call local-generated-sources-dir)
66LOCAL_EXPORT_C_INCLUDE_DIRS += \
67 $(generated_sources_dir)/proto/system
68LOCAL_SHARED_LIBRARIES += \
69 libprotobuf-cpp-lite-rtti
70LOCAL_SRC_FILES := \
71 update_metadata.proto
72$(eval $(update_engine_common))
73include $(BUILD_STATIC_LIBRARY)
74
75# update_engine-dbus-adaptor (from generate-dbus-adaptors.gypi)
76# ========================================================
77include $(CLEAR_VARS)
78LOCAL_MODULE := update_engine-dbus-adaptor
79LOCAL_SRC_FILES := \
80 dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml
81include $(BUILD_STATIC_LIBRARY)
82
83# update_engine-dbus-libcros-client (from generate-dbus-proxies.gypi)
84# ========================================================
85include $(CLEAR_VARS)
86LOCAL_MODULE := update_engine-dbus-libcros-client
87LOCAL_SRC_FILES := \
88 dbus_bindings/org.chromium.LibCrosService.dbus-xml
89LOCAL_DBUS_PROXY_PREFIX := libcros
90include $(BUILD_STATIC_LIBRARY)
91
92# libupdate_engine (type: static_library)
93# ========================================================
94# The main static_library with all the code.
95include $(CLEAR_VARS)
96LOCAL_MODULE := libupdate_engine
97LOCAL_MODULE_CLASS := STATIC_LIBRARIES
98LOCAL_C_INCLUDES += \
99 external/e2fsprogs/lib \
100 $(LOCAL_PATH)/include
101LOCAL_EXPORT_C_INCLUDE_DIRS += \
102 $(LOCAL_PATH)/include
103LOCAL_STATIC_LIBRARIES += \
104 update_metadata-protos \
105 update_engine-dbus-adaptor \
106 update_engine-dbus-libcros-client \
107 update_engine_client-dbus-proxies \
David Zeuthen753fadc2015-09-15 16:34:09 -0400108 libbz \
Alex Deymo2e71f902015-09-30 01:25:48 -0700109 libfs_mgr \
110 libxz
Alex Deymod5561a52015-09-03 23:17:52 -0700111LOCAL_SHARED_LIBRARIES += \
112 libprotobuf-cpp-lite-rtti \
113 libdbus \
114 libcrypto \
115 libcurl \
David Zeuthen753fadc2015-09-15 16:34:09 -0400116 libcutils \
117 libhardware \
Alex Deymod5561a52015-09-03 23:17:52 -0700118 libmetrics \
119 libssl \
120 libexpat \
121 libchromeos-policy
122LOCAL_SRC_FILES := \
123 action_processor.cc \
124 boot_control_android.cc \
125 bzip.cc \
126 bzip_extent_writer.cc \
127 certificate_checker.cc \
128 chrome_browser_proxy_resolver.cc \
129 clock.cc \
130 connection_manager.cc \
131 constants.cc \
132 daemon.cc \
133 dbus_service.cc \
134 delta_performer.cc \
135 download_action.cc \
136 extent_writer.cc \
137 file_descriptor.cc \
138 file_writer.cc \
139 filesystem_verifier_action.cc \
140 hardware_android.cc \
141 http_common.cc \
142 http_fetcher.cc \
143 hwid_override.cc \
144 install_plan.cc \
145 libcros_proxy.cc \
146 libcurl_http_fetcher.cc \
147 metrics.cc \
148 multi_range_http_fetcher.cc \
149 omaha_hash_calculator.cc \
150 omaha_request_action.cc \
151 omaha_request_params.cc \
152 omaha_response_handler_action.cc \
153 p2p_manager.cc \
154 payload_constants.cc \
155 payload_state.cc \
156 payload_verifier.cc \
Alex Deymoac41a822015-09-15 20:52:53 -0700157 platform_constants_android.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700158 postinstall_runner_action.cc \
159 prefs.cc \
160 proxy_resolver.cc \
161 real_system_state.cc \
162 shill_proxy.cc \
163 subprocess.cc \
164 terminator.cc \
165 update_attempter.cc \
166 update_manager/boxed_value.cc \
167 update_manager/chromeos_policy.cc \
168 update_manager/default_policy.cc \
169 update_manager/evaluation_context.cc \
170 update_manager/policy.cc \
171 update_manager/real_config_provider.cc \
172 update_manager/real_device_policy_provider.cc \
173 update_manager/real_random_provider.cc \
174 update_manager/real_shill_provider.cc \
175 update_manager/real_system_provider.cc \
176 update_manager/real_time_provider.cc \
177 update_manager/real_updater_provider.cc \
178 update_manager/state_factory.cc \
179 update_manager/update_manager.cc \
Alex Deymo2e71f902015-09-30 01:25:48 -0700180 utils.cc \
181 xz_extent_writer.cc
Alex Deymod5561a52015-09-03 23:17:52 -0700182$(eval $(update_engine_common))
183include $(BUILD_STATIC_LIBRARY)
184
185# update_engine (type: executable)
186# ========================================================
187# update_engine daemon.
188include $(CLEAR_VARS)
189LOCAL_MODULE := update_engine
190LOCAL_MODULE_CLASS := EXECUTABLES
191LOCAL_STATIC_LIBRARIES += \
192 libupdate_engine \
193 libbz \
David Zeuthen753fadc2015-09-15 16:34:09 -0400194 libfs_mgr \
Alex Deymo2e71f902015-09-30 01:25:48 -0700195 libxz \
Alex Deymod5561a52015-09-03 23:17:52 -0700196 update_metadata-protos \
197 update_engine-dbus-adaptor \
198 update_engine-dbus-libcros-client \
199 update_engine_client-dbus-proxies
200LOCAL_SHARED_LIBRARIES += \
201 libprotobuf-cpp-lite-rtti \
202 libdbus \
203 libcrypto \
204 libcurl \
David Zeuthen753fadc2015-09-15 16:34:09 -0400205 libcutils \
206 libhardware \
Alex Deymod5561a52015-09-03 23:17:52 -0700207 libmetrics \
208 libssl \
209 libexpat \
210 libchromeos-policy
211LOCAL_SRC_FILES := \
212 main.cc
Gilad Arnold70141f22015-09-17 09:06:30 -0700213LOCAL_INIT_RC := update_engine.rc
Alex Deymod5561a52015-09-03 23:17:52 -0700214$(eval $(update_engine_common))
215include $(BUILD_EXECUTABLE)
216
217# update_engine_client (type: executable)
218# ========================================================
219# update_engine console client.
220include $(CLEAR_VARS)
221LOCAL_MODULE := update_engine_client
222LOCAL_MODULE_CLASS := EXECUTABLES
223LOCAL_C_INCLUDES += \
224 $(LOCAL_PATH)/include
225LOCAL_STATIC_LIBRARIES += \
226 update_engine_client-dbus-proxies
227LOCAL_SRC_FILES := \
228 update_engine_client.cc
229$(eval $(update_engine_common))
230include $(BUILD_EXECUTABLE)
231
232# libpayload_generator (type: static_library)
233# ========================================================
234# server-side code. This is used for delta_generator and unittests but not
235# for any client code.
236include $(CLEAR_VARS)
237LOCAL_MODULE := libpayload_generator
238LOCAL_MODULE_CLASS := STATIC_LIBRARIES
239LOCAL_STATIC_LIBRARIES += \
240 libupdate_engine \
241 libbz \
David Zeuthen753fadc2015-09-15 16:34:09 -0400242 libfs_mgr \
Alex Deymo2e71f902015-09-30 01:25:48 -0700243 libxz \
Alex Deymod5561a52015-09-03 23:17:52 -0700244 update_metadata-protos \
245 update_engine-dbus-adaptor \
246 update_engine-dbus-libcros-client \
247 update_engine_client-dbus-proxies \
248 update_metadata-protos
249LOCAL_SHARED_LIBRARIES += \
250 libdbus \
251 libcrypto \
252 libcurl \
253 libmetrics \
254 libssl \
255 libexpat \
256 libchromeos-policy \
257 libprotobuf-cpp-lite-rtti \
258 libext2fs
259LOCAL_SRC_FILES := \
260 payload_generator/ab_generator.cc \
261 payload_generator/annotated_operation.cc \
262 payload_generator/blob_file_writer.cc \
263 payload_generator/block_mapping.cc \
264 payload_generator/cycle_breaker.cc \
265 payload_generator/delta_diff_generator.cc \
266 payload_generator/delta_diff_utils.cc \
267 payload_generator/ext2_filesystem.cc \
268 payload_generator/extent_ranges.cc \
269 payload_generator/extent_utils.cc \
270 payload_generator/full_update_generator.cc \
271 payload_generator/graph_types.cc \
272 payload_generator/graph_utils.cc \
273 payload_generator/inplace_generator.cc \
274 payload_generator/payload_file.cc \
275 payload_generator/payload_generation_config.cc \
276 payload_generator/payload_signer.cc \
277 payload_generator/raw_filesystem.cc \
278 payload_generator/tarjan.cc \
279 payload_generator/topological_sort.cc
280$(eval $(update_engine_common))
281include $(BUILD_STATIC_LIBRARY)
282
283# delta_generator (type: executable)
284# ========================================================
285# server-side delta generator.
286include $(CLEAR_VARS)
287LOCAL_MODULE := delta_generator
288LOCAL_MODULE_CLASS := EXECUTABLES
289LOCAL_STATIC_LIBRARIES += \
290 libpayload_generator \
291 libupdate_engine \
292 libbz \
David Zeuthen753fadc2015-09-15 16:34:09 -0400293 libfs_mgr \
Alex Deymo2e71f902015-09-30 01:25:48 -0700294 libxz \
Alex Deymod5561a52015-09-03 23:17:52 -0700295 update_metadata-protos \
296 update_engine-dbus-adaptor \
297 update_engine-dbus-libcros-client \
298 update_engine_client-dbus-proxies
299LOCAL_SHARED_LIBRARIES += \
300 libdbus \
301 libcrypto \
302 libcurl \
303 libmetrics \
304 libssl \
305 libexpat \
306 libchromeos-policy \
307 libprotobuf-cpp-lite-rtti \
308 libext2fs
309LOCAL_SRC_FILES := \
310 payload_generator/generate_delta_main.cc
311$(eval $(update_engine_common))
312include $(BUILD_EXECUTABLE)
313
314# update_engine_client-dbus-proxies (from generate-dbus-proxies.gypi)
315# ========================================================
316include $(CLEAR_VARS)
317LOCAL_MODULE := update_engine_client-dbus-proxies
318LOCAL_SRC_FILES := \
319 dbus_bindings/dbus-service-config.json \
320 dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml
321LOCAL_DBUS_PROXY_PREFIX := update_engine
322include $(BUILD_STATIC_LIBRARY)
Alex Deymo0290c1f2015-09-14 17:45:38 -0700323
Gaurav Shah263614f2015-09-24 14:20:38 -0700324
325# Update payload signing public key.
326# ========================================================
327include $(CLEAR_VARS)
328LOCAL_MODULE := brillo-update-payload-key
329LOCAL_MODULE_CLASS := ETC
330LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/update_engine
331LOCAL_MODULE_STEM := update-payload-key.pub.pem
332LOCAL_SRC_FILES := update_payload_key/brillo-update-payload-key.pub.pem
333LOCAL_BUILT_MODULE_STEM := update_payload_key/brillo-update-payload-key.pub.pem
334include $(BUILD_PREBUILT)