summaryrefslogtreecommitdiff
path: root/Android.mk
blob: 799f776e20891594daedb790d90537df9b725b04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
#
# Copyright (C) 2015 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

LOCAL_PATH := $(call my-dir)

# Common variables
# ========================================================

# Definitions applying to all targets built from C++ source files.
# Be sure to $(eval) this last.
define shill_cpp_common
  LOCAL_CPP_EXTENSION := .cc
  LOCAL_CLANG := true
  LOCAL_CFLAGS := \
      -Wextra \
      -Werror \
      -Wno-unused-parameter \
      -DRUNDIR=\"/data/misc/shill\" \
      -DSHIMDIR=\"/system/lib/shill/shims\" \
      -DDISABLE_CELLULAR \
      -DDISABLE_VPN \
      -DDISABLE_WAKE_ON_WIFI \
      -DDISABLE_WIMAX \
      -DENABLE_CHROMEOS_DBUS \
      -DENABLE_JSON_STORE
  ifeq ($(SHILL_USE_BINDER), true)
    LOCAL_CFLAGS += -DENABLE_BINDER
  endif # SHILL_USE_BINDER
  ifneq ($(SHILL_USE_WIFI), true)
    LOCAL_CFLAGS += -DDISABLE_WIFI
  endif
  ifneq ($(SHILL_USE_DHCPV6), true)
    LOCAL_CFLAGS += -DDISABLE_DHCPV6
  endif
  ifneq ($(SHILL_USE_PPPOE), true)
    LOCAL_CFLAGS += -DDISABLE_PPPOE
  endif
  ifneq ($(SHILL_USE_WIRED_8021X), true)
    LOCAL_CFLAGS += -DDISABLE_WIRED_8021X
  endif
  # The following flags ensure that shill builds with the same compiler
  # warnings disabled in CrOS and Android.
  LOCAL_CFLAGS +=  \
      -Wmultichar \
      -Wunused
endef

shill_parent_dir := $(LOCAL_PATH)/../

shill_c_includes := \
    $(shill_parent_dir) \
    external/gtest/include/

shill_shared_libraries := \
    libbrillo \
    libchrome \
    libdbus

shill_cpp_flags := \
    -fno-strict-aliasing \
    -Woverloaded-virtual \
    -Wno-missing-field-initializers  # for LAZY_INSTANCE_INITIALIZER

# libshill-net (shared library)
# ========================================================
include $(CLEAR_VARS)
LOCAL_MODULE := libshill-net
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_CPPFLAGS := $(shill_cpp_flags)
LOCAL_SHARED_LIBRARIES := $(shill_shared_libraries)
LOCAL_C_INCLUDES := $(shill_c_includes)
LOCAL_SRC_FILES := \
    net/attribute_list.cc \
    net/byte_string.cc \
    net/control_netlink_attribute.cc \
    net/event_history.cc \
    net/generic_netlink_message.cc \
    net/io_handler_factory.cc \
    net/io_handler_factory_container.cc \
    net/io_input_handler.cc \
    net/io_ready_handler.cc \
    net/ip_address.cc \
    net/netlink_attribute.cc \
    net/netlink_manager.cc \
    net/netlink_message.cc \
    net/netlink_packet.cc \
    net/netlink_socket.cc \
    net/nl80211_attribute.cc \
    net/nl80211_message.cc \
    net/rtnl_handler.cc \
    net/rtnl_listener.cc \
    net/rtnl_message.cc \
    net/shill_time.cc \
    net/sockets.cc
$(eval $(shill_cpp_common))
include $(BUILD_SHARED_LIBRARY)

# libshill-client (shared library)
# ========================================================
include $(CLEAR_VARS)
LOCAL_MODULE := libshill-client
LOCAL_DBUS_PROXY_PREFIX := shill
# TODO(samueltan): do not build these dbus-xml files when shill is using
# its Binder interface. All of shill's D-Bus clients will have to accommodate
# to this change.
LOCAL_SRC_FILES := \
    dbus_bindings/dbus-service-config.json \
    dbus_bindings/org.chromium.flimflam.Device.dbus-xml \
    dbus_bindings/org.chromium.flimflam.IPConfig.dbus-xml \
    dbus_bindings/org.chromium.flimflam.Manager.dbus-xml \
    dbus_bindings/org.chromium.flimflam.Profile.dbus-xml \
    dbus_bindings/org.chromium.flimflam.Service.dbus-xml \
    dbus_bindings/org.chromium.flimflam.Task.dbus-xml \
    dbus_bindings/org.chromium.flimflam.ThirdPartyVpn.dbus-xml
ifeq ($(SHILL_USE_BINDER), true)
LOCAL_AIDL_INCLUDES := \
    system/connectivity/shill/binder \
    frameworks/native/aidl/binder
LOCAL_SHARED_LIBRARIES := libbinder libutils
LOCAL_SRC_FILES += \
    binder/android/system/connectivity/shill/IDevice.aidl \
    binder/android/system/connectivity/shill/IManager.aidl \
    binder/android/system/connectivity/shill/IService.aidl \
    binder/android/system/connectivity/shill/IPropertyChangedCallback.aidl
endif # SHILL_USE_BINDER
LOCAL_EXPORT_C_INCLUDE_DIRS := external/cros/system_api/
include $(BUILD_SHARED_LIBRARY)

# supplicant-proxies (static library)
# ========================================================
include $(CLEAR_VARS)
LOCAL_MODULE := supplicant-proxies
LOCAL_DBUS_PROXY_PREFIX := supplicant
LOCAL_SRC_FILES := \
    dbus_bindings/supplicant-bss.dbus-xml \
    dbus_bindings/supplicant-interface.dbus-xml \
    dbus_bindings/supplicant-network.dbus-xml \
    dbus_bindings/supplicant-process.dbus-xml
include $(BUILD_STATIC_LIBRARY)

# dhcpcd-proxies (static library)
# ========================================================
include $(CLEAR_VARS)
LOCAL_MODULE := dhcpcd-proxies
LOCAL_DBUS_PROXY_PREFIX := dhcpcd
LOCAL_SRC_FILES := dbus_bindings/dhcpcd.dbus-xml
include $(BUILD_STATIC_LIBRARY)

# libshill (static library)
# ========================================================
include $(CLEAR_VARS)
LOCAL_MODULE := libshill
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_CPPFLAGS := $(shill_cpp_flags) -Wno-sign-compare
LOCAL_STATIC_LIBRARIES := \
    supplicant-proxies \
    dhcpcd-proxies
LOCAL_SHARED_LIBRARIES := \
    $(shill_shared_libraries) \
    libshill-net \
    libcares \
    libmetrics \
    libprotobuf-cpp-lite \
    libminijail \
    libfirewalld-client
proto_header_dir := $(call local-generated-sources-dir)/proto/$(shill_parent_dir)
LOCAL_C_INCLUDES := \
    $(shill_c_includes) \
    $(proto_header_dir) \
    external/cros/system_api/
LOCAL_SRC_FILES := \
    shims/protos/crypto_util.proto \
    json_store.cc \
    active_link_monitor.cc \
    arp_client.cc \
    arp_packet.cc \
    async_connection.cc \
    certificate_file.cc \
    connection.cc \
    connection_diagnostics.cc \
    connection_health_checker.cc \
    connection_info.cc \
    connection_info_reader.cc \
    connection_tester.cc \
    connectivity_trial.cc \
    crypto_rot47.cc \
    crypto_util_proxy.cc \
    daemon_task.cc \
    dbus/chromeos_dbus_service_watcher.cc \
    dbus/chromeos_dhcpcd_listener.cc \
    dbus/chromeos_dhcpcd_proxy.cc \
    dbus/chromeos_firewalld_proxy.cc \
    default_profile.cc \
    device.cc \
    device_claimer.cc \
    device_info.cc \
    dhcp_properties.cc \
    dhcp/dhcp_config.cc \
    dhcp/dhcp_provider.cc \
    dhcp/dhcpv4_config.cc \
    dns_client.cc \
    dns_client_factory.cc \
    dns_server_proxy.cc \
    dns_server_proxy_factory.cc \
    dns_server_tester.cc \
    ephemeral_profile.cc \
    error.cc \
    ethernet/ethernet.cc \
    ethernet/ethernet_service.cc \
    ethernet/ethernet_temporary_service.cc \
    ethernet/virtio_ethernet.cc \
    event_dispatcher.cc \
    external_task.cc \
    file_io.cc \
    file_reader.cc \
    geolocation_info.cc \
    hook_table.cc \
    http_proxy.cc \
    http_request.cc \
    http_url.cc \
    icmp.cc \
    icmp_session.cc \
    icmp_session_factory.cc \
    ip_address_store.cc \
    ipconfig.cc \
    key_value_store.cc \
    link_monitor.cc \
    logging.cc \
    manager.cc \
    metrics.cc \
    passive_link_monitor.cc \
    pending_activation_store.cc \
    portal_detector.cc \
    power_manager.cc \
    power_manager_proxy_stub.cc \
    ppp_daemon.cc \
    ppp_device.cc \
    ppp_device_factory.cc \
    pppoe/pppoe_service.cc \
    process_manager.cc \
    profile.cc \
    property_store.cc \
    resolver.cc \
    result_aggregator.cc \
    routing_table.cc \
    rpc_task.cc \
    scope_logger.cc \
    scoped_umask.cc \
    service.cc \
    service_property_change_notifier.cc \
    shill_ares.cc \
    shill_config.cc \
    shill_daemon.cc \
    shill_test_config.cc \
    socket_info.cc \
    socket_info_reader.cc \
    static_ip_parameters.cc \
    store_factory.cc \
    technology.cc \
    tethering.cc \
    traffic_monitor.cc \
    upstart/upstart.cc \
    upstart/upstart_proxy_stub.cc \
    virtual_device.cc \
    vpn/vpn_driver.cc \
    vpn/vpn_provider.cc \
    vpn/vpn_service.cc
ifeq ($(SHILL_USE_BINDER), true)
LOCAL_AIDL_INCLUDES := \
    system/connectivity/shill/binder \
    frameworks/native/aidl/binder
LOCAL_SHARED_LIBRARIES += libbinder libbinderwrapper libutils libbrillo-binder
LOCAL_SRC_FILES += \
    adaptor_stub.cc \
    binder/android/system/connectivity/shill/IDevice.aidl \
    binder/android/system/connectivity/shill/IManager.aidl \
    binder/android/system/connectivity/shill/IPropertyChangedCallback.aidl \
    binder/android/system/connectivity/shill/IService.aidl \
    binder/binder_adaptor.cc \
    binder/binder_control.cc \
    binder/device_binder_adaptor.cc \
    binder/manager_binder_adaptor.cc \
    binder/service_binder_adaptor.cc \
    ipconfig_adaptor_stub.cc \
    profile_adaptor_stub.cc \
    rpc_task_adaptor_stub.cc \
    third_party_vpn_adaptor_stub.cc
else
LOCAL_SRC_FILES += \
    dbus/chromeos_dbus_adaptor.cc \
    dbus/chromeos_dbus_control.cc \
    dbus/chromeos_device_dbus_adaptor.cc \
    dbus/chromeos_ipconfig_dbus_adaptor.cc \
    dbus/chromeos_manager_dbus_adaptor.cc \
    dbus/chromeos_profile_dbus_adaptor.cc \
    dbus/chromeos_rpc_task_dbus_adaptor.cc \
    dbus/chromeos_service_dbus_adaptor.cc \
    dbus/chromeos_third_party_vpn_dbus_adaptor.cc \
    dbus/dbus_service_watcher_factory.cc \
    dbus_bindings/org.chromium.flimflam.Device.dbus-xml \
    dbus_bindings/org.chromium.flimflam.IPConfig.dbus-xml \
    dbus_bindings/org.chromium.flimflam.Manager.dbus-xml \
    dbus_bindings/org.chromium.flimflam.Profile.dbus-xml \
    dbus_bindings/org.chromium.flimflam.Service.dbus-xml \
    dbus_bindings/org.chromium.flimflam.Task.dbus-xml \
    dbus_bindings/org.chromium.flimflam.ThirdPartyVpn.dbus-xml
endif # SHILL_USE_BINDER
ifeq ($(SHILL_USE_WIFI), true)
LOCAL_SRC_FILES += \
    wifi/callback80211_metrics.cc \
    wifi/mac80211_monitor.cc \
    wifi/scan_session.cc \
    wifi/tdls_manager.cc \
    wifi/wake_on_wifi.cc \
    wifi/wifi.cc \
    wifi/wifi_endpoint.cc \
    wifi/wifi_provider.cc \
    wifi/wifi_service.cc
endif
ifeq ($(SHILL_USE_WIRED_8021X), true)
LOCAL_SRC_FILES += \
    ethernet/ethernet_eap_provider.cc \
    ethernet/ethernet_eap_service.cc
endif
ifeq ($(SHILL_USE_DHCPV6), true)
LOCAL_SRC_FILES += dhcp/dhcpv6_config.cc
endif
ifneq (,$(filter true, $(SHILL_USE_WIRED_8021X) $(SHILL_USE_WIFI)))
LOCAL_SRC_FILES += \
    dbus/chromeos_supplicant_bss_proxy.cc \
    dbus/chromeos_supplicant_interface_proxy.cc \
    dbus/chromeos_supplicant_network_proxy.cc \
    dbus/chromeos_supplicant_process_proxy.cc \
    supplicant/supplicant_eap_state_handler.cc \
    supplicant/wpa_supplicant.cc \
    eap_credentials.cc \
    eap_listener.cc
endif
ifdef BRILLO
LOCAL_SHARED_LIBRARIES += libhardware
LOCAL_C_INCLUDES += device/generic/brillo/wifi_driver_hal/include
LOCAL_SRC_FILES += wifi/wifi_driver_hal.cc
endif # BRILLO
$(eval $(shill_cpp_common))
include $(BUILD_STATIC_LIBRARY)

# shill
# ========================================================
include $(CLEAR_VARS)
LOCAL_MODULE := shill
LOCAL_CPPFLAGS := $(shill_cpp_flags)
LOCAL_SHARED_LIBRARIES := \
    $(shill_shared_libraries) \
    libbrillo-minijail \
    libminijail \
    libcares \
    libbrillo-dbus \
    libchrome-dbus \
    libshill-net \
    libmetrics \
    libprotobuf-cpp-lite
ifeq ($(SHILL_USE_BINDER), true)
LOCAL_SHARED_LIBRARIES += libbinder libbinderwrapper libutils libbrillo-binder
endif # SHILL_USE_BINDER
ifdef BRILLO
LOCAL_SHARED_LIBRARIES += libhardware
LOCAL_REQUIRED_MODULES := $(WIFI_DRIVER_HAL_MODULE)
endif # BRILLO
LOCAL_STATIC_LIBRARIES := libshill
LOCAL_C_INCLUDES := $(shill_c_includes)
LOCAL_SRC_FILES := shill_main.cc
LOCAL_INIT_RC := shill.rc
$(eval $(shill_cpp_common))
include $(BUILD_EXECUTABLE)

# shill_test (native test)
# ========================================================
include $(CLEAR_VARS)
LOCAL_MODULE := shill_test
LOCAL_MODULE_CLASS := EXECUTABLES
ifdef BRILLO
LOCAL_MODULE_TAGS := eng
endif # BRILLO
LOCAL_CPPFLAGS := $(shill_cpp_flags) -Wno-sign-compare -Wno-return-stack-address
LOCAL_SHARED_LIBRARIES := \
    $(shill_shared_libraries) \
    libshill-net \
    libminijail \
    libmetrics \
    libcares \
    libbrillo-minijail \
    libbrillo-dbus \
    libchrome-dbus \
    libprotobuf-cpp-lite
LOCAL_STATIC_LIBRARIES := libshill libgmock libchrome_test_helpers
proto_header_dir := $(call local-generated-sources-dir)/proto/$(shill_parent_dir)
LOCAL_C_INCLUDES := \
    $(shill_c_includes) \
    $(proto_header_dir) \
    external/cros/system_api/
LOCAL_SRC_FILES := \
    shims/protos/crypto_util.proto \
    active_link_monitor_unittest.cc \
    arp_client_test_helper.cc \
    arp_client_unittest.cc \
    arp_packet_unittest.cc \
    async_connection_unittest.cc \
    certificate_file_unittest.cc \
    connection_diagnostics_unittest.cc \
    connection_health_checker_unittest.cc \
    connection_info_reader_unittest.cc \
    connection_info_unittest.cc \
    connection_tester_unittest.cc \
    connection_unittest.cc \
    connectivity_trial_unittest.cc \
    crypto_rot47_unittest.cc \
    crypto_util_proxy_unittest.cc \
    daemon_task_unittest.cc \
    default_profile_unittest.cc \
    device_claimer_unittest.cc \
    device_info_unittest.cc \
    device_unittest.cc \
    dhcp/dhcp_config_unittest.cc \
    dhcp/dhcp_provider_unittest.cc \
    dhcp/dhcpv4_config_unittest.cc \
    dhcp/mock_dhcp_config.cc \
    dhcp/mock_dhcp_provider.cc \
    dhcp/mock_dhcp_proxy.cc \
    dhcp_properties_unittest.cc \
    dns_client_unittest.cc \
    dns_server_tester_unittest.cc \
    error_unittest.cc \
    ethernet/ethernet_service_unittest.cc \
    ethernet/ethernet_unittest.cc \
    ethernet/mock_ethernet.cc \
    ethernet/mock_ethernet_service.cc \
    external_task_unittest.cc \
    fake_store.cc \
    file_reader_unittest.cc \
    hook_table_unittest.cc \
    http_proxy_unittest.cc \
    http_request_unittest.cc \
    http_url_unittest.cc \
    icmp_unittest.cc \
    icmp_session_unittest.cc \
    ip_address_store_unittest.cc \
    ipconfig_unittest.cc \
    key_value_store_unittest.cc \
    link_monitor_unittest.cc \
    manager_unittest.cc \
    metrics_unittest.cc \
    mock_active_link_monitor.cc \
    mock_adaptors.cc \
    mock_ares.cc \
    mock_arp_client.cc \
    mock_async_connection.cc \
    mock_certificate_file.cc \
    mock_connection.cc \
    mock_connection_health_checker.cc \
    mock_connection_info_reader.cc \
    mock_connectivity_trial.cc \
    mock_control.cc \
    mock_crypto_util_proxy.cc \
    mock_device.cc \
    mock_device_claimer.cc \
    mock_device_info.cc \
    mock_dhcp_properties.cc \
    mock_dns_client.cc \
    mock_dns_client_factory.cc \
    mock_dns_server_proxy.cc \
    mock_dns_server_proxy_factory.cc \
    mock_dns_server_tester.cc \
    mock_event_dispatcher.cc \
    mock_external_task.cc \
    mock_http_request.cc \
    mock_icmp.cc \
    mock_icmp_session.cc \
    mock_icmp_session_factory.cc \
    mock_ip_address_store.cc \
    mock_ipconfig.cc \
    mock_link_monitor.cc \
    mock_log.cc \
    mock_log_unittest.cc \
    mock_manager.cc \
    mock_metrics.cc \
    mock_passive_link_monitor.cc \
    mock_pending_activation_store.cc \
    mock_portal_detector.cc \
    mock_power_manager.cc \
    mock_power_manager_proxy.cc \
    mock_ppp_device.cc \
    mock_ppp_device_factory.cc \
    mock_process_manager.cc \
    mock_profile.cc \
    mock_property_store.cc \
    mock_resolver.cc \
    mock_routing_table.cc \
    mock_service.cc \
    mock_socket_info_reader.cc \
    mock_store.cc \
    mock_traffic_monitor.cc \
    mock_virtual_device.cc \
    net/attribute_list_unittest.cc \
    net/byte_string_unittest.cc \
    net/event_history_unittest.cc \
    net/ip_address_unittest.cc \
    net/netlink_attribute_unittest.cc \
    net/rtnl_handler_unittest.cc \
    net/rtnl_listener_unittest.cc \
    net/rtnl_message_unittest.cc \
    net/shill_time_unittest.cc \
    nice_mock_control.cc \
    passive_link_monitor_unittest.cc \
    pending_activation_store_unittest.cc \
    portal_detector_unittest.cc \
    power_manager_unittest.cc \
    ppp_daemon_unittest.cc \
    ppp_device_unittest.cc \
    pppoe/pppoe_service_unittest.cc \
    process_manager_unittest.cc \
    profile_unittest.cc \
    property_accessor_unittest.cc \
    property_observer_unittest.cc \
    property_store_unittest.cc \
    resolver_unittest.cc \
    result_aggregator_unittest.cc \
    routing_table_unittest.cc \
    rpc_task_unittest.cc \
    scope_logger_unittest.cc \
    service_property_change_test.cc \
    service_under_test.cc \
    service_unittest.cc \
    socket_info_reader_unittest.cc \
    socket_info_unittest.cc \
    static_ip_parameters_unittest.cc \
    technology_unittest.cc \
    testrunner.cc \
    traffic_monitor_unittest.cc \
    upstart/mock_upstart.cc \
    upstart/mock_upstart_proxy.cc \
    upstart/upstart_unittest.cc \
    virtual_device_unittest.cc \
    vpn/mock_vpn_provider.cc \
    json_store_unittest.cc
ifeq ($(SHILL_USE_BINDER), true)
LOCAL_SHARED_LIBRARIES += libbinder libbinderwrapper libutils libbrillo-binder
else
LOCAL_STATIC_LIBRARIES += libchrome_dbus_test_helpers
LOCAL_SRC_FILES += \
    dbus/chromeos_dbus_adaptor_unittest.cc \
    dbus/chromeos_manager_dbus_adaptor_unittest.cc
endif # SHILL_USE_BINDER
ifeq ($(SHILL_USE_WIFI), true)
LOCAL_SRC_FILES += \
    net/netlink_manager_unittest.cc \
    net/netlink_message_unittest.cc \
    net/netlink_packet_unittest.cc \
    net/netlink_socket_unittest.cc \
    net/nl80211_attribute_unittest.cc \
    supplicant/mock_supplicant_bss_proxy.cc \
    wifi/callback80211_metrics_unittest.cc \
    wifi/mac80211_monitor_unittest.cc \
    wifi/mock_mac80211_monitor.cc \
    wifi/mock_scan_session.cc \
    wifi/mock_tdls_manager.cc \
    wifi/mock_wake_on_wifi.cc \
    wifi/mock_wifi.cc \
    wifi/mock_wifi_provider.cc \
    wifi/mock_wifi_service.cc \
    wifi/scan_session_unittest.cc \
    wifi/tdls_manager_unittest.cc \
    wifi/wake_on_wifi_unittest.cc \
    wifi/wifi_endpoint_unittest.cc \
    wifi/wifi_provider_unittest.cc \
    wifi/wifi_service_unittest.cc \
    wifi/wifi_unittest.cc
endif
ifeq ($(SHILL_USE_DHCPV6), true)
LOCAL_SRC_FILES += dhcp/dhcpv6_config_unittest.cc
endif
ifeq ($(SHILL_USE_WIRED_8021X), true)
LOCAL_SRC_FILES += \
    ethernet/ethernet_eap_provider_unittest.cc \
    ethernet/ethernet_eap_service_unittest.cc \
    ethernet/mock_ethernet_eap_provider.cc
endif
ifneq (,$(filter true, $(SHILL_USE_WIRED_8021X) $(SHILL_USE_WIFI)))
LOCAL_SRC_FILES += \
    supplicant/mock_supplicant_eap_state_handler.cc \
    supplicant/mock_supplicant_interface_proxy.cc \
    supplicant/mock_supplicant_network_proxy.cc \
    supplicant/mock_supplicant_process_proxy.cc \
    supplicant/supplicant_eap_state_handler_unittest.cc \
    supplicant/wpa_supplicant_unittest.cc \
    eap_credentials_unittest.cc \
    eap_listener_unittest.cc \
    mock_eap_credentials.cc \
    mock_eap_listener.cc
endif
ifdef BRILLO
LOCAL_SHARED_LIBRARIES += libhardware
endif # BRILLO
$(eval $(shill_cpp_common))
include $(BUILD_NATIVE_TEST)

# helper scripts
# ========================================================
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := eng tests
LOCAL_PREBUILT_EXECUTABLES := \
    bin/wpa_debug \
    bin/ff_debug
include $(BUILD_MULTI_PREBUILT)

# The following  two targets use the shill D-Bus API, which we do not expose
# if we are using Binder.
ifneq ($(SHILL_USE_BINDER), true)

# setup_wifi
# ========================================================
include $(CLEAR_VARS)
# The module name can't be the same of a directory in the source code.
LOCAL_MODULE := shill_setup_wifi
LOCAL_CPPFLAGS := $(shill_cpp_flags)
LOCAL_SHARED_LIBRARIES := \
    $(shill_shared_libraries) \
    libshill-client \
    libbrillo-dbus \
    libchrome-dbus
LOCAL_C_INCLUDES := $(shill_c_includes)
LOCAL_SRC_FILES := setup_wifi/main.cc
$(eval $(shill_cpp_common))
include $(BUILD_EXECUTABLE)

# test-rpc-proxy
# ========================================================
include $(CLEAR_VARS)
LOCAL_MODULE := shill-test-rpc-proxy
LOCAL_MODULE_TAGS := eng tests
LOCAL_CPPFLAGS := $(shill_cpp_flags)
LOCAL_SHARED_LIBRARIES := \
    $(shill_shared_libraries) \
    libshill-client \
    libbrillo-dbus \
    libchrome-dbus \
    libxmlrpc++
LOCAL_C_INCLUDES := \
    $(shill_c_includes) \
    external/cros/system_api/dbus \
    external/xmlrpcpp/src
$(eval $(shill_cpp_common))
LOCAL_SRC_FILES := $(call all-cpp-files-under,test-rpc-proxy)
include $(BUILD_EXECUTABLE)

endif # SHILL_USE_BINDER