blob: bb76751315ca476e76bca56e29d86218302e0262 [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 += \
Alex Vakulenko1bab5a82015-10-27 11:47:28 -070052 libbrillo \
53 libbrillo-dbus \
54 libbrillo-http \
55 libbrillo-stream
Alex Deymod5561a52015-09-03 23:17:52 -070056 libchrome \
57 libchrome-dbus \
Alex Deymod5561a52015-09-03 23:17:52 -070058endef
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 Vakulenko1bab5a82015-10-27 11:47:28 -0700123 libbrillo-policy \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700124 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_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 \
Alex Deymo85616652015-10-15 18:48:31 -0700148 image_properties_android.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700149 install_plan.cc \
150 libcros_proxy.cc \
151 libcurl_http_fetcher.cc \
152 metrics.cc \
153 multi_range_http_fetcher.cc \
154 omaha_hash_calculator.cc \
155 omaha_request_action.cc \
156 omaha_request_params.cc \
157 omaha_response_handler_action.cc \
158 p2p_manager.cc \
159 payload_constants.cc \
160 payload_state.cc \
161 payload_verifier.cc \
Alex Deymoac41a822015-09-15 20:52:53 -0700162 platform_constants_android.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700163 postinstall_runner_action.cc \
164 prefs.cc \
165 proxy_resolver.cc \
166 real_system_state.cc \
167 shill_proxy.cc \
168 subprocess.cc \
169 terminator.cc \
170 update_attempter.cc \
171 update_manager/boxed_value.cc \
172 update_manager/chromeos_policy.cc \
173 update_manager/default_policy.cc \
174 update_manager/evaluation_context.cc \
175 update_manager/policy.cc \
176 update_manager/real_config_provider.cc \
177 update_manager/real_device_policy_provider.cc \
178 update_manager/real_random_provider.cc \
179 update_manager/real_shill_provider.cc \
180 update_manager/real_system_provider.cc \
181 update_manager/real_time_provider.cc \
182 update_manager/real_updater_provider.cc \
183 update_manager/state_factory.cc \
184 update_manager/update_manager.cc \
Christopher Wileycc8ce0e2015-10-01 16:48:47 -0700185 update_status_utils.cc \
Alex Deymo2e71f902015-09-30 01:25:48 -0700186 utils.cc \
187 xz_extent_writer.cc
Alex Deymod5561a52015-09-03 23:17:52 -0700188$(eval $(update_engine_common))
189include $(BUILD_STATIC_LIBRARY)
190
191# update_engine (type: executable)
192# ========================================================
193# update_engine daemon.
194include $(CLEAR_VARS)
195LOCAL_MODULE := update_engine
196LOCAL_MODULE_CLASS := EXECUTABLES
197LOCAL_STATIC_LIBRARIES += \
198 libupdate_engine \
199 libbz \
David Zeuthen753fadc2015-09-15 16:34:09 -0400200 libfs_mgr \
Alex Deymod5561a52015-09-03 23:17:52 -0700201 update_metadata-protos \
202 update_engine-dbus-adaptor \
203 update_engine-dbus-libcros-client \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700204 update_engine_client-dbus-proxies \
205 libxz
Alex Deymod5561a52015-09-03 23:17:52 -0700206LOCAL_SHARED_LIBRARIES += \
207 libprotobuf-cpp-lite-rtti \
208 libdbus \
209 libcrypto \
210 libcurl \
211 libmetrics \
Alex Deymo7eb23052015-10-09 15:27:59 -0700212 libshill-client \
Alex Deymod5561a52015-09-03 23:17:52 -0700213 libssl \
214 libexpat \
Alex Vakulenko1bab5a82015-10-27 11:47:28 -0700215 libbrillo-policy \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700216 libhardware \
217 libcutils
Alex Deymod5561a52015-09-03 23:17:52 -0700218LOCAL_SRC_FILES := \
219 main.cc
Gilad Arnold70141f22015-09-17 09:06:30 -0700220LOCAL_INIT_RC := update_engine.rc
Alex Deymod5561a52015-09-03 23:17:52 -0700221$(eval $(update_engine_common))
222include $(BUILD_EXECUTABLE)
223
224# update_engine_client (type: executable)
225# ========================================================
226# update_engine console client.
227include $(CLEAR_VARS)
228LOCAL_MODULE := update_engine_client
229LOCAL_MODULE_CLASS := EXECUTABLES
230LOCAL_C_INCLUDES += \
231 $(LOCAL_PATH)/include
232LOCAL_STATIC_LIBRARIES += \
233 update_engine_client-dbus-proxies
234LOCAL_SRC_FILES := \
235 update_engine_client.cc
236$(eval $(update_engine_common))
237include $(BUILD_EXECUTABLE)
238
239# libpayload_generator (type: static_library)
240# ========================================================
241# server-side code. This is used for delta_generator and unittests but not
242# for any client code.
243include $(CLEAR_VARS)
244LOCAL_MODULE := libpayload_generator
245LOCAL_MODULE_CLASS := STATIC_LIBRARIES
246LOCAL_STATIC_LIBRARIES += \
247 libupdate_engine \
248 libbz \
David Zeuthen753fadc2015-09-15 16:34:09 -0400249 libfs_mgr \
Alex Deymod5561a52015-09-03 23:17:52 -0700250 update_metadata-protos \
251 update_engine-dbus-adaptor \
252 update_engine-dbus-libcros-client \
253 update_engine_client-dbus-proxies \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700254 libxz \
Alex Deymod5561a52015-09-03 23:17:52 -0700255 update_metadata-protos
256LOCAL_SHARED_LIBRARIES += \
257 libdbus \
258 libcrypto \
259 libcurl \
260 libmetrics \
Alex Deymo7eb23052015-10-09 15:27:59 -0700261 libshill-client \
Alex Deymod5561a52015-09-03 23:17:52 -0700262 libssl \
263 libexpat \
Alex Vakulenko1bab5a82015-10-27 11:47:28 -0700264 libbrillo-policy \
Alex Deymoeadab7d2015-10-09 14:45:02 -0700265 libhardware \
266 libcutils \
Alex Deymod5561a52015-09-03 23:17:52 -0700267 libprotobuf-cpp-lite-rtti \
268 libext2fs
269LOCAL_SRC_FILES := \
270 payload_generator/ab_generator.cc \
271 payload_generator/annotated_operation.cc \
272 payload_generator/blob_file_writer.cc \
273 payload_generator/block_mapping.cc \
Alex Deymo0bc26112015-10-19 20:54:57 -0700274 payload_generator/bzip.cc \
Alex Deymod5561a52015-09-03 23:17:52 -0700275 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 \
Alex Vakulenko1bab5a82015-10-27 11:47:28 -0700318 libbrillo-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 \
Alex Vakulenko1bab5a82015-10-27 11:47:28 -0700358 libbrillo \
359 libbrillo-dbus
Christopher Wiley16daa082015-10-01 17:18:40 -0700360LOCAL_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)