blob: 45fa10fabb60206acd733f5601d8dc075e38dfdc [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 \
129 bzip.cc \
130 bzip_extent_writer.cc \
131 certificate_checker.cc \
132 chrome_browser_proxy_resolver.cc \
133 clock.cc \
134 connection_manager.cc \
135 constants.cc \
136 daemon.cc \
137 dbus_service.cc \
138 delta_performer.cc \
139 download_action.cc \
140 extent_writer.cc \
141 file_descriptor.cc \
142 file_writer.cc \
143 filesystem_verifier_action.cc \
144 hardware_android.cc \
145 http_common.cc \
146 http_fetcher.cc \
147 hwid_override.cc \
148 install_plan.cc \
149 libcros_proxy.cc \
150 libcurl_http_fetcher.cc \
151 metrics.cc \
152 multi_range_http_fetcher.cc \
153 omaha_hash_calculator.cc \
154 omaha_request_action.cc \
155 omaha_request_params.cc \
156 omaha_response_handler_action.cc \
157 p2p_manager.cc \
158 payload_constants.cc \
159 payload_state.cc \
160 payload_verifier.cc \
Alex Deymoac41a822015-09-15 20:52:53 -0700161 platform_constants_android.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700162 postinstall_runner_action.cc \
163 prefs.cc \
164 proxy_resolver.cc \
165 real_system_state.cc \
166 shill_proxy.cc \
167 subprocess.cc \
168 terminator.cc \
169 update_attempter.cc \
170 update_manager/boxed_value.cc \
171 update_manager/chromeos_policy.cc \
172 update_manager/default_policy.cc \
173 update_manager/evaluation_context.cc \
174 update_manager/policy.cc \
175 update_manager/real_config_provider.cc \
176 update_manager/real_device_policy_provider.cc \
177 update_manager/real_random_provider.cc \
178 update_manager/real_shill_provider.cc \
179 update_manager/real_system_provider.cc \
180 update_manager/real_time_provider.cc \
181 update_manager/real_updater_provider.cc \
182 update_manager/state_factory.cc \
183 update_manager/update_manager.cc \
Christopher Wileycc8ce0e2015-10-01 16:48:47 -0700184 update_status_utils.cc \
Alex Deymo2e71f902015-09-30 01:25:48 -0700185 utils.cc \
186 xz_extent_writer.cc
Alex Deymod5561a52015-09-03 23:17:52 -0700187$(eval $(update_engine_common))
188include $(BUILD_STATIC_LIBRARY)
189
190# update_engine (type: executable)
191# ========================================================
192# update_engine daemon.
193include $(CLEAR_VARS)
194LOCAL_MODULE := update_engine
195LOCAL_MODULE_CLASS := EXECUTABLES
196LOCAL_STATIC_LIBRARIES += \
197 libupdate_engine \
198 libbz \
David Zeuthen753fadc2015-09-15 16:34:09 -0400199 libfs_mgr \
Alex Deymod5561a52015-09-03 23:17:52 -0700200 update_metadata-protos \
201 update_engine-dbus-adaptor \
202 update_engine-dbus-libcros-client \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700203 update_engine_client-dbus-proxies \
204 libxz
Alex Deymod5561a52015-09-03 23:17:52 -0700205LOCAL_SHARED_LIBRARIES += \
206 libprotobuf-cpp-lite-rtti \
207 libdbus \
208 libcrypto \
209 libcurl \
210 libmetrics \
Alex Deymo7eb23052015-10-09 15:27:59 -0700211 libshill-client \
Alex Deymod5561a52015-09-03 23:17:52 -0700212 libssl \
213 libexpat \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700214 libchromeos-policy \
215 libhardware \
216 libcutils
Alex Deymod5561a52015-09-03 23:17:52 -0700217LOCAL_SRC_FILES := \
218 main.cc
Gilad Arnold70141f22015-09-17 09:06:30 -0700219LOCAL_INIT_RC := update_engine.rc
Alex Deymod5561a52015-09-03 23:17:52 -0700220$(eval $(update_engine_common))
221include $(BUILD_EXECUTABLE)
222
223# update_engine_client (type: executable)
224# ========================================================
225# update_engine console client.
226include $(CLEAR_VARS)
227LOCAL_MODULE := update_engine_client
228LOCAL_MODULE_CLASS := EXECUTABLES
229LOCAL_C_INCLUDES += \
230 $(LOCAL_PATH)/include
231LOCAL_STATIC_LIBRARIES += \
232 update_engine_client-dbus-proxies
233LOCAL_SRC_FILES := \
234 update_engine_client.cc
235$(eval $(update_engine_common))
236include $(BUILD_EXECUTABLE)
237
238# libpayload_generator (type: static_library)
239# ========================================================
240# server-side code. This is used for delta_generator and unittests but not
241# for any client code.
242include $(CLEAR_VARS)
243LOCAL_MODULE := libpayload_generator
244LOCAL_MODULE_CLASS := STATIC_LIBRARIES
245LOCAL_STATIC_LIBRARIES += \
246 libupdate_engine \
247 libbz \
David Zeuthen753fadc2015-09-15 16:34:09 -0400248 libfs_mgr \
Alex Deymod5561a52015-09-03 23:17:52 -0700249 update_metadata-protos \
250 update_engine-dbus-adaptor \
251 update_engine-dbus-libcros-client \
252 update_engine_client-dbus-proxies \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700253 libxz \
Alex Deymod5561a52015-09-03 23:17:52 -0700254 update_metadata-protos
255LOCAL_SHARED_LIBRARIES += \
256 libdbus \
257 libcrypto \
258 libcurl \
259 libmetrics \
Alex Deymo7eb23052015-10-09 15:27:59 -0700260 libshill-client \
Alex Deymod5561a52015-09-03 23:17:52 -0700261 libssl \
262 libexpat \
263 libchromeos-policy \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700264 libhardware \
265 libcutils \
Alex Deymod5561a52015-09-03 23:17:52 -0700266 libprotobuf-cpp-lite-rtti \
267 libext2fs
268LOCAL_SRC_FILES := \
269 payload_generator/ab_generator.cc \
270 payload_generator/annotated_operation.cc \
271 payload_generator/blob_file_writer.cc \
272 payload_generator/block_mapping.cc \
273 payload_generator/cycle_breaker.cc \
274 payload_generator/delta_diff_generator.cc \
275 payload_generator/delta_diff_utils.cc \
276 payload_generator/ext2_filesystem.cc \
277 payload_generator/extent_ranges.cc \
278 payload_generator/extent_utils.cc \
279 payload_generator/full_update_generator.cc \
280 payload_generator/graph_types.cc \
281 payload_generator/graph_utils.cc \
282 payload_generator/inplace_generator.cc \
283 payload_generator/payload_file.cc \
284 payload_generator/payload_generation_config.cc \
285 payload_generator/payload_signer.cc \
286 payload_generator/raw_filesystem.cc \
287 payload_generator/tarjan.cc \
288 payload_generator/topological_sort.cc
289$(eval $(update_engine_common))
290include $(BUILD_STATIC_LIBRARY)
291
292# delta_generator (type: executable)
293# ========================================================
294# server-side delta generator.
295include $(CLEAR_VARS)
296LOCAL_MODULE := delta_generator
297LOCAL_MODULE_CLASS := EXECUTABLES
298LOCAL_STATIC_LIBRARIES += \
299 libpayload_generator \
300 libupdate_engine \
301 libbz \
David Zeuthen753fadc2015-09-15 16:34:09 -0400302 libfs_mgr \
Alex Deymod5561a52015-09-03 23:17:52 -0700303 update_metadata-protos \
304 update_engine-dbus-adaptor \
305 update_engine-dbus-libcros-client \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700306 update_engine_client-dbus-proxies \
307 libxz
Alex Deymod5561a52015-09-03 23:17:52 -0700308LOCAL_SHARED_LIBRARIES += \
309 libdbus \
310 libcrypto \
311 libcurl \
312 libmetrics \
Alex Deymo7eb23052015-10-09 15:27:59 -0700313 libshill-client \
Alex Deymod5561a52015-09-03 23:17:52 -0700314 libssl \
315 libexpat \
316 libchromeos-policy \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700317 libhardware \
318 libcutils \
Alex Deymod5561a52015-09-03 23:17:52 -0700319 libprotobuf-cpp-lite-rtti \
320 libext2fs
321LOCAL_SRC_FILES := \
322 payload_generator/generate_delta_main.cc
323$(eval $(update_engine_common))
324include $(BUILD_EXECUTABLE)
325
326# update_engine_client-dbus-proxies (from generate-dbus-proxies.gypi)
327# ========================================================
328include $(CLEAR_VARS)
329LOCAL_MODULE := update_engine_client-dbus-proxies
330LOCAL_SRC_FILES := \
331 dbus_bindings/dbus-service-config.json \
332 dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml
333LOCAL_DBUS_PROXY_PREFIX := update_engine
334include $(BUILD_STATIC_LIBRARY)
Alex Deymo0290c1f2015-09-14 17:45:38 -0700335
Christopher Wiley16daa082015-10-01 17:18:40 -0700336# libupdate_engine_client
337# ========================================================
338include $(CLEAR_VARS)
339LOCAL_MODULE := libupdate_engine_client
340LOCAL_RTTI_FLAG := -frtti
341LOCAL_CFLAGS := \
342 -Wall \
343 -Werror \
344 -Wno-unused-parameter
345LOCAL_CLANG := true
346LOCAL_CPP_EXTENSION := .cc
347LOCAL_C_INCLUDES := \
348 $(LOCAL_PATH)/client_library/include \
349 external/cros/system_api/dbus \
350 system \
351 external/gtest/include
352LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/client_library/include
353LOCAL_SHARED_LIBRARIES := \
354 libchrome \
355 libchrome-dbus \
356 libchromeos \
357 libchromeos-dbus
358LOCAL_STATIC_LIBRARIES := \
359 update_engine_client-dbus-proxies
360LOCAL_SRC_FILES := \
361 client_library/client.cc \
362 client_library/client_impl.cc \
363 update_status_utils.cc
364include $(BUILD_SHARED_LIBRARY)
365
Gaurav Shah263614f2015-09-24 14:20:38 -0700366
367# Update payload signing public key.
368# ========================================================
369include $(CLEAR_VARS)
370LOCAL_MODULE := brillo-update-payload-key
371LOCAL_MODULE_CLASS := ETC
372LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/update_engine
373LOCAL_MODULE_STEM := update-payload-key.pub.pem
374LOCAL_SRC_FILES := update_payload_key/brillo-update-payload-key.pub.pem
375LOCAL_BUILT_MODULE_STEM := update_payload_key/brillo-update-payload-key.pub.pem
376include $(BUILD_PREBUILT)