aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2016-12-07 14:21:42 -0800
committerColin Cross <ccross@android.com>2016-12-12 14:27:12 -0800
commit5a2d24e315d79f735eeb8b6560118f10edbd6b05 (patch)
tree7148561d317035ef75962fb9184c95dc11cc500e /tools
parentece9b9d66607658694c1d7381a01634a2a05bcea (diff)
downloadlibbcc-5a2d24e315d79f735eeb8b6560118f10edbd6b05.tar.gz
Convert libbcc to Android.bp
See build/soong/README.md for more information. Includes one small code change to replace FORCE_BUILD_LLVM_DISABLE_NDEBUG with _DEBUG, which is set already in llvm-defaults in external/llvm/soong/llvm.go when the environment variable is set. libbcc-targets.mk remains, it is still used by frameworks/rs/cpu_ref. Test: mma -j Test: mma -j FORCE_BUILD_LLVM_COMPONENTS=true Change-Id: Iec37d2c33020bb5702c27497ae343a8312601202
Diffstat (limited to 'tools')
-rw-r--r--tools/Android.bp5
-rw-r--r--tools/Android.mk18
-rw-r--r--tools/bcc/Android.bp43
-rw-r--r--tools/bcc/Android.mk57
-rw-r--r--tools/bcc_compat/Android.bp48
-rw-r--r--tools/bcc_compat/Android.mk47
-rw-r--r--tools/bcc_strip_attr/Android.bp41
-rw-r--r--tools/bcc_strip_attr/Android.mk39
8 files changed, 137 insertions, 161 deletions
diff --git a/tools/Android.bp b/tools/Android.bp
new file mode 100644
index 0000000..15e0a1e
--- /dev/null
+++ b/tools/Android.bp
@@ -0,0 +1,5 @@
+subdirs = [
+ "bcc",
+ "bcc_compat",
+ "bcc_strip_attr",
+]
diff --git a/tools/Android.mk b/tools/Android.mk
deleted file mode 100644
index 1106ba0..0000000
--- a/tools/Android.mk
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# Copyright (C) 2010-2012 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 $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/tools/bcc/Android.bp b/tools/bcc/Android.bp
new file mode 100644
index 0000000..b1f7c7f
--- /dev/null
+++ b/tools/bcc/Android.bp
@@ -0,0 +1,43 @@
+//
+// Copyright (C) 2010-2012 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: "bcc",
+ host_supported: true,
+ defaults: ["libbcc-defaults"],
+
+ srcs: ["Main.cpp"],
+
+ shared_libs: [
+ "libbcc",
+ "libbcinfo",
+ "libLLVM",
+ ],
+
+ target: {
+ host: {
+ host_ldlibs: ["-ldl"],
+ },
+ android: {
+ shared_libs: [
+ "libdl",
+ "liblog",
+ "libutils",
+ "libcutils",
+ ],
+ },
+ },
+}
diff --git a/tools/bcc/Android.mk b/tools/bcc/Android.mk
deleted file mode 100644
index b2a8410..0000000
--- a/tools/bcc/Android.mk
+++ /dev/null
@@ -1,57 +0,0 @@
-#
-# Copyright (C) 2010-2012 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)
-
-# Executable for host
-# ========================================================
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := bcc
-LOCAL_MODULE_CLASS := EXECUTABLES
-
-LOCAL_SRC_FILES := Main.cpp
-
-LOCAL_SHARED_LIBRARIES := \
- libbcc \
- libbcinfo \
- libLLVM
-
-LOCAL_C_INCLUDES := \
- $(LOCAL_PATH)/../../include
-
-LOCAL_LDLIBS = -ldl
-
-include $(LIBBCC_HOST_BUILD_MK)
-include $(LLVM_HOST_BUILD_MK)
-include $(BUILD_HOST_EXECUTABLE)
-
-# Executable for target
-# ========================================================
-ifneq (true,$(DISABLE_LLVM_DEVICE_BUILDS))
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := bcc
-LOCAL_MODULE_CLASS := EXECUTABLES
-
-LOCAL_SRC_FILES := Main.cpp
-
-LOCAL_SHARED_LIBRARIES := libdl liblog libbcinfo libbcc libLLVM libutils libcutils
-
-include $(LIBBCC_DEVICE_BUILD_MK)
-include $(LLVM_DEVICE_BUILD_MK)
-include $(BUILD_EXECUTABLE)
-endif
diff --git a/tools/bcc_compat/Android.bp b/tools/bcc_compat/Android.bp
new file mode 100644
index 0000000..51f5a81
--- /dev/null
+++ b/tools/bcc_compat/Android.bp
@@ -0,0 +1,48 @@
+//
+// Copyright (C) 2012 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.
+//
+
+// Executable for host
+// ========================================================
+cc_binary_host {
+ name: "bcc_compat",
+ defaults: ["libbcc-defaults"],
+
+ srcs: ["Main.cpp"],
+
+ target: {
+ windows: {
+ enabled: true,
+ },
+ darwin: {
+ host_ldlibs: ["-ldl"],
+ },
+ linux: {
+ host_ldlibs: ["-ldl"],
+ },
+ },
+ shared_libs: [
+ "libbcc",
+ "libbcinfo",
+ "libLLVM",
+ ],
+
+ product_variables: {
+ unbundled_build: {
+ // Don't build for unbundled branches
+ enabled: false,
+ },
+ },
+}
diff --git a/tools/bcc_compat/Android.mk b/tools/bcc_compat/Android.mk
deleted file mode 100644
index 49f5f36..0000000
--- a/tools/bcc_compat/Android.mk
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# Copyright (C) 2012 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)
-
-# Don't build for unbundled branches
-ifeq (,$(TARGET_BUILD_APPS))
-
-# Executable for host
-# ========================================================
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := bcc_compat
-LOCAL_MODULE_CLASS := EXECUTABLES
-LOCAL_MODULE_HOST_OS := darwin linux windows
-
-LOCAL_SHARED_LIBRARIES := \
- libbcc \
- libbcinfo \
- libLLVM
-
-LOCAL_C_INCLUDES := \
- $(LOCAL_PATH)/../../include
-
-LOCAL_LDLIBS_darwin = -ldl
-LOCAL_LDLIBS_linux = -ldl
-
-LOCAL_SRC_FILES := Main.cpp
-
-include $(LIBBCC_HOST_BUILD_MK)
-include $(LLVM_HOST_BUILD_MK)
-include $(BUILD_HOST_EXECUTABLE)
-
-endif # Don't build for PDK or unbundled branches
diff --git a/tools/bcc_strip_attr/Android.bp b/tools/bcc_strip_attr/Android.bp
new file mode 100644
index 0000000..bd6d4c3
--- /dev/null
+++ b/tools/bcc_strip_attr/Android.bp
@@ -0,0 +1,41 @@
+//
+// 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.
+//
+
+// Executable for host
+// ========================================================
+cc_binary_host {
+ name: "bcc_strip_attr",
+ defaults: ["libbcc-defaults"],
+
+ srcs: ["bcc_strip_attr.cpp"],
+ shared_libs: ["libLLVM"],
+
+ host_ldlibs: ["-lm"],
+ target: {
+ darwin: {
+ host_ldlibs: [
+ "-lpthread",
+ "-ldl",
+ ],
+ },
+ linux: {
+ host_ldlibs: [
+ "-lpthread",
+ "-ldl",
+ ],
+ },
+ },
+}
diff --git a/tools/bcc_strip_attr/Android.mk b/tools/bcc_strip_attr/Android.mk
deleted file mode 100644
index 1158f4e..0000000
--- a/tools/bcc_strip_attr/Android.mk
+++ /dev/null
@@ -1,39 +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)
-
-# Executable for host
-# ========================================================
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := bcc_strip_attr
-LOCAL_MODULE_CLASS := EXECUTABLES
-
-LOCAL_SHARED_LIBRARIES := libLLVM
-
-LOCAL_C_INCLUDES := \
- $(LOCAL_PATH)/../../include
-
-LOCAL_LDLIBS += -lm
-LOCAL_LDLIBS_darwin += -lpthread -ldl
-LOCAL_LDLIBS_linux += -lpthread -ldl
-LOCAL_SRC_FILES := bcc_strip_attr.cpp
-
-include $(LIBBCC_HOST_BUILD_MK)
-include $(LLVM_HOST_BUILD_MK)
-include $(LLVM_GEN_ATTRIBUTES_MK)
-include $(BUILD_HOST_EXECUTABLE)