OSDN Git Service

Add Android.mk
[android-x86/external-wireless-tools.git] / wireless_tools / Android.mk
1 #
2 # Copyright (C) 2019 The Android-x86 Open Source Project
3 #
4 # Licensed under the GNU General Public License Version 2 or later.
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.gnu.org/licenses/gpl.html
9 #
10
11 LOCAL_PATH := $(call my-dir)
12
13 # GENERAL
14 WT_CFLAGS       := -Wall -W -O3 -Wno-unused-but-set-variable -Wno-array-bounds \
15                    -Wno-self-assign -Wshadow -Wpointer-arith -Wcast-qual -Winline
16
17 include $(CLEAR_VARS)
18 LOCAL_MODULE := iwlib
19 LOCAL_MODULE_CLASS := SHARED_LIBRARIES
20 LOCAL_SRC_FILES := iwlib.c
21 LOCAL_CFLAGS := $(WT_CFLAGS)
22 WT_WIRELESS_H := $(local-generated-sources-dir)/wireless.h
23 LOCAL_GENERATED_SOURCES := $(WT_WIRELESS_H)
24 LOCAL_EXPORT_C_INCLUDE_DIRS := $(local-generated-sources-dir)
25 $(WT_WIRELESS_H): $(LOCAL_PATH)/iwlib.h | $(ACP)
26         $(ACP) $(^D)/wireless.`sed -ne "/WE_VERSION/{s:\([^0-9]*\)::;p;q;}" $^`.h $@
27 include $(BUILD_SHARED_LIBRARY)
28
29 define build-wt-tool
30 include $$(CLEAR_VARS)
31
32 LOCAL_MODULE := $(1)
33 LOCAL_SRC_FILES := $(1).c
34 LOCAL_CFLAGS := $$(WT_CFLAGS)
35 LOCAL_SHARED_LIBRARIES := iwlib
36 LOCAL_MODULE_PATH := $$(TARGET_OUT_OPTIONAL_EXECUTABLES)
37 include $$(BUILD_EXECUTABLE)
38 endef
39
40 WT_TOOLS := \
41     ifrename \
42     iwconfig \
43     iwevent \
44     iwgetid \
45     iwlist \
46     iwpriv \
47     iwspy \
48     macaddr \
49
50 $(foreach w,$(WT_TOOLS),$(eval $(call build-wt-tool,$(w))))