Convert ioshark to Soong

See build/soong/README.md for more information.

Some modules are no longer installed by default on eng/debug builds, but
I didn't see any automatic references to them. If they're commonly used
by users, they can be added into build/make with PRODUCT_PACKAGES_ENG /
PRODUCT_PACKAGES_DEBUG. Otherwise everyone's compiles get a little
smaller.

Some modules also moved from /system/xbin to /system/bin, as we've
deprecated xbin. I checked codesearch for references to the full paths
and couldn't find any.

Test: cd system/extras/ioshark; mma
Test: for the modules changing locations, check cs/ for references
Change-Id: I0e84e9d5adfef2cd7a7e717462c0364489c3d70d
Merged-In: I0e84e9d5adfef2cd7a7e717462c0364489c3d70d
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 8f0a0fb..00907b2 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -68,6 +68,7 @@
 $(call add-clean-step, rm -f $(TARGET_OUT_OPTIONAL_EXECUTABLES)/cpueater)
 $(call add-clean-step, rm -f $(TARGET_OUT_OPTIONAL_EXECUTABLES)/daemonize)
 $(call add-clean-step, rm -f $(TARGET_OUT_OPTIONAL_EXECUTABLES)/directiotest)
+$(call add-clean-step, rm -f $(TARGET_OUT_OPTIONAL_EXECUTABLES)/ioshark_bench)
 # ************************************************
 # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
 # ************************************************
diff --git a/ioshark/Android.bp b/ioshark/Android.bp
new file mode 100644
index 0000000..1ea257c
--- /dev/null
+++ b/ioshark/Android.bp
@@ -0,0 +1,60 @@
+// Copyright (C) 2016 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+cc_defaults {
+    name: "ioshark_defaults",
+
+    cflags: [
+        "-g",
+        "-O2",
+        "-Wall",
+        "-Werror",
+    ],
+
+    target: {
+        darwin: {
+            enabled: false,
+        },
+        host: {
+            cflags: [
+                "-D_GNU_SOURCE",
+            ],
+        },
+    },
+}
+
+cc_binary {
+    name: "ioshark_bench",
+    defaults: ["ioshark_defaults"],
+    srcs: [
+        "ioshark_bench.c",
+        "ioshark_bench_subr.c",
+        "ioshark_bench_mmap.c",
+    ],
+}
+
+cc_binary_host {
+    name: "compile_ioshark",
+    defaults: ["ioshark_defaults"],
+    srcs: [
+        "compile_ioshark.c",
+        "compile_ioshark_subr.c",
+    ],
+}
+
+cc_binary_host {
+    name: "dump_ioshark_filenames",
+    defaults: ["ioshark_defaults"],
+    srcs: ["dump_ioshark_filenames.c"],
+}
diff --git a/ioshark/Android.mk b/ioshark/Android.mk
deleted file mode 100644
index a647d75..0000000
--- a/ioshark/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (C) 2016 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-#LOCAL_32_BIT_ONLY = true
-LOCAL_MODULE_HOST_OS := linux
-LOCAL_SRC_FILES := ioshark_bench.c ioshark_bench_subr.c ioshark_bench_mmap.c
-LOCAL_CFLAGS := -g -O2 -Wall  -Werror
-LOCAL_MODULE := ioshark_bench
-LOCAL_MODULE_TAGS := debug
-LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-#LOCAL_32_BIT_ONLY = true
-LOCAL_MODULE_HOST_OS := linux
-LOCAL_SRC_FILES := compile_ioshark.c compile_ioshark_subr.c
-LOCAL_CFLAGS := -g -O2 -Wall -Werror -D_GNU_SOURCE
-LOCAL_MODULE := compile_ioshark
-LOCAL_MODULE_TAGS := debug
-include $(BUILD_HOST_EXECUTABLE)
-
-include $(CLEAR_VARS)
-#LOCAL_32_BIT_ONLY = true
-LOCAL_MODULE_HOST_OS := linux
-LOCAL_SRC_FILES := dump_ioshark_filenames.c
-LOCAL_CFLAGS := -g -O2 -Wall -Werror -D_GNU_SOURCE
-LOCAL_MODULE := dump_ioshark_filenames
-LOCAL_MODULE_TAGS := debug
-include $(BUILD_HOST_EXECUTABLE)
-