blob: 70cbdcef1e25df01fb241e0102f3a35bb846d85d [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 \
158 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 \
180 utils.cc
181$(eval $(update_engine_common))
182include $(BUILD_STATIC_LIBRARY)
183
184# update_engine (type: executable)
185# ========================================================
186# update_engine daemon.
187include $(CLEAR_VARS)
188LOCAL_MODULE := update_engine
189LOCAL_MODULE_CLASS := EXECUTABLES
190LOCAL_STATIC_LIBRARIES += \
191 libupdate_engine \
192 libbz \
David Zeuthen753fadc2015-09-15 16:34:09 -0400193 libfs_mgr \
Alex Deymod5561a52015-09-03 23:17:52 -0700194 update_metadata-protos \
195 update_engine-dbus-adaptor \
196 update_engine-dbus-libcros-client \
197 update_engine_client-dbus-proxies
198LOCAL_SHARED_LIBRARIES += \
199 libprotobuf-cpp-lite-rtti \
200 libdbus \
201 libcrypto \
202 libcurl \
David Zeuthen753fadc2015-09-15 16:34:09 -0400203 libcutils \
204 libhardware \
Alex Deymod5561a52015-09-03 23:17:52 -0700205 libmetrics \
206 libssl \
207 libexpat \
208 libchromeos-policy
209LOCAL_SRC_FILES := \
210 main.cc
211$(eval $(update_engine_common))
212include $(BUILD_EXECUTABLE)
213
214# update_engine_client (type: executable)
215# ========================================================
216# update_engine console client.
217include $(CLEAR_VARS)
218LOCAL_MODULE := update_engine_client
219LOCAL_MODULE_CLASS := EXECUTABLES
220LOCAL_C_INCLUDES += \
221 $(LOCAL_PATH)/include
222LOCAL_STATIC_LIBRARIES += \
223 update_engine_client-dbus-proxies
224LOCAL_SRC_FILES := \
225 update_engine_client.cc
226$(eval $(update_engine_common))
227include $(BUILD_EXECUTABLE)
228
229# libpayload_generator (type: static_library)
230# ========================================================
231# server-side code. This is used for delta_generator and unittests but not
232# for any client code.
233include $(CLEAR_VARS)
234LOCAL_MODULE := libpayload_generator
235LOCAL_MODULE_CLASS := STATIC_LIBRARIES
236LOCAL_STATIC_LIBRARIES += \
237 libupdate_engine \
238 libbz \
David Zeuthen753fadc2015-09-15 16:34:09 -0400239 libfs_mgr \
Alex Deymod5561a52015-09-03 23:17:52 -0700240 update_metadata-protos \
241 update_engine-dbus-adaptor \
242 update_engine-dbus-libcros-client \
243 update_engine_client-dbus-proxies \
244 update_metadata-protos
245LOCAL_SHARED_LIBRARIES += \
246 libdbus \
247 libcrypto \
248 libcurl \
249 libmetrics \
250 libssl \
251 libexpat \
252 libchromeos-policy \
253 libprotobuf-cpp-lite-rtti \
254 libext2fs
255LOCAL_SRC_FILES := \
256 payload_generator/ab_generator.cc \
257 payload_generator/annotated_operation.cc \
258 payload_generator/blob_file_writer.cc \
259 payload_generator/block_mapping.cc \
260 payload_generator/cycle_breaker.cc \
261 payload_generator/delta_diff_generator.cc \
262 payload_generator/delta_diff_utils.cc \
263 payload_generator/ext2_filesystem.cc \
264 payload_generator/extent_ranges.cc \
265 payload_generator/extent_utils.cc \
266 payload_generator/full_update_generator.cc \
267 payload_generator/graph_types.cc \
268 payload_generator/graph_utils.cc \
269 payload_generator/inplace_generator.cc \
270 payload_generator/payload_file.cc \
271 payload_generator/payload_generation_config.cc \
272 payload_generator/payload_signer.cc \
273 payload_generator/raw_filesystem.cc \
274 payload_generator/tarjan.cc \
275 payload_generator/topological_sort.cc
276$(eval $(update_engine_common))
277include $(BUILD_STATIC_LIBRARY)
278
279# delta_generator (type: executable)
280# ========================================================
281# server-side delta generator.
282include $(CLEAR_VARS)
283LOCAL_MODULE := delta_generator
284LOCAL_MODULE_CLASS := EXECUTABLES
285LOCAL_STATIC_LIBRARIES += \
286 libpayload_generator \
287 libupdate_engine \
288 libbz \
David Zeuthen753fadc2015-09-15 16:34:09 -0400289 libfs_mgr \
Alex Deymod5561a52015-09-03 23:17:52 -0700290 update_metadata-protos \
291 update_engine-dbus-adaptor \
292 update_engine-dbus-libcros-client \
293 update_engine_client-dbus-proxies
294LOCAL_SHARED_LIBRARIES += \
295 libdbus \
296 libcrypto \
297 libcurl \
298 libmetrics \
299 libssl \
300 libexpat \
301 libchromeos-policy \
302 libprotobuf-cpp-lite-rtti \
303 libext2fs
304LOCAL_SRC_FILES := \
305 payload_generator/generate_delta_main.cc
306$(eval $(update_engine_common))
307include $(BUILD_EXECUTABLE)
308
309# update_engine_client-dbus-proxies (from generate-dbus-proxies.gypi)
310# ========================================================
311include $(CLEAR_VARS)
312LOCAL_MODULE := update_engine_client-dbus-proxies
313LOCAL_SRC_FILES := \
314 dbus_bindings/dbus-service-config.json \
315 dbus_bindings/org.chromium.UpdateEngineInterface.dbus-xml
316LOCAL_DBUS_PROXY_PREFIX := update_engine
317include $(BUILD_STATIC_LIBRARY)
Alex Deymo0290c1f2015-09-14 17:45:38 -0700318
319endif # HOST_OS == linux