blob: bdb54b758df406cb6abf6d7e8075723db45cfba2 [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
Ying Wang4900f1c2015-06-06 11:55:16 -070017ifeq ($(HOST_OS),linux)
Dmitriy Ivanovf8ff6b12015-01-27 19:32:56 -080018common_cppflags := -Wall -Wextra -Wunused -Werror -Wold-style-cast
19
20LOCAL_PATH := $(call my-dir)
21
22include $(CLEAR_VARS)
23
24LOCAL_CPP_EXTENSION := .cc
25
26LOCAL_SRC_FILES := \
27 src/debug.cc \
28 src/delta_encoder.cc \
29 src/elf_file.cc \
Dmitriy Ivanovf8ff6b12015-01-27 19:32:56 -080030 src/packer.cc \
31 src/sleb128.cc \
32
Chih-Hung Hsieh20322c22016-01-25 10:28:26 -080033LOCAL_STATIC_LIBRARIES := libelf libz
Dmitriy Ivanovf8ff6b12015-01-27 19:32:56 -080034LOCAL_MODULE := lib_relocation_packer
35
36LOCAL_CPPFLAGS := $(common_cppflags)
37
Dmitriy Ivanovf8ff6b12015-01-27 19:32:56 -080038include $(BUILD_HOST_STATIC_LIBRARY)
39
40include $(CLEAR_VARS)
41
42LOCAL_CPP_EXTENSION := .cc
43
44LOCAL_SRC_FILES := src/main.cc
Elliott Hughes7de1ff22016-03-22 20:27:39 -070045LOCAL_STATIC_LIBRARIES := lib_relocation_packer libelf libz libbase
Dmitriy Ivanov2a634212015-04-22 10:43:12 -070046
47# Statically linking libc++ to make it work from prebuilts
48LOCAL_CXX_STL := libc++_static
Dmitriy Ivanovf8ff6b12015-01-27 19:32:56 -080049
50LOCAL_MODULE := relocation_packer
51
52LOCAL_CPPFLAGS := $(common_cppflags)
53
Dmitriy Ivanovf8ff6b12015-01-27 19:32:56 -080054include $(BUILD_HOST_EXECUTABLE)
55
56include $(CLEAR_VARS)
57
58LOCAL_CPP_EXTENSION := .cc
59
60LOCAL_SRC_FILES := \
61 src/debug_unittest.cc \
62 src/delta_encoder_unittest.cc \
63 src/elf_file_unittest.cc \
Dmitriy Ivanovf8ff6b12015-01-27 19:32:56 -080064 src/sleb128_unittest.cc \
65 src/packer_unittest.cc \
66
Chih-Hung Hsieh20322c22016-01-25 10:28:26 -080067LOCAL_STATIC_LIBRARIES := lib_relocation_packer libelf libz
Dmitriy Ivanovf8ff6b12015-01-27 19:32:56 -080068
69LOCAL_CPPFLAGS := $(common_cppflags)
70
71LOCAL_MODULE := relocation_packer_unit_tests
72LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
73
74include $(BUILD_HOST_NATIVE_TEST)
75
76# $(1) library name
77define copy-test-library
78include $(CLEAR_VARS)
79LOCAL_IS_HOST_MODULE := true
80LOCAL_MODULE := $(1)
81LOCAL_MODULE_CLASS := SHARED_LIBRARIES
82LOCAL_MODULE_PATH := $(HOST_OUT_EXECUTABLES)
83LOCAL_STRIP_MODULE := false
84LOCAL_SRC_FILES := test_data/$(1)
85include $(BUILD_PREBUILT)
86endef
87
88$(eval $(call copy-test-library,elf_file_unittest_relocs_arm32.so))
89$(eval $(call copy-test-library,elf_file_unittest_relocs_arm32_packed.so))
90$(eval $(call copy-test-library,elf_file_unittest_relocs_arm64.so))
91$(eval $(call copy-test-library,elf_file_unittest_relocs_arm64_packed.so))
Simon Baldwin1011e1a2015-05-22 15:17:29 +010092$(eval $(call copy-test-library,elf_file_unittest_relocs_ia32.so))
93$(eval $(call copy-test-library,elf_file_unittest_relocs_ia32_packed.so))
94$(eval $(call copy-test-library,elf_file_unittest_relocs_x64.so))
95$(eval $(call copy-test-library,elf_file_unittest_relocs_x64_packed.so))
96$(eval $(call copy-test-library,elf_file_unittest_relocs_mips32.so))
97$(eval $(call copy-test-library,elf_file_unittest_relocs_mips32_packed.so))
Ying Wang4900f1c2015-06-06 11:55:16 -070098
99endif