Convert external/gemmlowp to Android.bp

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

Test: m -j
Change-Id: Iee7d12947efff9c968c1df0c581db7cde7d120a3
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..5e20eb9
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,15 @@
+// Copyright (C) 2015 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.
+
+subdirs = ["eight_bit_int_gemm"]
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index 44416cb..0000000
--- a/Android.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (C) 2015 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 $(LOCAL_PATH)/eight_bit_int_gemm/Android.mk
diff --git a/eight_bit_int_gemm/Android.bp b/eight_bit_int_gemm/Android.bp
new file mode 100644
index 0000000..fd38f44
--- /dev/null
+++ b/eight_bit_int_gemm/Android.bp
@@ -0,0 +1,43 @@
+// Copyright (C) 2015 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: "libbnnmlowp-defaults",
+    cflags: ["-Wno-unused-parameter"],
+
+    srcs: ["eight_bit_int_gemm.cc"],
+    export_include_dirs: ["."],
+}
+
+cc_library_static {
+    name: "libbnnmlowp",
+    defaults: ["libbnnmlowp-defaults"],
+}
+
+cc_library_static {
+    name: "libbnnmlowpV8",
+    defaults: ["libbnnmlowp-defaults"],
+
+    sdk_version: "9",
+
+    // Always build gemmlowpV8 for armv7 using NEON,
+    // alternate non-SIMD route is built in libRSSupport.
+    arch: {
+        arm: {
+            cflags: ["-mfpu=neon"],
+        },
+    },
+
+    stl: "c++_static",
+}
diff --git a/eight_bit_int_gemm/Android.mk b/eight_bit_int_gemm/Android.mk
deleted file mode 100644
index 84d5e2d..0000000
--- a/eight_bit_int_gemm/Android.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright (C) 2015 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_CLANG := true
-LOCAL_CFLAGS += -Wno-unused-parameter
-LOCAL_MODULE := libbnnmlowp
-
-LOCAL_CPP_EXTENSION := .cc
-LOCAL_SRC_FILES:= eight_bit_int_gemm.cc
-LOCAL_C_INCLUDES += external/gemmlowp/
-
-include $(BUILD_STATIC_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_CLANG := true
-LOCAL_MODULE := libbnnmlowpV8
-
-LOCAL_SDK_VERSION := 9
-LOCAL_CPP_EXTENSION := .cc
-LOCAL_SRC_FILES:= eight_bit_int_gemm.cc
-
-# Always build gemmlowpV8 for armv7 using NEON,
-# alternate non-SIMD route is built in libRSSupport.
-ifeq ($(ARCH_ARM_HAVE_ARMV7A),true)
-LOCAL_CFLAGS_arm := -mfpu=neon
-endif
-LOCAL_CFLAGS += -std=c++11
-LOCAL_CFLAGS += -DGEMMLOWP_USE_STLPORT
-LOCAL_C_INCLUDES += external/gemmlowp/
-LOCAL_NDK_STL_VARIANT := c++_static
-
-include $(BUILD_STATIC_LIBRARY)