summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2018-10-24 20:16:56 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-10-24 20:16:56 -0700
commitac2e190c850478633da11a7f7752d3be5aa50533 (patch)
treef9267c1b6f6c93cf790ae78036be7bbb61a5965f
parente73738630c866f274cd21a5b1692285a0fe4bcd7 (diff)
parent9ee7623e567477931c0226e136b160d111759b48 (diff)
downloadcontexthub-ac2e190c850478633da11a7f7752d3be5aa50533.tar.gz
Convert to Android.bp am: 543168df41 am: 3bf5f54eed
am: 9ee7623e56 Change-Id: I5bcd2656011eeaac29124168fab99f11dd00fe53
-rw-r--r--contexthubhal/test/Android.bp39
-rw-r--r--contexthubhal/test/Android.mk48
-rw-r--r--lib/Android.bp42
-rw-r--r--lib/Android.mk23
-rw-r--r--util/nanoapp_cmd/Android.bp42
-rw-r--r--util/nanoapp_cmd/Android.mk39
-rw-r--r--util/nanoapp_encr/Android.bp32
-rw-r--r--util/nanoapp_encr/Android.mk40
-rw-r--r--util/nanoapp_postprocess/Android.bp47
-rw-r--r--util/nanoapp_postprocess/Android.mk45
-rw-r--r--util/nanoapp_sign/Android.bp33
-rw-r--r--util/nanoapp_sign/Android.mk44
-rw-r--r--util/nanotool/Android.bp54
-rw-r--r--util/nanotool/Android.mk58
-rw-r--r--util/sensortest/Android.bp35
-rw-r--r--util/sensortest/Android.mk39
-rw-r--r--util/stm32_flash/Android.bp36
-rw-r--r--util/stm32_flash/Android.mk37
18 files changed, 360 insertions, 373 deletions
diff --git a/contexthubhal/test/Android.bp b/contexthubhal/test/Android.bp
new file mode 100644
index 00000000..9ab543c5
--- /dev/null
+++ b/contexthubhal/test/Android.bp
@@ -0,0 +1,39 @@
+//
+// 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_test {
+ name: "nanohub_hal_test",
+ gtest: false,
+
+ srcs: ["main.cpp"],
+
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wextra",
+ "-DHOST_BUILD",
+ "-DBOOTLOADER=",
+ "-DBOOTLOADER_RO=",
+ ],
+
+ static_libs: ["libnanohub_common"],
+
+ shared_libs: [
+ "libhardware",
+ "liblog",
+ "libcutils",
+ ],
+}
diff --git a/contexthubhal/test/Android.mk b/contexthubhal/test/Android.mk
deleted file mode 100644
index 44d2744e..00000000
--- a/contexthubhal/test/Android.mk
+++ /dev/null
@@ -1,48 +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_SRC_FILES := main.cpp \
- ../../lib/nanohub/nanoapp.c \
-
-
-LOCAL_CFLAGS := \
- -Wall \
- -Werror \
- -Wextra \
- -DHOST_BUILD \
- -DBOOTLOADER= \
- -DBOOTLOADER_RO= \
-
-
-LOCAL_C_INCLUDES := \
- device/google/contexthub/lib/include \
- hardware/libhardware/include \
-
-LOCAL_SHARED_LIBRARIES := \
- libhardware \
- liblog \
- libcutils \
-
-LOCAL_MODULE := nanohub_hal_test
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_EXECUTABLE)
diff --git a/lib/Android.bp b/lib/Android.bp
index 828d29ed..58b71268 100644
--- a/lib/Android.bp
+++ b/lib/Android.bp
@@ -1,5 +1,47 @@
+//
+// 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_library_headers {
name: "libnanohub_common_headers",
vendor_available: true,
export_include_dirs: ["include"],
}
+
+cc_library_static {
+ name: "libnanohub_common",
+ host_supported: true,
+
+ srcs: ["nanohub/nanoapp.c"],
+
+ export_include_dirs: ["include"],
+
+ target: {
+ host: {
+ cflags: [
+ "-DHOST_BUILD",
+ "-DRSA_SUPPORT_PRIV_OP_BIGRAM",
+ ],
+
+ srcs: [
+ "nanohub/aes.c",
+ "nanohub/rsa.c",
+ "nanohub/sha2.c",
+
+ "nanohub/softcrc.c",
+ ],
+ },
+ },
+}
diff --git a/lib/Android.mk b/lib/Android.mk
index 88707e17..c47b6af5 100644
--- a/lib/Android.mk
+++ b/lib/Android.mk
@@ -46,29 +46,6 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := $(src_includes)
include $(BUILD_NANOHUB_OS_STATIC_LIBRARY)
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := libnanohub_common
-LOCAL_MODULE_TAGS := optional
-LOCAL_SRC_FILES := \
- $(src_files) \
- nanohub/softcrc.c \
- nanohub/nanoapp.c \
-
-LOCAL_CFLAGS := \
- -DHOST_BUILD \
- -DRSA_SUPPORT_PRIV_OP_BIGRAM \
-
-LOCAL_C_INCLUDES := \
- $(src_includes)
-
-LOCAL_EXPORT_C_INCLUDE_DIRS := \
- $(src_includes)
-
-LOCAL_MULTILIB := both
-
-include $(BUILD_HOST_STATIC_LIBRARY)
-
include $(call first-makefiles-under, $(LOCAL_PATH))
src_files :=
diff --git a/util/nanoapp_cmd/Android.bp b/util/nanoapp_cmd/Android.bp
new file mode 100644
index 00000000..62aabae5
--- /dev/null
+++ b/util/nanoapp_cmd/Android.bp
@@ -0,0 +1,42 @@
+//
+// 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_binary {
+ name: "nanoapp_cmd",
+
+ srcs: ["nanoapp_cmd.c"],
+
+ header_libs: [
+ "libnanohub_common_headers",
+ ],
+ include_dirs: [
+ "device/google/contexthub/firmware/os/inc",
+ ],
+
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wextra",
+ ],
+
+ shared_libs: [
+ "liblog",
+ "libutils",
+ ],
+
+ owner: "google",
+ vendor: true,
+}
diff --git a/util/nanoapp_cmd/Android.mk b/util/nanoapp_cmd/Android.mk
deleted file mode 100644
index 35320eb5..00000000
--- a/util/nanoapp_cmd/Android.mk
+++ /dev/null
@@ -1,39 +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_SRC_FILES:= nanoapp_cmd.c
-
-LOCAL_C_INCLUDES += \
- $(LOCAL_PATH)/../../firmware/os/inc \
- $(LOCAL_PATH)/../../lib/include
-
-LOCAL_CFLAGS := -Wall -Werror -Wextra
-
-LOCAL_MODULE:= nanoapp_cmd
-
-LOCAL_MODULE_TAGS:= optional
-LOCAL_MODULE_OWNER := google
-LOCAL_PROPRIETARY_MODULE := true
-
-LOCAL_LDLIBS := -llog
-
-LOCAL_SHARED_LIBRARIES := \
- libutils \
-
-include $(BUILD_EXECUTABLE)
diff --git a/util/nanoapp_encr/Android.bp b/util/nanoapp_encr/Android.bp
new file mode 100644
index 00000000..5e9ff1e3
--- /dev/null
+++ b/util/nanoapp_encr/Android.bp
@@ -0,0 +1,32 @@
+//
+// 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_binary_host {
+ name: "nanoapp_encr",
+
+ srcs: ["nanoapp_encr.c"],
+
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wextra",
+ "-DHOST_BUILD",
+ "-DBOOTLOADER=",
+ "-DBOOTLOADER_RO=",
+ ],
+
+ static_libs: ["libnanohub_common"],
+}
diff --git a/util/nanoapp_encr/Android.mk b/util/nanoapp_encr/Android.mk
deleted file mode 100644
index 84444e12..00000000
--- a/util/nanoapp_encr/Android.mk
+++ /dev/null
@@ -1,40 +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_SRC_FILES := \
- nanoapp_encr.c \
-
-
-LOCAL_CFLAGS := \
- -Wall \
- -Werror \
- -Wextra \
- -DHOST_BUILD \
- -DBOOTLOADER= \
- -DBOOTLOADER_RO= \
-
-LOCAL_STATIC_LIBRARIES := libnanohub_common
-
-LOCAL_MODULE := nanoapp_encr
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_EXECUTABLE)
diff --git a/util/nanoapp_postprocess/Android.bp b/util/nanoapp_postprocess/Android.bp
new file mode 100644
index 00000000..6a8400f0
--- /dev/null
+++ b/util/nanoapp_postprocess/Android.bp
@@ -0,0 +1,47 @@
+//
+// 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_binary_host {
+ name: "nanoapp_postprocess",
+
+ srcs: ["postprocess_elf.c"],
+
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wextra",
+ ],
+
+ static_libs: [
+ "libnanohub_common",
+
+ // libelf needed for ELF parsing support, libz required by libelf
+ "libelf",
+ "libz",
+ ],
+
+ // Statically linking libc++ so this binary can be copied out of the tree and
+ // still work (needed by dependencies)
+ stl: "libc++_static",
+
+ target: {
+ // libelf is not available in the Mac build as of June 2016, but we currently
+ // only need to use this tool on Linux, so exclude this from non-Linux builds
+ darwin: {
+ enabled: false,
+ },
+ },
+}
diff --git a/util/nanoapp_postprocess/Android.mk b/util/nanoapp_postprocess/Android.mk
deleted file mode 100644
index 9b4539be..00000000
--- a/util/nanoapp_postprocess/Android.mk
+++ /dev/null
@@ -1,45 +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.
-#
-
-# libelf is not available in the Mac build as of June 2016, but we currently
-# only need to use this tool on Linux, so exclude this from non-Linux builds
-ifeq ($(HOST_OS),linux)
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
- postprocess_elf.c \
-
-LOCAL_CFLAGS := -Wall -Werror -Wextra
-
-LOCAL_STATIC_LIBRARIES := libnanohub_common
-
-LOCAL_MODULE := nanoapp_postprocess
-
-# libelf needed for ELF parsing support, libz required by libelf
-LOCAL_STATIC_LIBRARIES += libelf libz
-
-# Statically linking libc++ so this binary can be copied out of the tree and
-# still work (needed by dependencies)
-LOCAL_CXX_STL := libc++_static
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_EXECUTABLE)
-
-endif # linux
diff --git a/util/nanoapp_sign/Android.bp b/util/nanoapp_sign/Android.bp
new file mode 100644
index 00000000..752ba878
--- /dev/null
+++ b/util/nanoapp_sign/Android.bp
@@ -0,0 +1,33 @@
+//
+// 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_binary_host {
+ name: "nanoapp_sign",
+
+ srcs: ["nanoapp_sign.c"],
+
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wextra",
+ "-DRSA_SUPPORT_PRIV_OP_BIGRAM",
+ "-DHOST_BUILD",
+ "-DBOOTLOADER=",
+ "-DBOOTLOADER_RO=",
+ ],
+
+ static_libs: ["libnanohub_common"],
+}
diff --git a/util/nanoapp_sign/Android.mk b/util/nanoapp_sign/Android.mk
deleted file mode 100644
index 7be51975..00000000
--- a/util/nanoapp_sign/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_SRC_FILES := \
- nanoapp_sign.c \
-
-LOCAL_CFLAGS := \
- -Wall \
- -Werror \
- -Wextra \
- -DRSA_SUPPORT_PRIV_OP_BIGRAM \
- -DHOST_BUILD \
- -DBOOTLOADER= \
- -DBOOTLOADER_RO= \
-
-
-ifneq ($(filter userdebug eng,$(TARGET_BUILD_VARIANT)),)
-LOCAL_CFLAGS += -DDEBUG_KEYS
-endif
-
-LOCAL_STATIC_LIBRARIES := libnanohub_common
-
-LOCAL_MODULE := nanoapp_sign
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_HOST_EXECUTABLE)
diff --git a/util/nanotool/Android.bp b/util/nanotool/Android.bp
new file mode 100644
index 00000000..0dc1ec0c
--- /dev/null
+++ b/util/nanotool/Android.bp
@@ -0,0 +1,54 @@
+//
+// 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.
+//
+
+NANOTOOL_VERSION = "1.2.0"
+
+cc_binary {
+ name: "nanotool",
+
+ srcs: [
+ "androidcontexthub.cpp",
+ "apptohostevent.cpp",
+ "calibrationfile.cpp",
+ "contexthub.cpp",
+ "log.cpp",
+ "logevent.cpp",
+ "nanomessage.cpp",
+ "nanotool.cpp",
+ "resetreasonevent.cpp",
+ "sensorevent.cpp",
+ ],
+
+ // JSON file handling from chinook
+ static_libs: ["libhubutilcommon"],
+ shared_libs: [
+ "liblog",
+ "libstagefright_foundation",
+ "libutils",
+ ],
+
+ cpp_std: "c++11",
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wextra",
+
+ "-DNANOTOOL_VERSION_STR=\"version " + NANOTOOL_VERSION + "\"",
+ ],
+
+ owner: "google",
+ vendor: true,
+}
diff --git a/util/nanotool/Android.mk b/util/nanotool/Android.mk
deleted file mode 100644
index fdd02951..00000000
--- a/util/nanotool/Android.mk
+++ /dev/null
@@ -1,58 +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)
-
-NANOTOOL_VERSION := 1.2.0
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
- androidcontexthub.cpp \
- apptohostevent.cpp \
- calibrationfile.cpp \
- contexthub.cpp \
- log.cpp \
- logevent.cpp \
- nanomessage.cpp \
- nanotool.cpp \
- resetreasonevent.cpp \
- sensorevent.cpp
-
-# JSON file handling from chinook
-COMMON_UTILS_DIR := ../common
-LOCAL_SRC_FILES += \
- $(COMMON_UTILS_DIR)/file.cpp \
- $(COMMON_UTILS_DIR)/JSONObject.cpp
-
-LOCAL_C_INCLUDES := \
- $(LOCAL_PATH)/$(COMMON_UTILS_DIR)
-
-LOCAL_SHARED_LIBRARIES := \
- liblog \
- libstagefright_foundation \
- libutils
-
-LOCAL_CFLAGS += -Wall -Werror -Wextra
-LOCAL_CFLAGS += -std=c++11
-LOCAL_CFLAGS += -DNANOTOOL_VERSION_STR='"version $(NANOTOOL_VERSION)"'
-
-LOCAL_MODULE := nanotool
-
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_OWNER := google
-
-include $(BUILD_EXECUTABLE)
diff --git a/util/sensortest/Android.bp b/util/sensortest/Android.bp
new file mode 100644
index 00000000..e1de6aee
--- /dev/null
+++ b/util/sensortest/Android.bp
@@ -0,0 +1,35 @@
+// 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_binary {
+ name: "sensortest",
+
+ srcs: ["sensortest.cpp"],
+
+ shared_libs: ["libandroid"],
+
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wextra",
+ ],
+
+ owner: "google",
+
+ strip: {
+ keep_symbols: true,
+ },
+
+ sdk_version: "current",
+}
diff --git a/util/sensortest/Android.mk b/util/sensortest/Android.mk
deleted file mode 100644
index 0f385e01..00000000
--- a/util/sensortest/Android.mk
+++ /dev/null
@@ -1,39 +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_SRC_FILES:= \
- sensortest.cpp \
-
-LOCAL_SHARED_LIBRARIES := \
- libandroid \
-
-LOCAL_C_INCLUDES:= \
-
-LOCAL_CFLAGS := -Wall -Werror -Wextra
-
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_OWNER := google
-
-LOCAL_STRIP_MODULE := keep_symbols
-
-LOCAL_MODULE:= sensortest
-
-LOCAL_SDK_VERSION := current
-
-include $(BUILD_EXECUTABLE)
-
diff --git a/util/stm32_flash/Android.bp b/util/stm32_flash/Android.bp
new file mode 100644
index 00000000..18e6f7b7
--- /dev/null
+++ b/util/stm32_flash/Android.bp
@@ -0,0 +1,36 @@
+//
+// 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_binary {
+ name: "stm32_flash",
+
+ shared_libs: ["libcutils"],
+
+ srcs: [
+ "flash.c",
+ "i2c.c",
+ "spi.c",
+ "stm32_bl.c",
+ "stm32f4_crc.c",
+ "uart.c",
+ ],
+
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wextra",
+ ],
+}
diff --git a/util/stm32_flash/Android.mk b/util/stm32_flash/Android.mk
deleted file mode 100644
index 3063c0ca..00000000
--- a/util/stm32_flash/Android.mk
+++ /dev/null
@@ -1,37 +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_SHARED_LIBRARIES := libcutils libc
-
-LOCAL_SRC_FILES := \
- flash.c \
- i2c.c \
- spi.c \
- stm32_bl.c \
- stm32f4_crc.c \
- uart.c
-
-LOCAL_CFLAGS := -Wall -Werror -Wextra
-
-LOCAL_MODULE := stm32_flash
-
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_EXECUTABLE)