1#
2# Copyright 2012 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
19ifeq ($(BOARD_HAVE_BLUETOOTH_QCOM),true)
20
21include $(CLEAR_VARS)
22
23
24LOCAL_SRC_FILES := \
25        src/bt_vendor_qcom.c \
26        src/hardware.c \
27        src/hci_uart.c \
28        src/hci_smd.c \
29        src/hw_rome.c \
30        src/hw_ar3k.c \
31        src/bt_vendor_persist.cpp
32
33# By default, "ENABLE_FM_OVER_UART" is un-defined.
34# To enable the feature, set it as "true" in "BoardConfig.mk".
35ifeq ($(ENABLE_FM_OVER_UART), true)
36LOCAL_CFLAGS := -DFM_OVER_UART
37endif
38
39ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
40LOCAL_CFLAGS += -DPANIC_ON_SOC_CRASH
41LOCAL_CFLAGS += -DENABLE_DBG_FLAGS
42endif
43
44LOCAL_C_INCLUDES += \
45        $(LOCAL_PATH)/include \
46        external/bluetooth/bluedroid/hci/include \
47        system/bt/hci/include \
48        $(TARGET_OUT_HEADERS)/bt/hci_qcomm_init \
49        $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
50
51LOCAL_ADDITIONAL_DEPENDENCIES += \
52$(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
53
54ifeq ($(BOARD_HAS_QCA_BT_AR3002), true)
55LOCAL_C_FLAGS := \
56        -DBT_WAKE_VIA_PROC
57endif #BOARD_HAS_QCA_BT_AR3002
58
59ifeq ($(WIFI_BT_STATUS_SYNC), true)
60LOCAL_CFLAGS += -DWIFI_BT_STATUS_SYNC
61endif #WIFI_BT_STATUS_SYNC
62
63LOCAL_SHARED_LIBRARIES := \
64        libcutils \
65        liblog \
66        libbtnv
67
68LOCAL_MODULE := libbt-vendor
69LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD legacy_not_a_contribution
70LOCAL_LICENSE_CONDITIONS := by_exception_only not_allowed notice
71LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE
72LOCAL_MODULE_TAGS := optional
73LOCAL_MODULE_CLASS := SHARED_LIBRARIES
74LOCAL_MODULE_OWNER := qcom
75
76ifdef TARGET_2ND_ARCH
77LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib
78LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64
79else
80LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_SHARED_LIBRARIES)
81endif
82
83LOCAL_CFLAGS += -DBT_NV_SUPPORT
84
85ifneq ($(BOARD_ANT_WIRELESS_DEVICE),)
86LOCAL_CFLAGS += -DENABLE_ANT
87endif
88#LOCAL_CFLAGS += -DREAD_BT_ADDR_FROM_PROP
89LOCAL_CFLAGS += -Wno-error
90
91#include $(LOCAL_PATH)/vnd_buildcfg.mk
92
93include $(BUILD_SHARED_LIBRARY)
94
95endif # BOARD_HAVE_BLUETOOTH_QCOM
96