blob: e3b4ae556d154a0db1efb1816a7358648e0a67ad [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 \
108 libbz
109LOCAL_SHARED_LIBRARIES += \
110 libprotobuf-cpp-lite-rtti \
111 libdbus \
112 libcrypto \
113 libcurl \
114 libmetrics \
115 libssl \
116 libexpat \
117 libchromeos-policy
118LOCAL_SRC_FILES := \
119 action_processor.cc \
120 boot_control_android.cc \
121 bzip.cc \
122 bzip_extent_writer.cc \
123 certificate_checker.cc \
124 chrome_browser_proxy_resolver.cc \
125 clock.cc \
126 connection_manager.cc \
127 constants.cc \
128 daemon.cc \
129 dbus_service.cc \
130 delta_performer.cc \
131 download_action.cc \
132 extent_writer.cc \
133 file_descriptor.cc \
134 file_writer.cc \
135 filesystem_verifier_action.cc \
136 hardware_android.cc \
137 http_common.cc \
138 http_fetcher.cc \
139 hwid_override.cc \
140 install_plan.cc \
141 libcros_proxy.cc \
142 libcurl_http_fetcher.cc \
143 metrics.cc \
144 multi_range_http_fetcher.cc \
145 omaha_hash_calculator.cc \
146 omaha_request_action.cc \
147 omaha_request_params.cc \
148 omaha_response_handler_action.cc \
149 p2p_manager.cc \
150 payload_constants.cc \
151 payload_state.cc \
152 payload_verifier.cc \
153 postinstall_runner_action.cc \
154 prefs.cc \
155 proxy_resolver.cc \
156 real_system_state.cc \
157 shill_proxy.cc \
158 subprocess.cc \
159 terminator.cc \
160 update_attempter.cc \
161 update_manager/boxed_value.cc \
162 update_manager/chromeos_policy.cc \
163 update_manager/default_policy.cc \
164 update_manager/evaluation_context.cc \
165 update_manager/policy.cc \
166 update_manager/real_config_provider.cc \
167 update_manager/real_device_policy_provider.cc \
168 update_manager/real_random_provider.cc \
169 update_manager/real_shill_provider.cc \
170 update_manager/real_system_provider.cc \
171 update_manager/real_time_provider.cc \
172 update_manager/real_updater_provider.cc \
173 update_manager/state_factory.cc \
174 update_manager/update_manager.cc \
175 utils.cc
176$(eval $(update_engine_common))
177include $(BUILD_STATIC_LIBRARY)
178
179# update_engine (type: executable)
180# ========================================================
181# update_engine daemon.
182include $(CLEAR_VARS)
183LOCAL_MODULE := update_engine
184LOCAL_MODULE_CLASS := EXECUTABLES
185LOCAL_STATIC_LIBRARIES += \
186 libupdate_engine \
187 libbz \
188 update_metadata-protos \
189 update_engine-dbus-adaptor \
190 update_engine-dbus-libcros-client \
191 update_engine_client-dbus-proxies
192LOCAL_SHARED_LIBRARIES += \
193 libprotobuf-cpp-lite-rtti \
194 libdbus \
195 libcrypto \
196 libcurl \
197 libmetrics \
198 libssl \
199 libexpat \
200 libchromeos-policy
201LOCAL_SRC_FILES := \
202 main.cc
203$(eval $(update_engine_common))
204include $(BUILD_EXECUTABLE)
205
206# update_engine_client (type: executable)
207# ========================================================
208# update_engine console client.
209include $(CLEAR_VARS)
210LOCAL_MODULE := update_engine_client
211LOCAL_MODULE_CLASS := EXECUTABLES
212LOCAL_C_INCLUDES += \
213 $(LOCAL_PATH)/include
214LOCAL_STATIC_LIBRARIES += \
215 update_engine_client-dbus-proxies
216LOCAL_SRC_FILES := \
217 update_engine_client.cc
218$(eval $(update_engine_common))
219include $(BUILD_EXECUTABLE)
220
221# libpayload_generator (type: static_library)
222# ========================================================
223# server-side code. This is used for delta_generator and unittests but not
224# for any client code.
225include $(CLEAR_VARS)
226LOCAL_MODULE := libpayload_generator
227LOCAL_MODULE_CLASS := STATIC_LIBRARIES
228LOCAL_STATIC_LIBRARIES += \
229 libupdate_engine \
230 libbz \
231 update_metadata-protos \
232 update_engine-dbus-adaptor \
233 update_engine-dbus-libcros-client \
234 update_engine_client-dbus-proxies \
235 update_metadata-protos
236LOCAL_SHARED_LIBRARIES += \
237 libdbus \
238 libcrypto \
239 libcurl \
240 libmetrics \
241 libssl \
242 libexpat \
243 libchromeos-policy \
244 libprotobuf-cpp-lite-rtti \
245 libext2fs
246LOCAL_SRC_FILES := \
247 payload_generator/ab_generator.cc \
248 payload_generator/annotated_operation.cc \
249 payload_generator/blob_file_writer.cc \
250 payload_generator/block_mapping.cc \
251 payload_generator/cycle_breaker.cc \
252 payload_generator/delta_diff_generator.cc \
253 payload_generator/delta_diff_utils.cc \
254 payload_generator/ext2_filesystem.cc \
255 payload_generator/extent_ranges.cc \
256 payload_generator/extent_utils.cc \
257 payload_generator/full_update_generator.cc \
258 payload_generator/graph_types.cc \
259 payload_generator/graph_utils.cc \
260 payload_generator/inplace_generator.cc \
261 payload_generator/payload_file.cc \
262 payload_generator/payload_generation_config.cc \
263 payload_generator/payload_signer.cc \
264 payload_generator/raw_filesystem.cc \
265 payload_generator/tarjan.cc \
266 payload_generator/topological_sort.cc
267$(eval $(update_engine_common))
268include $(BUILD_STATIC_LIBRARY)
269
270# delta_generator (type: executable)
271# ========================================================
272# server-side delta generator.
273include $(CLEAR_VARS)
274LOCAL_MODULE := delta_generator
275LOCAL_MODULE_CLASS := EXECUTABLES
276LOCAL_STATIC_LIBRARIES += \
277 libpayload_generator \
278 libupdate_engine \
279 libbz \
280 update_metadata-protos \
281 update_engine-dbus-adaptor \
282 update_engine-dbus-libcros-client \
283 update_engine_client-dbus-proxies
284LOCAL_SHARED_LIBRARIES += \
285 libdbus \
286 libcrypto \
287 libcurl \
288 libmetrics \
289 libssl \
290 libexpat \
291 libchromeos-policy \
292 libprotobuf-cpp-lite-rtti \
293 libext2fs
294LOCAL_SRC_FILES := \
295 payload_generator/generate_delta_main.cc
296$(eval $(update_engine_common))
297include $(BUILD_EXECUTABLE)
298
299# update_engine_client-dbus-proxies (from generate-dbus-proxies.gypi)
300# ========================================================
301include $(CLEAR_VARS)
302LOCAL_MODULE := update_engine_client-dbus-proxies
303LOCAL_SRC_FILES := \
304 dbus_bindings/dbus-service-config.json \
305 dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml
306LOCAL_DBUS_PROXY_PREFIX := update_engine
307include $(BUILD_STATIC_LIBRARY)