blob: dc8c1079fff914594d10c8cce31a728afca9d230 [file] [log] [blame]
Peter Qiu7a420d32015-09-22 11:25:15 -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 := $(call my-dir)
18
19# Definitions applying to all targets. Be sure to $(eval) this last.
20define apmanager_common
21 LOCAL_CPP_EXTENSION := .cc
22 LOCAL_RTTI_FLAG := -frtti
23 LOCAL_CLANG := true
24 LOCAL_SHARED_LIBRARIES += \
25 libchrome \
26 libchrome-dbus \
27 libchromeos \
28 libchromeos-dbus \
29 libchromeos-minijail \
30 libdbus \
31 libfirewalld-client \
32 libminijail \
Peter Qiu06379fc2015-10-01 11:11:01 -070033 libshill-client \
Peter Qiu7a420d32015-09-22 11:25:15 -070034 libshill-net
35 LOCAL_C_INCLUDES += \
36 $(LOCAL_PATH)/.. \
37 external/cros/system_api # D-Bus service constants.
38 LOCAL_CFLAGS += -Wall -Werror -Wno-unused-parameter
39 # -Wno-non-virtual-dtor: for generated D-Bus adaptors.
40 # -Wno-missing-field-initializers: for LAZY_INSTANCE_INITIALIZER.
41 LOCAL_CPPFLAGS += \
42 -Wno-sign-promo \
43 -Wno-non-virtual-dtor \
44 -Wno-missing-field-initializers
45endef
46
Peter Qiu7a420d32015-09-22 11:25:15 -070047# === libapmanager-client (shared library) ===
48include $(CLEAR_VARS)
49LOCAL_MODULE := libapmanager-client
50LOCAL_SRC_FILES := \
51 dbus_bindings/dbus-service-config.json \
52 dbus_bindings/org.chromium.apmanager.Config.dbus-xml \
53 dbus_bindings/org.chromium.apmanager.Device.dbus-xml \
54 dbus_bindings/org.chromium.apmanager.Manager.dbus-xml \
55 dbus_bindings/org.chromium.apmanager.Service.dbus-xml
56LOCAL_DBUS_PROXY_PREFIX := apmanager
57include $(BUILD_SHARED_LIBRARY)
58
59# === libapmanager (static library) ===
60include $(CLEAR_VARS)
61LOCAL_MODULE := libapmanager
62LOCAL_SRC_FILES := \
63 dbus_bindings/dbus-service-config.json \
64 dbus_bindings/org.chromium.apmanager.Config.dbus-xml \
65 dbus_bindings/org.chromium.apmanager.Device.dbus-xml \
66 dbus_bindings/org.chromium.apmanager.Manager.dbus-xml \
67 dbus_bindings/org.chromium.apmanager.Service.dbus-xml \
68 config.cc \
69 daemon.cc \
70 device.cc \
71 device_info.cc \
72 dhcp_server.cc \
73 dhcp_server_factory.cc \
74 event_dispatcher.cc \
75 file_writer.cc \
76 firewall_manager.cc \
77 firewalld_dbus_proxy.cc \
78 hostapd_monitor.cc \
79 manager.cc \
80 process_factory.cc \
81 service.cc \
82 shill_manager.cc \
Peter Qiu06379fc2015-10-01 11:11:01 -070083 shill_dbus_proxy.cc
Peter Qiu7a420d32015-09-22 11:25:15 -070084$(eval $(apmanager_common))
85include $(BUILD_STATIC_TEST_LIBRARY)
86
87# === apmanager ===
88include $(CLEAR_VARS)
89LOCAL_MODULE := apmanager
Peter Qiu8070c3a2015-09-28 14:26:25 -070090LOCAL_INIT_RC := apmanager.rc
Peter Qiu7a420d32015-09-22 11:25:15 -070091LOCAL_SRC_FILES := \
92 main.cc
93LOCAL_STATIC_LIBRARIES := libapmanager
94LOCAL_C_INCLUDES += external/gtest/include
95$(eval $(apmanager_common))
96include $(BUILD_EXECUTABLE)
97
Peter Qiu015a4992015-10-06 13:30:32 -070098# === apmanager_test ===
Peter Qiu7a420d32015-09-22 11:25:15 -070099include $(CLEAR_VARS)
Peter Qiu015a4992015-10-06 13:30:32 -0700100LOCAL_MODULE := apmanager_test
101ifdef BRILLO
102 LOCAL_MODULE_TAGS := debug
103endif # BRILLO
Peter Qiu7a420d32015-09-22 11:25:15 -0700104LOCAL_SRC_FILES := \
105 config_unittest.cc \
106 device_info_unittest.cc \
107 device_unittest.cc \
108 dhcp_server_unittest.cc \
109 hostapd_monitor_unittest.cc \
110 manager_unittest.cc \
111 mock_config.cc \
112 mock_device.cc \
113 mock_dhcp_server.cc \
114 mock_dhcp_server_factory.cc \
115 mock_event_dispatcher.cc \
116 mock_file_writer.cc \
117 mock_hostapd_monitor.cc \
118 mock_manager.cc \
119 mock_process_factory.cc \
120 mock_service.cc \
121 service_unittest.cc \
122 run_all_tests.cc
123LOCAL_STATIC_LIBRARIES := libapmanager libgmock
124$(eval $(apmanager_common))
125include $(BUILD_NATIVE_TEST)