aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2018-11-19 22:44:34 -0800
committerandroid-build-merger <android-build-merger@google.com>2018-11-19 22:44:34 -0800
commit2754ca14261e310b70ffb84741e25ff8da0e95a8 (patch)
tree3b6d2f9c5060e8e0ab1ce25dee65c66fe7d7926b
parent63d8bad2a5a8a9b443595762233692c5f6a6d36b (diff)
parentaf62e485b1a91d011f2eb5590c6a489eb4527cc5 (diff)
downloadiw-2754ca14261e310b70ffb84741e25ff8da0e95a8.tar.gz
Convert to Android.bp am: 5d3caffc88
am: af62e485b1 Change-Id: I28c8a501fb9ba332de52ca3ea1b5e2a4aac759c7
-rw-r--r--Android.bp62
-rw-r--r--Android.mk36
2 files changed, 62 insertions, 36 deletions
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..c3b4f26
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,62 @@
+genrule {
+ name: "iw_version",
+ cmd: "echo '#include \"iw.h\"' >$(out) && " +
+ "echo \"const char iw_version[] = $$(grep ^VERSION $(location version.sh) | sed \"s/VERSION=//\");\" >>$(out)",
+ srcs: ["version.sh"],
+ out: ["version.c"],
+}
+
+cc_binary {
+ name: "iw",
+
+ srcs: [
+ "iw.c",
+ "genl.c",
+ "event.c",
+ "info.c",
+ "phy.c",
+ "interface.c",
+ "ibss.c",
+ "station.c",
+ "survey.c",
+ "util.c",
+ "ocb.c",
+ "mesh.c",
+ "mpath.c",
+ "mpp.c",
+ "scan.c",
+ "reg.c",
+ "reason.c",
+ "status.c",
+ "connect.c",
+ "link.c",
+ "offch.c",
+ "ps.c",
+ "cqm.c",
+ "bitrate.c",
+ "wowlan.c",
+ "coalesce.c",
+ "roc.c",
+ "p2p.c",
+ "vendor.c",
+ "sections.c",
+
+ ":iw_version",
+ ],
+
+ cflags: [
+ "-D_GNU_SOURCE",
+ "-DCONFIG_LIBNL20",
+
+ // Silence some warnings for now. Needs to be fixed upstream. b/26105799
+ "-Wno-unused-parameter",
+ "-Wno-sign-compare",
+ "-Wno-format",
+ "-Wno-absolute-value",
+ "-Wno-enum-conversion",
+ "-Werror",
+ ],
+
+ ldflags: ["-Wl,--no-gc-sections"],
+ static_libs: ["libnl"],
+}
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index bd5fa96..0000000
--- a/Android.mk
+++ /dev/null
@@ -1,36 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
- iw.c genl.c event.c info.c phy.c \
- interface.c ibss.c station.c survey.c util.c ocb.c \
- mesh.c mpath.c mpp.c scan.c reg.c \
- reason.c status.c connect.c link.c offch.c ps.c cqm.c \
- bitrate.c wowlan.c coalesce.c roc.c p2p.c vendor.c \
- sections.c
-
-LOCAL_CFLAGS += -D_GNU_SOURCE -DCONFIG_LIBNL20
-
-# Silence some warnings for now. Needs to be fixed upstream. b/26105799
-LOCAL_CFLAGS += -Wno-unused-parameter \
- -Wno-sign-compare \
- -Wno-format \
- -Wno-absolute-value \
- -Werror
-LOCAL_CLANG_CFLAGS += -Wno-enum-conversion
-
-LOCAL_LDFLAGS := -Wl,--no-gc-sections
-LOCAL_MODULE_TAGS := debug
-LOCAL_STATIC_LIBRARIES := libnl
-LOCAL_MODULE := iw
-
-LOCAL_MODULE_CLASS := EXECUTABLES
-LOCAL_GENERATED_SOURCES := $(local-generated-sources-dir)/version.c
-$(LOCAL_GENERATED_SOURCES) : $(LOCAL_PATH)/version.sh
- @echo "Generated: $@"
- @mkdir -p $(dir $@)
- $(hide) echo '#include "iw.h"' >$@
- $(hide) echo "const char iw_version[] = $$(grep ^VERSION $< | sed "s/VERSION=//");" >>$@
-
-include $(BUILD_EXECUTABLE)