Android.mk revision e2605f2df94a3696b468d6c7c86e3112e341c2f8
1# Copyright (C) 2011 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15LOCAL_PATH := $(call my-dir)
16
17ifneq ($(TARGET_BUILD_PDK), true)
18
19# Make HAL stub library 1
20# ============================================================
21
22include $(CLEAR_VARS)
23
24LOCAL_REQUIRED_MODULES :=
25
26LOCAL_CFLAGS += -Wno-unused-parameter -Wall -Werror
27
28LOCAL_C_INCLUDES += \
29	external/libnl-headers \
30	$(call include-path-for, libhardware_legacy)/hardware_legacy
31
32LOCAL_SRC_FILES := \
33	lib/wifi_hal.cpp
34
35LOCAL_MODULE := libwifi-hal
36
37include $(BUILD_STATIC_LIBRARY)
38
39# Make HAL stub library 2
40# ============================================================
41
42include $(CLEAR_VARS)
43
44LOCAL_REQUIRED_MODULES :=
45
46LOCAL_CFLAGS += -Wno-unused-parameter -Wall -Werror
47
48LOCAL_C_INCLUDES += \
49	$(LOCAL_PATH)/jni \
50	external/libnl-headers \
51	$(call include-path-for, libhardware_legacy)/hardware_legacy
52
53LOCAL_SRC_FILES := \
54	lib/wifi_hal_stub.cpp
55
56LOCAL_MODULE := libwifi-hal-stub
57
58include $(BUILD_STATIC_LIBRARY)
59
60# set correct hal library path
61# ============================================================
62LIB_WIFI_HAL := libwifi-hal
63
64ifeq ($(BOARD_WLAN_DEVICE), bcmdhd)
65  LIB_WIFI_HAL := libwifi-hal-bcm
66else ifeq ($(BOARD_WLAN_DEVICE), qcwcn)
67  LIB_WIFI_HAL := libwifi-hal-qcom
68else ifeq ($(BOARD_WLAN_DEVICE), mrvl)
69  # this is commented because none of the nexus devices
70  # that sport Marvell's wifi have support for HAL
71  # LIB_WIFI_HAL := libwifi-hal-mrvl
72else ifeq ($(BOARD_WLAN_DEVICE), MediaTek)
73  # support MTK WIFI HAL
74  LIB_WIFI_HAL := libwifi-hal-mt66xx
75endif
76
77# Make the JNI part
78# ============================================================
79include $(CLEAR_VARS)
80
81LOCAL_REQUIRED_MODULES := libhardware_legacy
82
83LOCAL_CFLAGS += -Wall -Werror -Wno-unused-parameter -Wno-unused-function \
84                -Wno-unused-variable
85
86LOCAL_C_INCLUDES += \
87	$(JNI_H_INCLUDE) \
88	$(call include-path-for, libhardware)/hardware \
89	$(call include-path-for, libhardware_legacy)/hardware_legacy \
90	libcore/include
91
92LOCAL_SHARED_LIBRARIES += \
93	libnativehelper \
94	libcutils \
95	libutils \
96	libhardware \
97	libhardware_legacy \
98	libnl \
99	libdl
100
101LOCAL_STATIC_LIBRARIES += libwifi-hal-stub
102LOCAL_STATIC_LIBRARIES += $(LIB_WIFI_HAL)
103
104LOCAL_SRC_FILES := \
105	jni/com_android_server_wifi_WifiNative.cpp \
106	jni/jni_helper.cpp
107
108ifdef INCLUDE_NAN_FEATURE
109LOCAL_SRC_FILES += \
110	jni/com_android_server_wifi_nan_WifiNanNative.cpp
111endif
112
113LOCAL_MODULE := libwifi-service
114# b/22172328
115LOCAL_CLANG := false
116
117include $(BUILD_SHARED_LIBRARY)
118
119# Build the java code
120# ============================================================
121
122include $(CLEAR_VARS)
123
124LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/java
125LOCAL_SRC_FILES := $(call all-java-files-under, java) \
126	$(call all-Iaidl-files-under, java) \
127	$(call all-logtags-files-under, java) \
128	$(call all-proto-files-under, proto)
129
130ifndef INCLUDE_NAN_FEATURE
131LOCAL_SRC_FILES := $(filter-out $(call all-java-files-under, \
132          java/com/android/server/wifi/nan),$(LOCAL_SRC_FILES))
133endif
134
135LOCAL_JAVA_LIBRARIES := bouncycastle conscrypt services
136LOCAL_REQUIRED_MODULES := services
137LOCAL_MODULE_TAGS :=
138LOCAL_MODULE := wifi-service
139LOCAL_PROTOC_OPTIMIZE_TYPE := nano
140
141include $(BUILD_JAVA_LIBRARY)
142
143endif
144