Start converting Android.mk to Android.bp

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

Merged-In: Ifbe9b0072a63b4467c72b3a52148a606e5365f78
Change-Id: Ifbe9b0072a63b4467c72b3a52148a606e5365f78
This commit is contained in:
Dan Willemsen 2016-07-25 17:13:45 -07:00
parent 75b79d3f73
commit 59e086f536
32 changed files with 425 additions and 437 deletions

6
Android.bp Normal file
View file

@ -0,0 +1,6 @@
subdirs = [
"cmds/*",
"libs/*",
"opengl/*",
"services/*",
]

16
cmds/atrace/Android.bp Normal file
View file

@ -0,0 +1,16 @@
// Copyright 2012 The Android Open Source Project
cc_binary {
name: "atrace",
srcs: ["atrace.cpp"],
shared_libs: [
"libbinder",
"libcutils",
"libutils",
"libz",
"libbase",
],
init_rc: ["atrace.rc"],
}

View file

@ -1,23 +0,0 @@
# Copyright 2012 The Android Open Source Project
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= atrace.cpp
LOCAL_C_INCLUDES += external/zlib
LOCAL_MODULE:= atrace
LOCAL_MODULE_TAGS:= optional
LOCAL_SHARED_LIBRARIES := \
libbinder \
libcutils \
libutils \
libz \
libbase
LOCAL_INIT_RC := atrace.rc
include $(BUILD_EXECUTABLE)

View file

@ -0,0 +1,6 @@
cc_binary {
name: "bugreport",
srcs: ["bugreport.cpp"],
cflags: ["-Wall"],
shared_libs: ["libcutils"],
}

View file

@ -1,12 +0,0 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= bugreport.cpp
LOCAL_MODULE:= bugreport
LOCAL_CFLAGS := -Wall
LOCAL_SHARED_LIBRARIES := libcutils
include $(BUILD_EXECUTABLE)

View file

@ -0,0 +1,4 @@
cc_library_static {
name: "libdumpstate.default",
srcs: ["libdumpstate_default.cpp"],
}

View file

@ -1,8 +1,4 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := libdumpstate_default.cpp
LOCAL_MODULE := libdumpstate.default
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)

14
cmds/dumpsys/Android.bp Normal file
View file

@ -0,0 +1,14 @@
cc_binary {
name: "dumpsys",
srcs: ["dumpsys.cpp"],
shared_libs: [
"libutils",
"liblog",
"libbinder",
],
cflags: ["-DXP_UNIX"],
//shared_libs: ["librt"],
}

View file

@ -1,20 +0,0 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
dumpsys.cpp
LOCAL_SHARED_LIBRARIES := \
libutils \
liblog \
libbinder
ifeq ($(TARGET_OS),linux)
LOCAL_CFLAGS += -DXP_UNIX
#LOCAL_SHARED_LIBRARIES += librt
endif
LOCAL_MODULE:= dumpsys
include $(BUILD_EXECUTABLE)

48
cmds/installd/Android.bp Normal file
View file

@ -0,0 +1,48 @@
cc_defaults {
name: "installd_defaults",
cflags: [
"-Wall",
"-Werror",
],
srcs: [
"commands.cpp",
"utils.cpp",
],
shared_libs: [
"libbase",
"libcutils",
"liblog",
"liblogwrap",
"libselinux",
],
clang: true,
}
//
// Static library used in testing and executable
//
cc_library_static {
name: "libinstalld",
defaults: ["installd_defaults"],
export_include_dirs: ["."],
}
//
// Executable
//
cc_binary {
name: "installd",
defaults: ["installd_defaults"],
srcs: ["installd.cpp"],
static_libs: ["libdiskusage"],
init_rc: ["installd.rc"],
}
subdirs = ["tests"]

View file

@ -1,44 +0,0 @@
LOCAL_PATH := $(call my-dir)
common_src_files := commands.cpp utils.cpp
common_cflags := -Wall -Werror
#
# Static library used in testing and executable
#
include $(CLEAR_VARS)
LOCAL_MODULE := libinstalld
LOCAL_MODULE_TAGS := eng tests
LOCAL_SRC_FILES := $(common_src_files)
LOCAL_CFLAGS := $(common_cflags)
LOCAL_SHARED_LIBRARIES := \
libbase \
liblogwrap \
libselinux \
LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk
LOCAL_CLANG := true
include $(BUILD_STATIC_LIBRARY)
#
# Executable
#
include $(CLEAR_VARS)
LOCAL_MODULE := installd
LOCAL_MODULE_TAGS := optional
LOCAL_CFLAGS := $(common_cflags)
LOCAL_SRC_FILES := installd.cpp $(common_src_files)
LOCAL_SHARED_LIBRARIES := \
libbase \
libcutils \
liblog \
liblogwrap \
libselinux \
LOCAL_STATIC_LIBRARIES := libdiskusage
LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk
LOCAL_INIT_RC := installd.rc
LOCAL_CLANG := true
include $(BUILD_EXECUTABLE)

View file

@ -0,0 +1,15 @@
// Build the unit tests for installd
cc_test {
name: "installd_utils_test",
clang: true,
srcs: ["installd_utils_test.cpp"],
shared_libs: [
"libbase",
"libutils",
"libcutils",
],
static_libs: [
"libinstalld",
"libdiskusage",
],
}

View file

@ -1,31 +0,0 @@
# Build the unit tests for installd
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
# Build the unit tests.
test_src_files := \
installd_utils_test.cpp
shared_libraries := \
libbase \
libutils \
libcutils \
static_libraries := \
libinstalld \
libdiskusage \
c_includes := \
frameworks/native/cmds/installd
$(foreach file,$(test_src_files), \
$(eval include $(CLEAR_VARS)) \
$(eval LOCAL_SHARED_LIBRARIES := $(shared_libraries)) \
$(eval LOCAL_STATIC_LIBRARIES := $(static_libraries)) \
$(eval LOCAL_SRC_FILES := $(file)) \
$(eval LOCAL_C_INCLUDES := $(c_includes)) \
$(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \
$(eval LOCAL_CLANG := true) \
$(eval include $(BUILD_NATIVE_TEST)) \
)

13
cmds/service/Android.bp Normal file
View file

@ -0,0 +1,13 @@
cc_binary {
name: "service",
srcs: ["service.cpp"],
shared_libs: [
"libutils",
"libbinder",
],
cflags: ["-DXP_UNIX"],
//shared_libs: ["librt"],
}

View file

@ -1,16 +0,0 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
service.cpp
LOCAL_SHARED_LIBRARIES := libutils libbinder
ifeq ($(TARGET_OS),linux)
LOCAL_CFLAGS += -DXP_UNIX
#LOCAL_SHARED_LIBRARIES += librt
endif
LOCAL_MODULE:= service
include $(BUILD_EXECUTABLE)

View file

@ -0,0 +1,35 @@
cc_defaults {
name: "servicemanager_flags",
cflags: [
"-Wall",
"-Wextra",
],
product_variables: {
binder32bit: {
cflags: ["-DBINDER_IPC_32BIT=1"],
},
},
shared_libs: ["liblog"],
}
cc_binary {
name: "bctest",
defaults: ["servicemanager_flags"],
srcs: [
"bctest.c",
"binder.c",
],
}
cc_binary {
name: "servicemanager",
defaults: ["servicemanager_flags"],
srcs: [
"service_manager.c",
"binder.c",
],
shared_libs: ["libselinux"],
init_rc: ["servicemanager.rc"],
}

View file

@ -1,26 +0,0 @@
LOCAL_PATH:= $(call my-dir)
svc_c_flags = \
-Wall -Wextra \
ifneq ($(TARGET_USES_64_BIT_BINDER),true)
ifneq ($(TARGET_IS_64_BIT),true)
svc_c_flags += -DBINDER_IPC_32BIT=1
endif
endif
include $(CLEAR_VARS)
LOCAL_SHARED_LIBRARIES := liblog
LOCAL_SRC_FILES := bctest.c binder.c
LOCAL_CFLAGS += $(svc_c_flags)
LOCAL_MODULE := bctest
LOCAL_MODULE_TAGS := optional
include $(BUILD_EXECUTABLE)
include $(CLEAR_VARS)
LOCAL_SHARED_LIBRARIES := liblog libselinux
LOCAL_SRC_FILES := service_manager.c binder.c
LOCAL_CFLAGS += $(svc_c_flags)
LOCAL_MODULE := servicemanager
LOCAL_INIT_RC := servicemanager.rc
include $(BUILD_EXECUTABLE)

74
libs/binder/Android.bp Normal file
View file

@ -0,0 +1,74 @@
// Copyright (C) 2009 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 {
name: "libbinder",
srcs: [
"AppOpsManager.cpp",
"Binder.cpp",
"BpBinder.cpp",
"BufferedTextOutput.cpp",
"Debug.cpp",
"IAppOpsCallback.cpp",
"IAppOpsService.cpp",
"IBatteryStats.cpp",
"IInterface.cpp",
"IMemory.cpp",
"IPCThreadState.cpp",
"IPermissionController.cpp",
"IProcessInfoService.cpp",
"IServiceManager.cpp",
"MemoryBase.cpp",
"MemoryDealer.cpp",
"MemoryHeapBase.cpp",
"Parcel.cpp",
"PermissionCache.cpp",
"PersistableBundle.cpp",
"ProcessInfoService.cpp",
"ProcessState.cpp",
"Static.cpp",
"Status.cpp",
"TextOutput.cpp",
],
cflags: [
"-Wall",
"-Wextra",
"-Werror",
],
product_variables: {
binder32bit: {
cflags: ["-DBINDER_IPC_32BIT=1"],
},
},
shared_libs: [
"libbase",
"liblog",
"libcutils",
"libutils",
],
export_shared_lib_headers: [
"libbase",
"libutils",
],
clang: true,
sanitize: {
misc_undefined: ["integer"],
},
}
subdirs = ["tests"]

View file

@ -1,68 +0,0 @@
# Copyright (C) 2009 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.
# we have the common sources, plus some device-specific stuff
sources := \
AppOpsManager.cpp \
Binder.cpp \
BpBinder.cpp \
BufferedTextOutput.cpp \
Debug.cpp \
IAppOpsCallback.cpp \
IAppOpsService.cpp \
IBatteryStats.cpp \
IInterface.cpp \
IMemory.cpp \
IPCThreadState.cpp \
IPermissionController.cpp \
IProcessInfoService.cpp \
IServiceManager.cpp \
MemoryBase.cpp \
MemoryDealer.cpp \
MemoryHeapBase.cpp \
Parcel.cpp \
PermissionCache.cpp \
PersistableBundle.cpp \
ProcessInfoService.cpp \
ProcessState.cpp \
Static.cpp \
Status.cpp \
TextOutput.cpp \
LOCAL_PATH:= $(call my-dir)
binder_cflags := -Wall -Wextra -Werror
ifneq ($(TARGET_USES_64_BIT_BINDER),true)
ifneq ($(TARGET_IS_64_BIT),true)
binder_cflags += -DBINDER_IPC_32BIT=1
endif
endif
include $(CLEAR_VARS)
LOCAL_MODULE := libbinder
LOCAL_SHARED_LIBRARIES := libbase liblog libcutils libutils
LOCAL_EXPORT_SHARED_LIBRARY_HEADERS := libbase libutils
LOCAL_SANITIZE := integer
LOCAL_SRC_FILES := $(sources)
LOCAL_CFLAGS := $(binder_cflags)
include $(BUILD_SHARED_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libbinder
LOCAL_STATIC_LIBRARIES := libbase libutils
LOCAL_EXPORT_STATIC_LIBRARY_HEADERS := libbase libutils
LOCAL_SRC_FILES := $(sources)
LOCAL_CFLAGS := $(binder_cflags)
include $(BUILD_STATIC_LIBRARY)

View file

@ -0,0 +1,54 @@
//
// Copyright (C) 2014 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 {
product_variables: {
binder32bit: {
cflags: ["-DBINDER_IPC_32BIT=1"],
},
},
name: "binderDriverInterfaceTest",
srcs: ["binderDriverInterfaceTest.cpp"],
}
cc_test {
name: "binderLibTest",
srcs: ["binderLibTest.cpp"],
shared_libs: [
"libbinder",
"libutils",
],
}
cc_test {
name: "binderThroughputTest",
srcs: ["binderThroughputTest.cpp"],
shared_libs: [
"libbinder",
"libutils",
],
clang: true,
cflags: [
"-g",
"-Wall",
"-Werror",
"-std=c++11",
"-Wno-missing-field-initializers",
"-Wno-sign-compare",
"-O3",
],
}

View file

@ -1,42 +0,0 @@
#
# Copyright (C) 2014 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)
ifneq ($(TARGET_USES_64_BIT_BINDER),true)
ifneq ($(TARGET_IS_64_BIT),true)
LOCAL_CFLAGS += -DBINDER_IPC_32BIT=1
endif
endif
LOCAL_MODULE := binderDriverInterfaceTest
LOCAL_SRC_FILES := binderDriverInterfaceTest.cpp
include $(BUILD_NATIVE_TEST)
include $(CLEAR_VARS)
LOCAL_MODULE := binderLibTest
LOCAL_SRC_FILES := binderLibTest.cpp
LOCAL_SHARED_LIBRARIES := libbinder libutils
include $(BUILD_NATIVE_TEST)
include $(CLEAR_VARS)
LOCAL_MODULE := binderThroughputTest
LOCAL_SRC_FILES := binderThroughputTest.cpp
LOCAL_SHARED_LIBRARIES := libbinder libutils
LOCAL_CLANG := true
LOCAL_CFLAGS += -g -Wall -Werror -std=c++11 -Wno-missing-field-initializers -Wno-sign-compare -O3
include $(BUILD_NATIVE_TEST)

View file

@ -20,7 +20,7 @@
#include <stdlib.h>
#include <gtest/gtest.h>
#include <linux/binder.h>
#include <linux/android/binder.h>
#include <binder/IBinder.h>
#include <sys/mman.h>
#include <poll.h>

18
libs/diskusage/Android.bp Normal file
View file

@ -0,0 +1,18 @@
// Copyright (C) 2010 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_static {
name: "libdiskusage",
srcs: ["dirsize.c"],
}

View file

@ -1,24 +0,0 @@
# Copyright (C) 2010 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_MODULE := libdiskusage
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := dirsize.c
include $(BUILD_STATIC_LIBRARY)

60
libs/input/Android.bp Normal file
View file

@ -0,0 +1,60 @@
// 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.
// libinput is partially built for the host (used by build time keymap validation tool)
cc_library {
name: "libinput",
host_supported: true,
srcs: [
"Input.cpp",
"InputDevice.cpp",
"Keyboard.cpp",
"KeyCharacterMap.cpp",
"KeyLayoutMap.cpp",
"VirtualKeyMap.cpp",
],
clang: true,
sanitize: {
misc_undefined: ["integer"],
},
shared_libs: [
"liblog",
"libcutils",
],
target: {
android: {
srcs: [
"IInputFlinger.cpp",
"InputTransport.cpp",
"VelocityControl.cpp",
"VelocityTracker.cpp",
],
shared_libs: [
"libutils",
"libbinder",
],
},
host: {
shared: {
enabled: false,
},
},
},
}

View file

@ -14,64 +14,6 @@
LOCAL_PATH:= $(call my-dir)
# libinput is partially built for the host (used by build time keymap validation tool)
# These files are common to host and target builds.
commonSources := \
Input.cpp \
InputDevice.cpp \
Keyboard.cpp \
KeyCharacterMap.cpp \
KeyLayoutMap.cpp \
VirtualKeyMap.cpp
deviceSources := \
$(commonSources) \
IInputFlinger.cpp \
InputTransport.cpp \
VelocityControl.cpp \
VelocityTracker.cpp
hostSources := \
$(commonSources)
# For the host
# =====================================================
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= $(hostSources)
LOCAL_MODULE:= libinput
LOCAL_MODULE_TAGS := optional
include $(BUILD_HOST_STATIC_LIBRARY)
# For the device
# =====================================================
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= $(deviceSources)
LOCAL_CLANG := true
LOCAL_SANITIZE := integer
LOCAL_SHARED_LIBRARIES := \
liblog \
libcutils \
libutils \
libbinder
LOCAL_MODULE:= libinput
LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)
# Include subdirectory makefiles
# ============================================================

22
opengl/libs/Android.bp Normal file
View file

@ -0,0 +1,22 @@
// Build the ETC1 library
cc_library {
name: "libETC1",
srcs: ["ETC1/etc1.cpp"],
host_supported: true,
target: {
android: {
static: {
enabled: false,
},
},
host: {
shared: {
enabled: false,
},
},
windows: {
enabled: true,
},
},
}

View file

@ -149,33 +149,4 @@ LOCAL_LDFLAGS_arm += -Wl,--hash-style,both
include $(BUILD_SHARED_LIBRARY)
###############################################################################
# Build the ETC1 host static library
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
ETC1/etc1.cpp \
#
LOCAL_MODULE:= libETC1
LOCAL_MODULE_HOST_OS := darwin linux windows
include $(BUILD_HOST_STATIC_LIBRARY)
###############################################################################
# Build the ETC1 device library
#
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
ETC1/etc1.cpp \
#
LOCAL_MODULE:= libETC1
include $(BUILD_SHARED_LIBRARY)
include $(call all-makefiles-under,$(LOCAL_PATH))

View file

@ -0,0 +1,22 @@
cc_library_static {
name: "libbatteryservice",
srcs: [
"BatteryProperties.cpp",
"BatteryProperty.cpp",
"IBatteryPropertiesListener.cpp",
"IBatteryPropertiesRegistrar.cpp",
],
static_libs: [
"libutils",
"libbinder",
],
cflags: [
"-Wall",
"-Werror",
"-Wunused",
"-Wunreachable-code",
],
}

View file

@ -1,20 +0,0 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
BatteryProperties.cpp \
BatteryProperty.cpp \
IBatteryPropertiesListener.cpp \
IBatteryPropertiesRegistrar.cpp
LOCAL_STATIC_LIBRARIES := \
libutils \
libbinder
LOCAL_MODULE:= libbatteryservice
LOCAL_MODULE_TAGS := optional
LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
include $(BUILD_STATIC_LIBRARY)

View file

@ -0,0 +1,17 @@
cc_library_shared {
name: "libpowermanager",
srcs: ["IPowerManager.cpp"],
shared_libs: [
"libutils",
"libbinder",
],
cflags: [
"-Wall",
"-Werror",
"-Wunused",
"-Wunreachable-code",
],
}

View file

@ -1,19 +0,0 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
IPowerManager.cpp
LOCAL_SHARED_LIBRARIES := \
libutils \
libbinder
LOCAL_MODULE:= libpowermanager
LOCAL_MODULE_TAGS := optional
LOCAL_CFLAGS += -Wall -Werror -Wunused -Wunreachable-code
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/../../include
include $(BUILD_SHARED_LIBRARY)