blob: be8b7917f064839849a52309848336b7d8b9094a [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
Alex Deymo0290c1f2015-09-14 17:45:38 -070017ifeq ($(HOST_OS),linux)
18
Alex Deymod5561a52015-09-03 23:17:52 -070019LOCAL_PATH := $(my-dir)
20
21# Definitions applying to all targets. $(eval) this last.
22define update_engine_common
23 LOCAL_CPP_EXTENSION := .cc
24 LOCAL_RTTI_FLAG := -frtti
25 LOCAL_CLANG := true
26
27 LOCAL_CFLAGS += \
28 -DUSE_HWID_OVERRIDE=0 \
29 -DUSE_MTD=0 \
30 -DUSE_POWER_MANAGEMENT=0 \
31 -D_FILE_OFFSET_BITS=64 \
32 -D_POSIX_C_SOURCE=199309L \
33 -Wa,--noexecstack \
34 -Wall \
35 -Werror \
36 -Wextra \
37 -Wformat=2 \
38 -Wno-psabi \
39 -Wno-unused-parameter \
40 -ffunction-sections \
41 -fstack-protector-strong \
42 -fvisibility=hidden
43 LOCAL_CPPFLAGS += \
44 -Wnon-virtual-dtor \
45 -fno-strict-aliasing \
46 -std=gnu++11
47 LOCAL_LDFLAGS += \
48 -Wl,--gc-sections
49 LOCAL_C_INCLUDES += \
50 external/gtest/include \
51 system
52 LOCAL_SHARED_LIBRARIES += \
53 libchrome \
54 libchrome-dbus \
55 libchromeos \
56 libchromeos-dbus \
57 libchromeos-http \
58 libchromeos-stream
59endef
60
61# update_metadata-protos (type: static_library)
62# ========================================================
63# Protobufs.
64include $(CLEAR_VARS)
65LOCAL_MODULE := update_metadata-protos
66LOCAL_MODULE_CLASS := STATIC_LIBRARIES
67generated_sources_dir := $(call local-generated-sources-dir)
68LOCAL_EXPORT_C_INCLUDE_DIRS += \
69 $(generated_sources_dir)/proto/system
70LOCAL_SHARED_LIBRARIES += \
71 libprotobuf-cpp-lite-rtti
72LOCAL_SRC_FILES := \
73 update_metadata.proto
74$(eval $(update_engine_common))
75include $(BUILD_STATIC_LIBRARY)
76
77# update_engine-dbus-adaptor (from generate-dbus-adaptors.gypi)
78# ========================================================
79include $(CLEAR_VARS)
80LOCAL_MODULE := update_engine-dbus-adaptor
81LOCAL_SRC_FILES := \
82 dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml
83include $(BUILD_STATIC_LIBRARY)
84
85# update_engine-dbus-libcros-client (from generate-dbus-proxies.gypi)
86# ========================================================
87include $(CLEAR_VARS)
88LOCAL_MODULE := update_engine-dbus-libcros-client
89LOCAL_SRC_FILES := \
90 dbus_bindings/org.chromium.LibCrosService.dbus-xml
91LOCAL_DBUS_PROXY_PREFIX := libcros
92include $(BUILD_STATIC_LIBRARY)
93
94# libupdate_engine (type: static_library)
95# ========================================================
96# The main static_library with all the code.
97include $(CLEAR_VARS)
98LOCAL_MODULE := libupdate_engine
99LOCAL_MODULE_CLASS := STATIC_LIBRARIES
100LOCAL_C_INCLUDES += \
101 external/e2fsprogs/lib \
102 $(LOCAL_PATH)/include
103LOCAL_EXPORT_C_INCLUDE_DIRS += \
104 $(LOCAL_PATH)/include
105LOCAL_STATIC_LIBRARIES += \
106 update_metadata-protos \
107 update_engine-dbus-adaptor \
108 update_engine-dbus-libcros-client \
109 update_engine_client-dbus-proxies \
David Zeuthen753fadc2015-09-15 16:34:09 -0400110 libbz \
111 libfs_mgr
Alex Deymod5561a52015-09-03 23:17:52 -0700112LOCAL_SHARED_LIBRARIES += \
113 libprotobuf-cpp-lite-rtti \
114 libdbus \
115 libcrypto \
116 libcurl \
David Zeuthen753fadc2015-09-15 16:34:09 -0400117 libcutils \
118 libhardware \
Alex Deymod5561a52015-09-03 23:17:52 -0700119 libmetrics \
120 libssl \
121 libexpat \
122 libchromeos-policy
123LOCAL_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 \
181 utils.cc
182$(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 Deymod5561a52015-09-03 23:17:52 -0700195 update_metadata-protos \
196 update_engine-dbus-adaptor \
197 update_engine-dbus-libcros-client \
198 update_engine_client-dbus-proxies
199LOCAL_SHARED_LIBRARIES += \
200 libprotobuf-cpp-lite-rtti \
201 libdbus \
202 libcrypto \
203 libcurl \
David Zeuthen753fadc2015-09-15 16:34:09 -0400204 libcutils \
205 libhardware \
Alex Deymod5561a52015-09-03 23:17:52 -0700206 libmetrics \
207 libssl \
208 libexpat \
209 libchromeos-policy
210LOCAL_SRC_FILES := \
211 main.cc
Gilad Arnold70141f22015-09-17 09:06:30 -0700212LOCAL_INIT_RC := update_engine.rc
Alex Deymod5561a52015-09-03 23:17:52 -0700213$(eval $(update_engine_common))
214include $(BUILD_EXECUTABLE)
215
216# update_engine_client (type: executable)
217# ========================================================
218# update_engine console client.
219include $(CLEAR_VARS)
220LOCAL_MODULE := update_engine_client
221LOCAL_MODULE_CLASS := EXECUTABLES
222LOCAL_C_INCLUDES += \
223 $(LOCAL_PATH)/include
224LOCAL_STATIC_LIBRARIES += \
225 update_engine_client-dbus-proxies
226LOCAL_SRC_FILES := \
227 update_engine_client.cc
228$(eval $(update_engine_common))
229include $(BUILD_EXECUTABLE)
230
231# libpayload_generator (type: static_library)
232# ========================================================
233# server-side code. This is used for delta_generator and unittests but not
234# for any client code.
235include $(CLEAR_VARS)
236LOCAL_MODULE := libpayload_generator
237LOCAL_MODULE_CLASS := STATIC_LIBRARIES
238LOCAL_STATIC_LIBRARIES += \
239 libupdate_engine \
240 libbz \
David Zeuthen753fadc2015-09-15 16:34:09 -0400241 libfs_mgr \
Alex Deymod5561a52015-09-03 23:17:52 -0700242 update_metadata-protos \
243 update_engine-dbus-adaptor \
244 update_engine-dbus-libcros-client \
245 update_engine_client-dbus-proxies \
246 update_metadata-protos
247LOCAL_SHARED_LIBRARIES += \
248 libdbus \
249 libcrypto \
250 libcurl \
251 libmetrics \
252 libssl \
253 libexpat \
254 libchromeos-policy \
255 libprotobuf-cpp-lite-rtti \
256 libext2fs
257LOCAL_SRC_FILES := \
258 payload_generator/ab_generator.cc \
259 payload_generator/annotated_operation.cc \
260 payload_generator/blob_file_writer.cc \
261 payload_generator/block_mapping.cc \
262 payload_generator/cycle_breaker.cc \
263 payload_generator/delta_diff_generator.cc \
264 payload_generator/delta_diff_utils.cc \
265 payload_generator/ext2_filesystem.cc \
266 payload_generator/extent_ranges.cc \
267 payload_generator/extent_utils.cc \
268 payload_generator/full_update_generator.cc \
269 payload_generator/graph_types.cc \
270 payload_generator/graph_utils.cc \
271 payload_generator/inplace_generator.cc \
272 payload_generator/payload_file.cc \
273 payload_generator/payload_generation_config.cc \
274 payload_generator/payload_signer.cc \
275 payload_generator/raw_filesystem.cc \
276 payload_generator/tarjan.cc \
277 payload_generator/topological_sort.cc
278$(eval $(update_engine_common))
279include $(BUILD_STATIC_LIBRARY)
280
281# delta_generator (type: executable)
282# ========================================================
283# server-side delta generator.
284include $(CLEAR_VARS)
285LOCAL_MODULE := delta_generator
286LOCAL_MODULE_CLASS := EXECUTABLES
287LOCAL_STATIC_LIBRARIES += \
288 libpayload_generator \
289 libupdate_engine \
290 libbz \
David Zeuthen753fadc2015-09-15 16:34:09 -0400291 libfs_mgr \
Alex Deymod5561a52015-09-03 23:17:52 -0700292 update_metadata-protos \
293 update_engine-dbus-adaptor \
294 update_engine-dbus-libcros-client \
295 update_engine_client-dbus-proxies
296LOCAL_SHARED_LIBRARIES += \
297 libdbus \
298 libcrypto \
299 libcurl \
300 libmetrics \
301 libssl \
302 libexpat \
303 libchromeos-policy \
304 libprotobuf-cpp-lite-rtti \
305 libext2fs
306LOCAL_SRC_FILES := \
307 payload_generator/generate_delta_main.cc
308$(eval $(update_engine_common))
309include $(BUILD_EXECUTABLE)
310
311# update_engine_client-dbus-proxies (from generate-dbus-proxies.gypi)
312# ========================================================
313include $(CLEAR_VARS)
314LOCAL_MODULE := update_engine_client-dbus-proxies
315LOCAL_SRC_FILES := \
316 dbus_bindings/dbus-service-config.json \
317 dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml
318LOCAL_DBUS_PROXY_PREFIX := update_engine
319include $(BUILD_STATIC_LIBRARY)
Alex Deymo0290c1f2015-09-14 17:45:38 -0700320
Gaurav Shah263614f2015-09-24 14:20:38 -0700321
322# Update payload signing public key.
323# ========================================================
324include $(CLEAR_VARS)
325LOCAL_MODULE := brillo-update-payload-key
326LOCAL_MODULE_CLASS := ETC
327LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/update_engine
328LOCAL_MODULE_STEM := update-payload-key.pub.pem
329LOCAL_SRC_FILES := update_payload_key/brillo-update-payload-key.pub.pem
330LOCAL_BUILT_MODULE_STEM := update_payload_key/brillo-update-payload-key.pub.pem
331include $(BUILD_PREBUILT)
332
Alex Deymo0290c1f2015-09-14 17:45:38 -0700333endif # HOST_OS == linux