blob: cfea326d0cba39f58e2c0dba5e0b6005d35fe458 [file] [log] [blame]
Alex Deymo719bfff2014-07-11 12:12:32 -07001{
2 'target_defaults': {
3 'variables': {
4 'deps': [
5 'libchrome-<(libbase_ver)',
6 'libchromeos-<(libbase_ver)',
7 ],
8 # Defaults if the -DUSE_* flags are not passed to gyp is 0. You can set
9 # the default value for the USE flag in the ebuild.
10 'USE_hwid_override%': '0',
11 'USE_power_management%': '0',
12 },
13 'cflags': [
14 '-g',
15 '-ffunction-sections',
16 '-Wall',
17 '-Wextra',
18 '-Werror',
19 '-Wno-unused-parameter',
20 '-Wno-deprecated-register',
21 ],
22 'cflags_cc': [
23 '-fno-strict-aliasing',
Nam T. Nguyenfc144e62014-12-03 09:50:49 -080024 '-Wnon-virtual-dtor',
Alex Deymo719bfff2014-07-11 12:12:32 -070025 ],
26 'ldflags': [
27 '-Wl,--gc-sections',
28 ],
29 'defines': [
Alex Deymo719bfff2014-07-11 12:12:32 -070030 '_POSIX_C_SOURCE=199309L',
31 'USE_HWID_OVERRIDE=<(USE_hwid_override)',
Nam T. Nguyenf1d582e2014-12-08 15:07:17 -080032 'USE_MTD=<(USE_mtd)',
Alex Deymo719bfff2014-07-11 12:12:32 -070033 'USE_POWER_MANAGEMENT=<(USE_power_management)',
34 ],
35 },
36 'targets': [
37 # Protobufs.
38 {
39 'target_name': 'update_metadata-protos',
40 'type': 'static_library',
41 'variables': {
42 'proto_in_dir': '.',
43 'proto_out_dir': 'include/update_engine',
Alex Deymo7504e5f2014-07-15 17:58:51 -070044 'exported_deps': [
Alex Deymob8f16a12014-06-10 18:59:22 -070045 'protobuf-lite',
Alex Deymo7504e5f2014-07-15 17:58:51 -070046 ],
47 'deps': ['<@(exported_deps)'],
48 },
49 'all_dependent_settings': {
50 'variables': {
51 'deps': [
52 '<@(exported_deps)',
53 ],
54 },
Alex Deymo719bfff2014-07-11 12:12:32 -070055 },
56 'sources': [
57 'update_metadata.proto'
58 ],
59 'includes': ['../common-mk/protoc.gypi'],
60 },
61 # D-Bus glib bindings.
62 {
63 'target_name': 'update_engine-dbus-client',
64 'type': 'none',
65 'variables': {
66 'dbus_glib_type': 'client',
67 'dbus_glib_out_dir': 'include/update_engine',
68 'dbus_glib_prefix': 'update_engine_service',
69 },
70 'sources': [
Timothy Jennison08d49312015-03-04 13:46:40 -050071 'dbus_bindings/org.chromium.UpdateEngineInterface.xml',
Alex Deymo719bfff2014-07-11 12:12:32 -070072 ],
73 'includes': ['../common-mk/dbus_glib.gypi'],
74 },
75 {
76 'target_name': 'update_engine-dbus-server',
77 'type': 'none',
78 'variables': {
79 'dbus_glib_type': 'server',
80 'dbus_glib_out_dir': 'include/update_engine',
81 'dbus_glib_prefix': 'update_engine_service',
82 },
83 'sources': [
Timothy Jennison08d49312015-03-04 13:46:40 -050084 'dbus_bindings/org.chromium.UpdateEngineInterface.xml',
Alex Deymo719bfff2014-07-11 12:12:32 -070085 ],
86 'includes': ['../common-mk/dbus_glib.gypi'],
87 },
88 # The main static_library with all the code.
89 {
90 'target_name': 'libupdate_engine',
91 'type': 'static_library',
92 'dependencies': [
93 'update_metadata-protos',
Alex Deymo719bfff2014-07-11 12:12:32 -070094 ],
95 'variables': {
96 'exported_deps': [
97 'dbus-1',
98 'dbus-glib-1',
Alex Deymo719bfff2014-07-11 12:12:32 -070099 'gio-2.0',
100 'gio-unix-2.0',
101 'glib-2.0',
102 'gthread-2.0',
103 'libchrome-<(libbase_ver)',
104 'libchromeos-<(libbase_ver)',
105 'libcrypto',
106 'libcurl',
107 'libmetrics-<(libbase_ver)',
108 'libssl',
David Zeuthene8ed8632014-07-24 13:38:10 -0400109 'expat'
Alex Deymo719bfff2014-07-11 12:12:32 -0700110 ],
111 'deps': ['<@(exported_deps)'],
112 },
113 'all_dependent_settings': {
114 'variables': {
115 'deps': [
116 '<@(exported_deps)',
117 ],
118 },
119 },
120 'link_settings': {
121 'variables': {
122 'deps': [
123 '<@(exported_deps)',
124 ],
125 },
126 'libraries': [
127 '-lbz2',
Alex Deymo719bfff2014-07-11 12:12:32 -0700128 '-lpolicy-<(libbase_ver)',
129 '-lrootdev',
130 '-lrt',
131 '-lvboot_host',
132 ],
133 },
134 'sources': [
135 'action_processor.cc',
136 'bzip.cc',
137 'bzip_extent_writer.cc',
138 'certificate_checker.cc',
139 'chrome_browser_proxy_resolver.cc',
140 'clock.cc',
141 'connection_manager.cc',
142 'constants.cc',
143 'dbus_service.cc',
144 'delta_performer.cc',
145 'download_action.cc',
Alex Deymo719bfff2014-07-11 12:12:32 -0700146 'extent_writer.cc',
147 'file_descriptor.cc',
148 'file_writer.cc',
Allie Woodeb9e6d82015-04-17 13:55:30 -0700149 'filesystem_verifier_action.cc',
Alex Deymo44666f92014-07-22 20:29:24 -0700150 'glib_utils.cc',
Alex Deymo719bfff2014-07-11 12:12:32 -0700151 'hardware.cc',
152 'http_common.cc',
153 'http_fetcher.cc',
154 'hwid_override.cc',
155 'install_plan.cc',
156 'libcurl_http_fetcher.cc',
157 'metrics.cc',
158 'multi_range_http_fetcher.cc',
159 'omaha_hash_calculator.cc',
160 'omaha_request_action.cc',
161 'omaha_request_params.cc',
162 'omaha_response_handler_action.cc',
163 'p2p_manager.cc',
164 'payload_constants.cc',
Alex Deymo719bfff2014-07-11 12:12:32 -0700165 'payload_state.cc',
Alex Deymo923d8fa2014-07-15 17:58:51 -0700166 'payload_verifier.cc',
Alex Deymo719bfff2014-07-11 12:12:32 -0700167 'postinstall_runner_action.cc',
168 'prefs.cc',
169 'proxy_resolver.cc',
170 'real_system_state.cc',
Alex Deymo719bfff2014-07-11 12:12:32 -0700171 'subprocess.cc',
172 'terminator.cc',
173 'update_attempter.cc',
Alex Deymo719bfff2014-07-11 12:12:32 -0700174 'update_manager/boxed_value.cc',
175 'update_manager/chromeos_policy.cc',
Gilad Arnolda23e4082014-07-17 11:40:43 -0700176 'update_manager/default_policy.cc',
Alex Deymo719bfff2014-07-11 12:12:32 -0700177 'update_manager/evaluation_context.cc',
178 'update_manager/event_loop.cc',
179 'update_manager/policy.cc',
180 'update_manager/real_config_provider.cc',
181 'update_manager/real_device_policy_provider.cc',
182 'update_manager/real_random_provider.cc',
183 'update_manager/real_shill_provider.cc',
184 'update_manager/real_system_provider.cc',
185 'update_manager/real_time_provider.cc',
186 'update_manager/real_updater_provider.cc',
187 'update_manager/state_factory.cc',
188 'update_manager/update_manager.cc',
189 'utils.cc',
190 ],
Nam T. Nguyenf1d582e2014-12-08 15:07:17 -0800191 'conditions': [
192 ['USE_mtd == 1', {
193 'sources': [
194 'mtd_file_descriptor.cc',
195 ],
196 'link_settings': {
197 'libraries': [
198 '-lmtdutils',
199 ],
200 },
201 }],
202 ],
Alex Deymo719bfff2014-07-11 12:12:32 -0700203 },
204 # update_engine daemon.
205 {
206 'target_name': 'update_engine',
207 'type': 'executable',
Alex Deymo44666f92014-07-22 20:29:24 -0700208 'dependencies': [
209 'libupdate_engine',
210 'update_engine-dbus-server',
211 ],
Alex Deymo719bfff2014-07-11 12:12:32 -0700212 'sources': [
213 'main.cc',
214 ]
215 },
216 # update_engine console client.
217 {
218 'target_name': 'update_engine_client',
219 'type': 'executable',
Alex Deymo44666f92014-07-22 20:29:24 -0700220 'dependencies': [
221 'update_engine-dbus-client',
222 ],
223 'variables': {
224 'exported_deps': [
225 'dbus-1',
226 'dbus-glib-1',
227 'glib-2.0',
228 'gthread-2.0',
229 'libchrome-<(libbase_ver)',
230 'libchromeos-<(libbase_ver)',
231 ],
232 'deps': ['<@(exported_deps)'],
233 },
234 'link_settings': {
235 'variables': {
236 'deps': [
237 '<@(exported_deps)',
238 ],
239 },
Alex Deymo44666f92014-07-22 20:29:24 -0700240 },
Alex Deymo719bfff2014-07-11 12:12:32 -0700241 'sources': [
Alex Deymo44666f92014-07-22 20:29:24 -0700242 'glib_utils.cc',
Alex Deymo719bfff2014-07-11 12:12:32 -0700243 'update_engine_client.cc',
244 ]
245 },
Alex Deymo7504e5f2014-07-15 17:58:51 -0700246 # server-side code. This is used for delta_generator and unittests but not
247 # for any client code.
248 {
249 'target_name': 'libpayload_generator',
250 'type': 'static_library',
251 'dependencies': [
252 'update_metadata-protos',
253 ],
Alex Deymo5d527802014-07-18 14:24:13 -0700254 'variables': {
255 'exported_deps': [
256 'ext2fs',
257 ],
258 'deps': ['<@(exported_deps)'],
259 },
260 'all_dependent_settings': {
261 'variables': {
262 'deps': [
263 '<@(exported_deps)',
264 ],
265 },
266 },
267 'link_settings': {
268 'variables': {
269 'deps': [
270 '<@(exported_deps)',
271 ],
272 },
Alex Deymoa26432a2015-03-12 16:08:04 -0700273 'libraries': [
274 '-lvboot_host',
275 ],
Alex Deymo5d527802014-07-18 14:24:13 -0700276 },
Alex Deymo7504e5f2014-07-15 17:58:51 -0700277 'sources': [
Alex Deymo477aec22015-03-24 23:40:48 -0700278 'payload_generator/annotated_operation.cc',
Alex Deymo7504e5f2014-07-15 17:58:51 -0700279 'payload_generator/cycle_breaker.cc',
280 'payload_generator/delta_diff_generator.cc',
Alex Deymo2b19cfb2015-03-26 00:35:07 -0700281 'payload_generator/ext2_filesystem.cc',
Alex Deymo1beda782015-06-07 23:01:25 +0200282 'payload_generator/extent_ranges.cc',
Alex Deymo5c6c6552015-06-03 19:06:50 +0200283 'payload_generator/extent_utils.cc',
Alex Deymo7504e5f2014-07-15 17:58:51 -0700284 'payload_generator/full_update_generator.cc',
Alex Deymo9b244df2015-03-11 21:51:18 -0700285 'payload_generator/graph_types.cc',
Alex Deymo7504e5f2014-07-15 17:58:51 -0700286 'payload_generator/graph_utils.cc',
Allie Woodcd514b52015-02-19 13:56:07 -0800287 'payload_generator/inplace_generator.cc',
Alex Deymof1cbe172015-03-05 15:58:37 -0800288 'payload_generator/payload_generation_config.cc',
Alex Deymo7504e5f2014-07-15 17:58:51 -0700289 'payload_generator/payload_signer.cc',
Alex Deymo2b19cfb2015-03-26 00:35:07 -0700290 'payload_generator/raw_filesystem.cc',
Alex Deymo7504e5f2014-07-15 17:58:51 -0700291 'payload_generator/tarjan.cc',
292 'payload_generator/topological_sort.cc',
Alex Deymoa26432a2015-03-12 16:08:04 -0700293 'payload_generator/verity_utils.cc',
Alex Deymo7504e5f2014-07-15 17:58:51 -0700294 ],
295 },
Alex Deymo719bfff2014-07-11 12:12:32 -0700296 # server-side delta generator.
297 {
298 'target_name': 'delta_generator',
299 'type': 'executable',
Alex Deymo7504e5f2014-07-15 17:58:51 -0700300 'dependencies': [
301 'libupdate_engine',
302 'libpayload_generator',
303 ],
Alex Deymo719bfff2014-07-11 12:12:32 -0700304 'link_settings': {
305 'ldflags!': [
306 '-pie',
307 ],
308 },
309 'sources': [
310 'payload_generator/generate_delta_main.cc',
311 ]
312 },
313 ],
314 'conditions': [
315 ['USE_test == 1', {
316 'targets': [
317 # Public keys used for unit testing.
318 {
319 'target_name': 'update_engine-testkeys',
320 'type': 'none',
321 'variables': {
322 'openssl_pem_in_dir': '.',
323 'openssl_pem_out_dir': 'include/update_engine',
324 },
325 'sources': [
326 'unittest_key.pem',
327 'unittest_key2.pem',
328 ],
329 'includes': ['../common-mk/openssl_pem.gypi'],
330 },
Alex Deymo2b19cfb2015-03-26 00:35:07 -0700331 # Sample images used for testing.
332 {
333 'target_name': 'update_engine-test_images',
334 'type': 'none',
335 'variables': {
336 'image_out_dir': '.',
337 },
338 'sources': [
339 'sample_images/disk_ext2_1k.txt',
340 'sample_images/disk_ext2_4k.txt',
341 ],
342 'includes': ['generate_image.gypi'],
343 },
Alex Deymo719bfff2014-07-11 12:12:32 -0700344 # Test HTTP Server.
345 {
346 'target_name': 'test_http_server',
347 'type': 'executable',
348 'dependencies': ['libupdate_engine'],
349 'sources': [
350 'test_http_server.cc',
351 ]
352 },
353 # Main unittest file.
354 {
355 'target_name': 'update_engine_unittests',
356 'type': 'executable',
Alex Deymo7504e5f2014-07-15 17:58:51 -0700357 'dependencies': [
358 'libupdate_engine',
359 'libpayload_generator',
360 ],
Alex Deymo719bfff2014-07-11 12:12:32 -0700361 'includes': ['../common-mk/common_test.gypi'],
Alex Deymo719bfff2014-07-11 12:12:32 -0700362 'sources': [
363 'action_pipe_unittest.cc',
364 'action_processor_unittest.cc',
365 'action_unittest.cc',
366 'bzip_extent_writer_unittest.cc',
367 'certificate_checker_unittest.cc',
368 'chrome_browser_proxy_resolver_unittest.cc',
369 'connection_manager_unittest.cc',
370 'delta_performer_unittest.cc',
371 'download_action_unittest.cc',
Alex Deymo719bfff2014-07-11 12:12:32 -0700372 'extent_writer_unittest.cc',
373 'fake_prefs.cc',
374 'fake_system_state.cc',
375 'file_writer_unittest.cc',
Allie Woodeb9e6d82015-04-17 13:55:30 -0700376 'filesystem_verifier_action_unittest.cc',
Alex Deymo719bfff2014-07-11 12:12:32 -0700377 'http_fetcher_unittest.cc',
378 'hwid_override_unittest.cc',
379 'mock_http_fetcher.cc',
380 'omaha_hash_calculator_unittest.cc',
381 'omaha_request_action_unittest.cc',
382 'omaha_request_params_unittest.cc',
383 'omaha_response_handler_action_unittest.cc',
384 'p2p_manager_unittest.cc',
385 'payload_generator/cycle_breaker_unittest.cc',
386 'payload_generator/delta_diff_generator_unittest.cc',
Alex Deymo2b19cfb2015-03-26 00:35:07 -0700387 'payload_generator/ext2_filesystem_unittest.cc',
Alex Deymo1beda782015-06-07 23:01:25 +0200388 'payload_generator/extent_ranges_unittest.cc',
Alex Deymo5c6c6552015-06-03 19:06:50 +0200389 'payload_generator/extent_utils_unittest.cc',
Alex Deymo2b19cfb2015-03-26 00:35:07 -0700390 'payload_generator/fake_filesystem.cc',
Alex Deymo719bfff2014-07-11 12:12:32 -0700391 'payload_generator/full_update_generator_unittest.cc',
392 'payload_generator/graph_utils_unittest.cc',
Allie Woodcd514b52015-02-19 13:56:07 -0800393 'payload_generator/inplace_generator_unittest.cc',
Alex Deymo923d8fa2014-07-15 17:58:51 -0700394 'payload_generator/payload_signer_unittest.cc',
Alex Deymo719bfff2014-07-11 12:12:32 -0700395 'payload_generator/tarjan_unittest.cc',
396 'payload_generator/topological_sort_unittest.cc',
Alex Deymoa26432a2015-03-12 16:08:04 -0700397 'payload_generator/verity_utils_unittest.cc',
Alex Deymo719bfff2014-07-11 12:12:32 -0700398 'payload_state_unittest.cc',
399 'postinstall_runner_action_unittest.cc',
400 'prefs_unittest.cc',
Alex Deymo719bfff2014-07-11 12:12:32 -0700401 'subprocess_unittest.cc',
402 'terminator_unittest.cc',
403 'test_utils.cc',
Alex Deymo10875d92014-11-10 21:52:57 -0800404 'test_utils_unittest.cc',
Alex Deymo719bfff2014-07-11 12:12:32 -0700405 'update_attempter_unittest.cc',
Alex Deymo719bfff2014-07-11 12:12:32 -0700406 'update_manager/boxed_value_unittest.cc',
407 'update_manager/chromeos_policy_unittest.cc',
408 'update_manager/evaluation_context_unittest.cc',
409 'update_manager/event_loop_unittest.cc',
410 'update_manager/generic_variables_unittest.cc',
411 'update_manager/prng_unittest.cc',
412 'update_manager/real_config_provider_unittest.cc',
413 'update_manager/real_device_policy_provider_unittest.cc',
414 'update_manager/real_random_provider_unittest.cc',
415 'update_manager/real_shill_provider_unittest.cc',
416 'update_manager/real_system_provider_unittest.cc',
417 'update_manager/real_time_provider_unittest.cc',
418 'update_manager/real_updater_provider_unittest.cc',
419 'update_manager/umtest_utils.cc',
420 'update_manager/update_manager_unittest.cc',
421 'update_manager/variable_unittest.cc',
422 'utils_unittest.cc',
423 'zip_unittest.cc',
424 # Main entry point for runnning tests.
425 'testrunner.cc',
426 ],
427 },
428 ],
429 }],
430 ],
431}