1# Copyright (C) 2016 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)
16wificond_cpp_flags := -Wall -Werror -Wno-unused-parameter
17wificond_parent_dir := $(LOCAL_PATH)/../
18wificond_includes := \
19    $(wificond_parent_dir)
20
21
22###
23### wificond daemon.
24###
25include $(CLEAR_VARS)
26LOCAL_MODULE := wificond
27LOCAL_CPPFLAGS := $(wificond_cpp_flags)
28LOCAL_INIT_RC := wificond.rc
29LOCAL_C_INCLUDES := $(wificond_includes)
30LOCAL_SRC_FILES := \
31    main.cpp
32LOCAL_SHARED_LIBRARIES := \
33    libbinder \
34    libbase \
35    libcutils \
36    libminijail \
37    libutils \
38    libwifi-system
39LOCAL_STATIC_LIBRARIES := \
40    libwificond
41include $(BUILD_EXECUTABLE)
42
43###
44### wificond static library
45###
46include $(CLEAR_VARS)
47LOCAL_MODULE := libwificond
48LOCAL_CPPFLAGS := $(wificond_cpp_flags)
49LOCAL_C_INCLUDES := $(wificond_includes)
50LOCAL_SRC_FILES := \
51    ap_interface_binder.cpp \
52    ap_interface_impl.cpp \
53    client_interface_binder.cpp \
54    client_interface_impl.cpp \
55    logging_utils.cpp \
56    looper_backed_event_loop.cpp \
57    rtt/rtt_controller_binder.cpp \
58    rtt/rtt_controller_impl.cpp \
59    scanning/channel_settings.cpp \
60    scanning/hidden_network.cpp \
61    scanning/pno_network.cpp \
62    scanning/pno_settings.cpp \
63    scanning/scan_result.cpp \
64    scanning/single_scan_settings.cpp \
65    scanning/scan_utils.cpp \
66    scanning/scanner_impl.cpp \
67    server.cpp
68LOCAL_SHARED_LIBRARIES := \
69    libbase \
70    libutils \
71    libwifi-system
72LOCAL_WHOLE_STATIC_LIBRARIES := \
73    libwificond_ipc \
74    libwificond_nl
75include $(BUILD_STATIC_LIBRARY)
76
77###
78### wificond netlink library
79###
80include $(CLEAR_VARS)
81LOCAL_MODULE := libwificond_nl
82LOCAL_CPPFLAGS := $(wificond_cpp_flags)
83LOCAL_C_INCLUDES := $(wificond_includes)
84LOCAL_SRC_FILES := \
85    net/mlme_event.cpp \
86    net/netlink_manager.cpp \
87    net/netlink_utils.cpp \
88    net/nl80211_attribute.cpp \
89    net/nl80211_packet.cpp
90LOCAL_SHARED_LIBRARIES := \
91    libbase
92include $(BUILD_STATIC_LIBRARY)
93
94###
95### wificond IPC interface library
96###
97include $(CLEAR_VARS)
98LOCAL_MODULE := libwificond_ipc
99LOCAL_AIDL_INCLUDES += $(LOCAL_PATH)/aidl
100LOCAL_C_INCLUDES := $(wificond_includes)
101LOCAL_CPPFLAGS := $(wificond_cpp_flags)
102LOCAL_SRC_FILES := \
103    ipc_constants.cpp \
104    aidl/android/net/wifi/IApInterface.aidl \
105    aidl/android/net/wifi/IANQPDoneCallback.aidl \
106    aidl/android/net/wifi/IClientInterface.aidl \
107    aidl/android/net/wifi/IInterfaceEventCallback.aidl \
108    aidl/android/net/wifi/IPnoScanEvent.aidl \
109    aidl/android/net/wifi/IRttClient.aidl \
110    aidl/android/net/wifi/IRttController.aidl \
111    aidl/android/net/wifi/IScanEvent.aidl \
112    aidl/android/net/wifi/IWificond.aidl \
113    aidl/android/net/wifi/IWifiScannerImpl.aidl \
114    scanning/channel_settings.cpp \
115    scanning/hidden_network.cpp \
116    scanning/pno_network.cpp \
117    scanning/pno_settings.cpp \
118    scanning/scan_result.cpp \
119    scanning/single_scan_settings.cpp
120LOCAL_SHARED_LIBRARIES := \
121    libbinder
122include $(BUILD_STATIC_LIBRARY)
123
124###
125### test util library
126###
127include $(CLEAR_VARS)
128LOCAL_MODULE := libwificond_test_utils
129LOCAL_CPPFLAGS := $(wificond_cpp_flags)
130LOCAL_C_INCLUDES := $(wificond_includes)
131LOCAL_SRC_FILES := \
132    looper_backed_event_loop.cpp \
133    tests/integration/binder_dispatcher.cpp \
134    tests/integration/process_utils.cpp \
135    tests/shell_utils.cpp
136LOCAL_SHARED_LIBRARIES := \
137    libbase
138LOCAL_WHOLE_STATIC_LIBRARIES := \
139    libwificond_ipc
140include $(BUILD_STATIC_LIBRARY)
141
142###
143### wificond unit tests.
144###
145include $(CLEAR_VARS)
146LOCAL_MODULE := wificond_unit_test
147LOCAL_CPPFLAGS := $(wificond_cpp_flags)
148LOCAL_C_INCLUDES := $(wificond_includes)
149LOCAL_SRC_FILES := \
150    tests/ap_interface_impl_unittest.cpp \
151    tests/client_interface_impl_unittest.cpp \
152    tests/looper_backed_event_loop_unittest.cpp \
153    tests/main.cpp \
154    tests/mock_netlink_manager.cpp \
155    tests/mock_netlink_utils.cpp \
156    tests/mock_scan_utils.cpp \
157    tests/netlink_manager_unittest.cpp \
158    tests/netlink_utils_unittest.cpp \
159    tests/nl80211_attribute_unittest.cpp \
160    tests/nl80211_packet_unittest.cpp \
161    tests/scan_result_unittest.cpp \
162    tests/scan_settings_unittest.cpp \
163    tests/scan_utils_unittest.cpp \
164    tests/server_unittest.cpp
165LOCAL_STATIC_LIBRARIES := \
166    libgmock \
167    libgtest \
168    libwifi-system-test \
169    libwificond \
170    libwificond_nl
171LOCAL_SHARED_LIBRARIES := \
172    libbase \
173    libbinder \
174    liblog \
175    libutils \
176    libwifi-system
177include $(BUILD_NATIVE_TEST)
178
179###
180### wificond device integration tests.
181###
182include $(CLEAR_VARS)
183LOCAL_MODULE := wificond_integration_test
184LOCAL_CPPFLAGS := $(wificond_cpp_flags)
185LOCAL_C_INCLUDES := $(wificond_includes)
186LOCAL_SRC_FILES := \
187    tests/integration/ap_interface_test.cpp \
188    tests/integration/client_interface_test.cpp \
189    tests/integration/life_cycle_test.cpp \
190    tests/integration/scanner_test.cpp \
191    tests/integration/service_test.cpp \
192    tests/main.cpp \
193    tests/shell_unittest.cpp
194LOCAL_SHARED_LIBRARIES := \
195    libbase \
196    libbinder \
197    libcutils \
198    libutils \
199    libwifi-system
200LOCAL_STATIC_LIBRARIES := \
201    libgmock \
202    libwificond_ipc \
203    libwificond_test_utils
204include $(BUILD_NATIVE_TEST)
205