OSDN Git Service

keep history after reset to mnc-dr-dev(03d171170c7ad4e40454a9575cfd4919d2e1ef2f)
[android-x86/system-bt.git] / service / Android.mk
1 #
2 #  Copyright (C) 2015 Google
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
17 LOCAL_PATH:= $(call my-dir)
18
19 # Source variables
20 # ========================================================
21 btserviceCommonSrc := \
22         common/bluetooth/adapter_state.cpp \
23         common/bluetooth/advertise_data.cpp \
24         common/bluetooth/advertise_settings.cpp \
25         common/bluetooth/gatt_identifier.cpp \
26         common/bluetooth/scan_filter.cpp \
27         common/bluetooth/scan_result.cpp \
28         common/bluetooth/scan_settings.cpp \
29         common/bluetooth/util/address_helper.cpp \
30         common/bluetooth/util/atomic_string.cpp \
31         common/bluetooth/uuid.cpp
32
33 btserviceCommonBinderSrc := \
34         common/bluetooth/binder/IBluetooth.cpp \
35         common/bluetooth/binder/IBluetoothCallback.cpp \
36         common/bluetooth/binder/IBluetoothGattClient.cpp \
37         common/bluetooth/binder/IBluetoothGattClientCallback.cpp \
38         common/bluetooth/binder/IBluetoothGattServer.cpp \
39         common/bluetooth/binder/IBluetoothGattServerCallback.cpp \
40         common/bluetooth/binder/IBluetoothLowEnergy.cpp \
41         common/bluetooth/binder/IBluetoothLowEnergyCallback.cpp \
42         common/bluetooth/binder/parcel_helpers.cpp
43
44 btserviceDaemonSrc := \
45         adapter.cpp \
46         daemon.cpp \
47         gatt_client.cpp \
48         gatt_server.cpp \
49         gatt_server_old.cpp \
50         hal/gatt_helpers.cpp \
51         hal/bluetooth_gatt_interface.cpp \
52         hal/bluetooth_interface.cpp \
53         ipc/ipc_handler.cpp \
54         ipc/ipc_manager.cpp \
55         logging_helpers.cpp \
56         low_energy_client.cpp \
57         settings.cpp
58
59 btserviceLinuxSrc := \
60         ipc/ipc_handler_linux.cpp \
61         ipc/linux_ipc_host.cpp
62
63 btserviceBinderDaemonImplSrc := \
64         ipc/binder/bluetooth_binder_server.cpp \
65         ipc/binder/bluetooth_gatt_client_binder_server.cpp \
66         ipc/binder/bluetooth_gatt_server_binder_server.cpp \
67         ipc/binder/bluetooth_low_energy_binder_server.cpp \
68         ipc/binder/interface_with_instances_base.cpp \
69         ipc/binder/ipc_handler_binder.cpp \
70
71 btserviceBinderDaemonSrc := \
72         $(btserviceCommonBinderSrc) \
73         $(btserviceBinderDaemonImplSrc)
74
75 btserviceCommonIncludes := \
76         $(LOCAL_PATH)/../ \
77         $(LOCAL_PATH)/common
78
79 # Main unit test sources. These get built for host and target.
80 # ========================================================
81 btserviceBaseTestSrc := \
82         hal/fake_bluetooth_gatt_interface.cpp \
83         hal/fake_bluetooth_interface.cpp \
84         test/adapter_unittest.cpp \
85         test/advertise_data_unittest.cpp \
86         test/fake_hal_util.cpp \
87         test/gatt_client_unittest.cpp \
88         test/gatt_identifier_unittest.cpp \
89         test/gatt_server_unittest.cpp \
90         test/low_energy_client_unittest.cpp \
91         test/settings_unittest.cpp \
92         test/util_unittest.cpp \
93         test/uuid_unittest.cpp
94
95 # Some standard CFLAGS used in all targets.
96 btservice_common_flags :=
97 # libchrome has unused parameters in their .h files. b/26228533
98 btservice_common_flags += -Wno-unused-parameter
99
100 # Native system service for target
101 # ========================================================
102 include $(CLEAR_VARS)
103 LOCAL_SRC_FILES := \
104         $(btserviceBinderDaemonSrc) \
105         $(btserviceCommonSrc) \
106         $(btserviceLinuxSrc) \
107         $(btserviceDaemonSrc) \
108         main.cpp
109 LOCAL_C_INCLUDES += $(btserviceCommonIncludes)
110 LOCAL_CFLAGS += $(btservice_common_flags)
111 LOCAL_MODULE_TAGS := optional
112 LOCAL_MODULE := bluetoothtbd
113 LOCAL_REQUIRED_MODULES = bluetooth.default
114 LOCAL_STATIC_LIBRARIES += libbtcore
115 LOCAL_SHARED_LIBRARIES += \
116         libbinder \
117         libchrome \
118         libcutils \
119         libhardware \
120         liblog \
121         libutils
122 LOCAL_INIT_RC := bluetoothtbd.rc
123 include $(BUILD_EXECUTABLE)
124
125 # Native system service unittests for host
126 # ========================================================
127 include $(CLEAR_VARS)
128 LOCAL_SRC_FILES := \
129         $(btserviceBaseTestSrc) \
130         $(btserviceCommonSrc) \
131         $(btserviceDaemonSrc) \
132         test/main.cpp \
133         test/stub_ipc_handler_binder.cpp
134 ifeq ($(HOST_OS),linux)
135 LOCAL_SRC_FILES += \
136         $(btserviceLinuxSrc) \
137         test/ipc_linux_unittest.cpp
138 LOCAL_LDLIBS += -lrt
139 else
140 LOCAL_SRC_FILES += \
141         test/stub_ipc_handler_linux.cpp
142 endif
143 LOCAL_C_INCLUDES += $(btserviceCommonIncludes)
144 LOCAL_CFLAGS += $(btservice_common_flags)
145 LOCAL_MODULE_TAGS := debug tests
146 LOCAL_MODULE := bluetoothtbd-host_test
147 LOCAL_SHARED_LIBRARIES += libchrome
148 LOCAL_STATIC_LIBRARIES += libgmock_host libgtest_host liblog
149 include $(BUILD_HOST_NATIVE_TEST)
150
151 # Native system service unittests for target. This
152 # includes Binder related tests that can only be run on
153 # target.
154 # ========================================================
155 include $(CLEAR_VARS)
156 LOCAL_SRC_FILES := \
157         $(btserviceBaseTestSrc) \
158         $(btserviceBinderDaemonSrc) \
159         $(btserviceCommonSrc) \
160         $(btserviceDaemonSrc) \
161         test/main.cpp \
162         test/parcel_helpers_unittest.cpp
163 LOCAL_C_INCLUDES += $(btserviceCommonIncludes)
164 LOCAL_CFLAGS += $(btservice_common_flags)
165 LOCAL_MODULE_TAGS := debug tests
166 LOCAL_MODULE := bluetoothtbd_test
167 LOCAL_SHARED_LIBRARIES += \
168         libbinder \
169         libchrome \
170         libutils
171 LOCAL_STATIC_LIBRARIES += libgmock libgtest liblog
172 include $(BUILD_NATIVE_TEST)
173
174 # Client library for interacting with Bluetooth daemon
175 # ========================================================
176 include $(CLEAR_VARS)
177 LOCAL_SRC_FILES := \
178         $(btserviceCommonSrc) \
179         $(btserviceCommonBinderSrc)
180 LOCAL_C_INCLUDES += $(btserviceCommonIncludes)
181 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/common
182 LOCAL_CFLAGS += $(btservice_common_flags)
183 LOCAL_MODULE := libbluetooth-client
184 LOCAL_SHARED_LIBRARIES += libbinder libchrome libutils
185 include $(BUILD_STATIC_LIBRARY)
186
187 # Native system service CLI for target
188 # ========================================================
189 include $(CLEAR_VARS)
190 LOCAL_SRC_FILES := client/main.cpp
191 LOCAL_CFLAGS += $(btservice_common_flags)
192 LOCAL_MODULE_TAGS := optional
193 LOCAL_MODULE := bluetooth-cli
194 LOCAL_STATIC_LIBRARIES += libbluetooth-client
195 LOCAL_SHARED_LIBRARIES += \
196         libbinder \
197         libchrome \
198         libutils
199 include $(BUILD_EXECUTABLE)
200
201 # Heart Rate GATT service example
202 # ========================================================
203 # TODO(armansito): Move this into a new makefile under examples/ once we build a
204 # client static library that the examples can depend on.
205 include $(CLEAR_VARS)
206 LOCAL_SRC_FILES := \
207         example/heart_rate/heart_rate_server.cpp \
208         example/heart_rate/server_main.cpp
209 LOCAL_C_INCLUDES += $(LOCAL_PATH)/../
210 LOCAL_CFLAGS += $(btservice_common_flags)
211 LOCAL_MODULE_TAGS := optional
212 LOCAL_MODULE := bt-example-hr-server
213 LOCAL_STATIC_LIBRARIES += libbluetooth-client
214 LOCAL_SHARED_LIBRARIES += \
215         libbinder \
216         libchrome \
217         libutils
218 include $(BUILD_EXECUTABLE)