blob: eabe0daa360b51b22a680b65b95e1e2abeb2b6ed [file] [log] [blame]
Dmitriy Ivanovf8ff6b12015-01-27 19:32:56 -08001#
2# Copyright (C) 2015 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17common_cppflags := -Wall -Wextra -Wunused -Werror -Wold-style-cast
18
19LOCAL_PATH := $(call my-dir)
20
21include $(CLEAR_VARS)
22
23LOCAL_CPP_EXTENSION := .cc
24
25LOCAL_SRC_FILES := \
26 src/debug.cc \
27 src/delta_encoder.cc \
28 src/elf_file.cc \
29 src/leb128.cc \
30 src/packer.cc \
31 src/sleb128.cc \
32
33LOCAL_STATIC_LIBRARIES := libelf
34LOCAL_C_INCLUDES := external/elfutils/src/libelf
35LOCAL_MODULE := lib_relocation_packer
36
37LOCAL_CPPFLAGS := $(common_cppflags)
38
39LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
40
41include $(BUILD_HOST_STATIC_LIBRARY)
42
43include $(CLEAR_VARS)
44
45LOCAL_CPP_EXTENSION := .cc
46
47LOCAL_SRC_FILES := src/main.cc
48LOCAL_STATIC_LIBRARIES := lib_relocation_packer libelf
Dmitriy Ivanov2a634212015-04-22 10:43:12 -070049
50# Statically linking libc++ to make it work from prebuilts
51LOCAL_CXX_STL := libc++_static
Dmitriy Ivanovf8ff6b12015-01-27 19:32:56 -080052LOCAL_C_INCLUDES := external/elfutils/src/libelf libnativehelper/include
53
54LOCAL_MODULE := relocation_packer
55
56LOCAL_CPPFLAGS := $(common_cppflags)
57
58LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
59
60include $(BUILD_HOST_EXECUTABLE)
61
62include $(CLEAR_VARS)
63
64LOCAL_CPP_EXTENSION := .cc
65
66LOCAL_SRC_FILES := \
67 src/debug_unittest.cc \
68 src/delta_encoder_unittest.cc \
69 src/elf_file_unittest.cc \
70 src/leb128_unittest.cc \
71 src/sleb128_unittest.cc \
72 src/packer_unittest.cc \
73
74LOCAL_STATIC_LIBRARIES := lib_relocation_packer libelf
75LOCAL_C_INCLUDES := external/elfutils/src/libelf
76
77LOCAL_CPPFLAGS := $(common_cppflags)
78
79LOCAL_MODULE := relocation_packer_unit_tests
80LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
81
82include $(BUILD_HOST_NATIVE_TEST)
83
84# $(1) library name
85define copy-test-library
86include $(CLEAR_VARS)
87LOCAL_IS_HOST_MODULE := true
88LOCAL_MODULE := $(1)
89LOCAL_MODULE_CLASS := SHARED_LIBRARIES
90LOCAL_MODULE_PATH := $(HOST_OUT_EXECUTABLES)
91LOCAL_STRIP_MODULE := false
92LOCAL_SRC_FILES := test_data/$(1)
93include $(BUILD_PREBUILT)
94endef
95
96$(eval $(call copy-test-library,elf_file_unittest_relocs_arm32.so))
97$(eval $(call copy-test-library,elf_file_unittest_relocs_arm32_packed.so))
98$(eval $(call copy-test-library,elf_file_unittest_relocs_arm64.so))
99$(eval $(call copy-test-library,elf_file_unittest_relocs_arm64_packed.so))