1155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpande# Copyright (C) 2011 The Android Open Source Project
2155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpande#
3155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpande# Licensed under the Apache License, Version 2.0 (the "License");
4155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpande# you may not use this file except in compliance with the License.
5155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpande# You may obtain a copy of the License at
6155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpande#
7155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpande#      http://www.apache.org/licenses/LICENSE-2.0
8155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpande#
9155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpande# Unless required by applicable law or agreed to in writing, software
10155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpande# distributed under the License is distributed on an "AS IS" BASIS,
11155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpande# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpande# See the License for the specific language governing permissions and
13155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpande# limitations under the License.
14155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpande
15155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit DeshpandeLOCAL_PATH := $(call my-dir)
16155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpande
17432674aa8fb9cbecac155f2809b55bbcc57c0db6Colin Crossifneq ($(TARGET_BUILD_PDK), true)
18432674aa8fb9cbecac155f2809b55bbcc57c0db6Colin Cross
1913cf25e15cbe308541ff84fce89b0f506cd71138Vinit Deshapnde# Make HAL stub library
207ef73dd1b6e43c72b3841723504cd86dc402a134Vinit Deshapnde# ============================================================
2113cf25e15cbe308541ff84fce89b0f506cd71138Vinit Deshapnde
227ef73dd1b6e43c72b3841723504cd86dc402a134Vinit Deshapndeinclude $(CLEAR_VARS)
237ef73dd1b6e43c72b3841723504cd86dc402a134Vinit Deshapnde
247ef73dd1b6e43c72b3841723504cd86dc402a134Vinit DeshapndeLOCAL_REQUIRED_MODULES :=
257ef73dd1b6e43c72b3841723504cd86dc402a134Vinit Deshapnde
267ef73dd1b6e43c72b3841723504cd86dc402a134Vinit DeshapndeLOCAL_CFLAGS += -Wno-unused-parameter -Wno-int-to-pointer-cast
277ef73dd1b6e43c72b3841723504cd86dc402a134Vinit DeshapndeLOCAL_CFLAGS += -Wno-maybe-uninitialized -Wno-parentheses
287ef73dd1b6e43c72b3841723504cd86dc402a134Vinit DeshapndeLOCAL_CPPFLAGS += -Wno-conversion-null
297ef73dd1b6e43c72b3841723504cd86dc402a134Vinit Deshapnde
307ef73dd1b6e43c72b3841723504cd86dc402a134Vinit DeshapndeLOCAL_C_INCLUDES += \
3113cf25e15cbe308541ff84fce89b0f506cd71138Vinit Deshapnde	external/libnl-headers \
3213cf25e15cbe308541ff84fce89b0f506cd71138Vinit Deshapnde	$(call include-path-for, libhardware_legacy)/hardware_legacy
337ef73dd1b6e43c72b3841723504cd86dc402a134Vinit Deshapnde
347ef73dd1b6e43c72b3841723504cd86dc402a134Vinit DeshapndeLOCAL_SRC_FILES := \
3513cf25e15cbe308541ff84fce89b0f506cd71138Vinit Deshapnde	lib/wifi_hal.cpp
367ef73dd1b6e43c72b3841723504cd86dc402a134Vinit Deshapnde
377ef73dd1b6e43c72b3841723504cd86dc402a134Vinit DeshapndeLOCAL_MODULE := libwifi-hal
387ef73dd1b6e43c72b3841723504cd86dc402a134Vinit Deshapnde
397ef73dd1b6e43c72b3841723504cd86dc402a134Vinit Deshapndeinclude $(BUILD_STATIC_LIBRARY)
407ef73dd1b6e43c72b3841723504cd86dc402a134Vinit Deshapnde
4113cf25e15cbe308541ff84fce89b0f506cd71138Vinit Deshapnde# set correct hal library path
4213cf25e15cbe308541ff84fce89b0f506cd71138Vinit Deshapnde# ============================================================
4313cf25e15cbe308541ff84fce89b0f506cd71138Vinit DeshapndeLIB_WIFI_HAL := libwifi-hal
4413cf25e15cbe308541ff84fce89b0f506cd71138Vinit Deshapnde
4513cf25e15cbe308541ff84fce89b0f506cd71138Vinit Deshapndeifeq ($(BOARD_WLAN_DEVICE), bcmdhd)
4613cf25e15cbe308541ff84fce89b0f506cd71138Vinit Deshapnde  LIB_WIFI_HAL := libwifi-hal-bcm
4713cf25e15cbe308541ff84fce89b0f506cd71138Vinit Deshapndeelse ifeq ($(BOARD_WLAN_DEVICE), qcwcn)
48042c54bfd5144ce8e720585b2093796e7e28de5eVinit Deshpande  # this is commented because none of the nexus devices
49042c54bfd5144ce8e720585b2093796e7e28de5eVinit Deshpande  # that sport Qualcomm's wifi have support for HAL
50042c54bfd5144ce8e720585b2093796e7e28de5eVinit Deshpande  # LIB_WIFI_HAL := libwifi-hal-qcom
5113cf25e15cbe308541ff84fce89b0f506cd71138Vinit Deshapndeelse ifeq ($(BOARD_WLAN_DEVICE), mrvl)
52042c54bfd5144ce8e720585b2093796e7e28de5eVinit Deshpande  # this is commented because none of the nexus devices
53042c54bfd5144ce8e720585b2093796e7e28de5eVinit Deshpande  # that sport Marvell's wifi have support for HAL
54042c54bfd5144ce8e720585b2093796e7e28de5eVinit Deshpande  # LIB_WIFI_HAL := libwifi-hal-mrvl
5513cf25e15cbe308541ff84fce89b0f506cd71138Vinit Deshapndeendif
5613cf25e15cbe308541ff84fce89b0f506cd71138Vinit Deshapnde
5713cf25e15cbe308541ff84fce89b0f506cd71138Vinit Deshapnde# Build the HalUtil
58155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpande# ============================================================
59766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapnde
60155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpandeinclude $(CLEAR_VARS)
61155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpande
62155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit DeshpandeLOCAL_REQUIRED_MODULES := libandroid_runtime libhardware_legacy
63155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpande
64155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit DeshpandeLOCAL_CFLAGS += -Wno-unused-parameter -Wno-int-to-pointer-cast
65155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit DeshpandeLOCAL_CFLAGS += -Wno-maybe-uninitialized -Wno-parentheses
66155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit DeshpandeLOCAL_CPPFLAGS += -Wno-conversion-null
67155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpande
68155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit DeshpandeLOCAL_C_INCLUDES += \
6913cf25e15cbe308541ff84fce89b0f506cd71138Vinit Deshapnde	$(call include-path-for, libhardware)/hardware \
7013cf25e15cbe308541ff84fce89b0f506cd71138Vinit Deshapnde	$(call include-path-for, libhardware_legacy)/hardware_legacy \
7113cf25e15cbe308541ff84fce89b0f506cd71138Vinit Deshapnde	libcore/include
727ef73dd1b6e43c72b3841723504cd86dc402a134Vinit Deshapnde
73155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit DeshpandeLOCAL_SHARED_LIBRARIES += \
74155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpande	libcutils \
75766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapnde	libnl \
763ee2981adc0d7f8c2a3fbf56c69e5dd58ba9dab7Dmitry Shmidt	libandroid_runtime \
773ee2981adc0d7f8c2a3fbf56c69e5dd58ba9dab7Dmitry Shmidt	libutils
787ef73dd1b6e43c72b3841723504cd86dc402a134Vinit Deshapnde
793ee2981adc0d7f8c2a3fbf56c69e5dd58ba9dab7Dmitry ShmidtLOCAL_STATIC_LIBRARIES += $(LIB_WIFI_HAL)
80155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpande
817f9a15d554f69311a0db43347d6473a7c4c46e2eVinit DeshapndeLOCAL_SRC_FILES := \
82766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapnde	tools/halutil/halutil.cpp
837f9a15d554f69311a0db43347d6473a7c4c46e2eVinit Deshapnde
84766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit DeshapndeLOCAL_MODULE := halutil
85155b9d09ef9b8ead3ca617afdd91e74070d3f0cbVinit Deshpande
86766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapndeinclude $(BUILD_EXECUTABLE)
87432674aa8fb9cbecac155f2809b55bbcc57c0db6Colin Cross
88766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapnde# Make the JNI part
897f9a15d554f69311a0db43347d6473a7c4c46e2eVinit Deshapnde# ============================================================
907f9a15d554f69311a0db43347d6473a7c4c46e2eVinit Deshapndeinclude $(CLEAR_VARS)
917f9a15d554f69311a0db43347d6473a7c4c46e2eVinit Deshapnde
927f9a15d554f69311a0db43347d6473a7c4c46e2eVinit DeshapndeLOCAL_REQUIRED_MODULES := libandroid_runtime libhardware_legacy
937f9a15d554f69311a0db43347d6473a7c4c46e2eVinit Deshapnde
947f9a15d554f69311a0db43347d6473a7c4c46e2eVinit DeshapndeLOCAL_CFLAGS += -Wno-unused-parameter -Wno-int-to-pointer-cast
957f9a15d554f69311a0db43347d6473a7c4c46e2eVinit DeshapndeLOCAL_CFLAGS += -Wno-maybe-uninitialized -Wno-parentheses
967f9a15d554f69311a0db43347d6473a7c4c46e2eVinit DeshapndeLOCAL_CPPFLAGS += -Wno-conversion-null
977f9a15d554f69311a0db43347d6473a7c4c46e2eVinit Deshapnde
987f9a15d554f69311a0db43347d6473a7c4c46e2eVinit DeshapndeLOCAL_C_INCLUDES += \
99766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapnde	$(JNI_H_INCLUDE) \
100766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapnde	$(call include-path-for, libhardware)/hardware \
101766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapnde	$(call include-path-for, libhardware_legacy)/hardware_legacy \
10213cf25e15cbe308541ff84fce89b0f506cd71138Vinit Deshapnde	libcore/include
1037f9a15d554f69311a0db43347d6473a7c4c46e2eVinit Deshapnde
1047f9a15d554f69311a0db43347d6473a7c4c46e2eVinit DeshapndeLOCAL_SHARED_LIBRARIES += \
1057f9a15d554f69311a0db43347d6473a7c4c46e2eVinit Deshapnde	libnativehelper \
1067f9a15d554f69311a0db43347d6473a7c4c46e2eVinit Deshapnde	libcutils \
1077f9a15d554f69311a0db43347d6473a7c4c46e2eVinit Deshapnde	libutils \
1087f9a15d554f69311a0db43347d6473a7c4c46e2eVinit Deshapnde	libhardware \
109766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapnde	libhardware_legacy \
11050e20834408a3ee55170f8a34dfaeee26e7403ddVinit Deshapnde	libandroid_runtime \
11150e20834408a3ee55170f8a34dfaeee26e7403ddVinit Deshapnde    libnl
112766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapnde
11350e20834408a3ee55170f8a34dfaeee26e7403ddVinit DeshapndeLOCAL_STATIC_LIBRARIES += $(LIB_WIFI_HAL)
1147f9a15d554f69311a0db43347d6473a7c4c46e2eVinit Deshapnde
1157f9a15d554f69311a0db43347d6473a7c4c46e2eVinit DeshapndeLOCAL_SRC_FILES := \
116766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapnde	jni/com_android_server_wifi_WifiNative.cpp \
117766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapnde	jni/jni_helper.cpp
1187f9a15d554f69311a0db43347d6473a7c4c46e2eVinit Deshapnde
119766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit DeshapndeLOCAL_MODULE := libwifi-service
1207f9a15d554f69311a0db43347d6473a7c4c46e2eVinit Deshapnde
121766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapndeinclude $(BUILD_SHARED_LIBRARY)
122766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapnde
123766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapnde# Build the java code
124766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapnde# ============================================================
125766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapnde
126766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapndeinclude $(CLEAR_VARS)
127766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapnde
128766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit DeshapndeLOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/java
129766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit DeshapndeLOCAL_SRC_FILES := $(call all-java-files-under, java) \
130766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapnde	$(call all-Iaidl-files-under, java) \
131766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapnde	$(call all-logtags-files-under, java)
132766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapnde
133766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit DeshapndeLOCAL_JNI_SHARED_LIBRARIES := libandroid_runtime
134de3d89a8e438f97f4761613f528b9c53c9458146Yuhao ZhengLOCAL_JAVA_LIBRARIES := bouncycastle conscrypt services
135de3d89a8e438f97f4761613f528b9c53c9458146Yuhao ZhengLOCAL_STATIC_JAVA_LIBRARIES := ksoap2
136766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit DeshapndeLOCAL_REQUIRED_MODULES := services
137766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit DeshapndeLOCAL_MODULE_TAGS :=
138766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit DeshapndeLOCAL_MODULE := wifi-service
139766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapnde
140766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapndeinclude $(BUILD_JAVA_LIBRARY)
1417f9a15d554f69311a0db43347d6473a7c4c46e2eVinit Deshapnde
142766cb4b1fa3b93c146952eacbf6756f67f172ec1Vinit Deshapndeendif
143