Move relocation_packer from Android.mk to Android.bp

Change-Id: I3d24f8513fe3ca19900705d4861ab797464e0930
This commit is contained in:
Colin Cross 2016-07-13 14:01:45 -07:00
parent 48cedda02a
commit d3b6bc7624
3 changed files with 85 additions and 57 deletions

1
tools/Android.bp Normal file
View File

@ -0,0 +1 @@
subdirs = ["*"]

View File

@ -0,0 +1,84 @@
//
// 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: "relocation_packer_flags",
cppflags: [
"-Wall",
"-Wextra",
"-Wunused",
"-Werror",
"-Wold-style-cast",
],
target: {
darwin: {
enabled: false,
},
},
}
cc_library_host_static {
name: "lib_relocation_packer",
defaults: ["relocation_packer_flags"],
srcs: [
"src/debug.cc",
"src/delta_encoder.cc",
"src/elf_file.cc",
"src/packer.cc",
"src/sleb128.cc",
],
static_libs: [
"libelf",
"libz",
],
}
cc_binary_host {
name: "relocation_packer",
defaults: ["relocation_packer_flags"],
srcs: ["src/main.cc"],
static_libs: [
"lib_relocation_packer",
"libelf",
"libz",
"libbase",
],
// Statically linking libc++ to make it work from prebuilts
stl: "libc++_static",
}
cc_test_host {
name: "relocation_packer_unit_tests",
defaults: ["relocation_packer_flags"],
srcs: [
"src/debug_unittest.cc",
"src/delta_encoder_unittest.cc",
"src/elf_file_unittest.cc",
"src/sleb128_unittest.cc",
"src/packer_unittest.cc",
],
static_libs: [
"lib_relocation_packer",
"libelf",
"libz",
],
}

View File

@ -15,63 +15,6 @@
#
ifeq ($(HOST_OS),linux)
common_cppflags := -Wall -Wextra -Wunused -Werror -Wold-style-cast
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_CPP_EXTENSION := .cc
LOCAL_SRC_FILES := \
src/debug.cc \
src/delta_encoder.cc \
src/elf_file.cc \
src/packer.cc \
src/sleb128.cc \
LOCAL_STATIC_LIBRARIES := libelf libz
LOCAL_MODULE := lib_relocation_packer
LOCAL_CPPFLAGS := $(common_cppflags)
include $(BUILD_HOST_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_CPP_EXTENSION := .cc
LOCAL_SRC_FILES := src/main.cc
LOCAL_STATIC_LIBRARIES := lib_relocation_packer libelf libz libbase
# Statically linking libc++ to make it work from prebuilts
LOCAL_CXX_STL := libc++_static
LOCAL_MODULE := relocation_packer
LOCAL_CPPFLAGS := $(common_cppflags)
include $(BUILD_HOST_EXECUTABLE)
include $(CLEAR_VARS)
LOCAL_CPP_EXTENSION := .cc
LOCAL_SRC_FILES := \
src/debug_unittest.cc \
src/delta_encoder_unittest.cc \
src/elf_file_unittest.cc \
src/sleb128_unittest.cc \
src/packer_unittest.cc \
LOCAL_STATIC_LIBRARIES := lib_relocation_packer libelf libz
LOCAL_CPPFLAGS := $(common_cppflags)
LOCAL_MODULE := relocation_packer_unit_tests
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
include $(BUILD_HOST_NATIVE_TEST)
# $(1) library name
define copy-test-library