summaryrefslogtreecommitdiffstats
path: root/libion
diff options
context:
space:
mode:
Diffstat (limited to 'libion')
-rw-r--r--libion/Android.bp25
-rw-r--r--libion/Android.mk22
-rw-r--r--libion/tests/Android.bp36
-rw-r--r--libion/tests/Android.mk33
4 files changed, 61 insertions, 55 deletions
diff --git a/libion/Android.bp b/libion/Android.bp
new file mode 100644
index 000000000..da98111fc
--- /dev/null
+++ b/libion/Android.bp
@@ -0,0 +1,25 @@
+
+cc_library {
+ name: "libion",
+ srcs: ["ion.c"],
+ shared_libs: ["liblog"],
+ local_include_dirs: [
+ "include",
+ "kernel-headers",
+ ],
+ export_include_dirs: [
+ "include",
+ "kernel-headers",
+ ],
+ cflags: ["-Werror"],
+}
+
+cc_binary {
+ name: "iontest",
+ srcs: ["ion_test.c"],
+ static_libs: ["libion"],
+ shared_libs: ["liblog"],
+ cflags: ["-Werror"],
+}
+
+subdirs = ["tests"]
diff --git a/libion/Android.mk b/libion/Android.mk
deleted file mode 100644
index 6562cd3e9..000000000
--- a/libion/Android.mk
+++ /dev/null
@@ -1,22 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := ion.c
-LOCAL_MODULE := libion
-LOCAL_MODULE_TAGS := optional
-LOCAL_SHARED_LIBRARIES := liblog
-LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/kernel-headers
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include $(LOCAL_PATH)/kernel-headers
-LOCAL_CFLAGS := -Werror
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := ion.c ion_test.c
-LOCAL_MODULE := iontest
-LOCAL_MODULE_TAGS := optional tests
-LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/kernel-headers
-LOCAL_SHARED_LIBRARIES := liblog
-LOCAL_CFLAGS := -Werror
-include $(BUILD_EXECUTABLE)
-
-include $(call first-makefiles-under,$(LOCAL_PATH))
diff --git a/libion/tests/Android.bp b/libion/tests/Android.bp
new file mode 100644
index 000000000..4428848e1
--- /dev/null
+++ b/libion/tests/Android.bp
@@ -0,0 +1,36 @@
+//
+// Copyright (C) 2013 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: "ion-unit-tests",
+ clang: true,
+ cflags: [
+ "-g",
+ "-Wall",
+ "-Werror",
+ "-Wno-missing-field-initializers",
+ ],
+ shared_libs: ["libion"],
+ srcs: [
+ "ion_test_fixture.cpp",
+ "allocate_test.cpp",
+ "formerly_valid_handle_test.cpp",
+ "invalid_values_test.cpp",
+ "map_test.cpp",
+ "device_test.cpp",
+ "exit_test.cpp",
+ ],
+}
diff --git a/libion/tests/Android.mk b/libion/tests/Android.mk
deleted file mode 100644
index d4d07c232..000000000
--- a/libion/tests/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# Copyright (C) 2013 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_MODULE := ion-unit-tests
-LOCAL_CFLAGS += -g -Wall -Werror -Wno-missing-field-initializers
-LOCAL_SHARED_LIBRARIES += libion
-LOCAL_C_INCLUDES := $(LOCAL_PATH)/../kernel-headers
-LOCAL_SRC_FILES := \
- ion_test_fixture.cpp \
- allocate_test.cpp \
- formerly_valid_handle_test.cpp \
- invalid_values_test.cpp \
- map_test.cpp \
- device_test.cpp \
- exit_test.cpp
-include $(BUILD_NATIVE_TEST)