Dmitriy Ivanov | f8ff6b1 | 2015-01-27 19:32:56 -0800 | [diff] [blame] | 1 | # |
| 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 | |
| 17 | common_cppflags := -Wall -Wextra -Wunused -Werror -Wold-style-cast |
| 18 | |
| 19 | LOCAL_PATH := $(call my-dir) |
| 20 | |
| 21 | include $(CLEAR_VARS) |
| 22 | |
| 23 | LOCAL_CPP_EXTENSION := .cc |
| 24 | |
| 25 | LOCAL_SRC_FILES := \ |
| 26 | src/debug.cc \ |
| 27 | src/delta_encoder.cc \ |
| 28 | src/elf_file.cc \ |
Dmitriy Ivanov | f8ff6b1 | 2015-01-27 19:32:56 -0800 | [diff] [blame] | 29 | src/packer.cc \ |
| 30 | src/sleb128.cc \ |
| 31 | |
| 32 | LOCAL_STATIC_LIBRARIES := libelf |
| 33 | LOCAL_C_INCLUDES := external/elfutils/src/libelf |
| 34 | LOCAL_MODULE := lib_relocation_packer |
| 35 | |
| 36 | LOCAL_CPPFLAGS := $(common_cppflags) |
| 37 | |
| 38 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 39 | |
| 40 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 41 | |
| 42 | include $(CLEAR_VARS) |
| 43 | |
| 44 | LOCAL_CPP_EXTENSION := .cc |
| 45 | |
| 46 | LOCAL_SRC_FILES := src/main.cc |
| 47 | LOCAL_STATIC_LIBRARIES := lib_relocation_packer libelf |
Dmitriy Ivanov | 2a63421 | 2015-04-22 10:43:12 -0700 | [diff] [blame] | 48 | |
| 49 | # Statically linking libc++ to make it work from prebuilts |
| 50 | LOCAL_CXX_STL := libc++_static |
Dmitriy Ivanov | f8ff6b1 | 2015-01-27 19:32:56 -0800 | [diff] [blame] | 51 | LOCAL_C_INCLUDES := external/elfutils/src/libelf libnativehelper/include |
| 52 | |
| 53 | LOCAL_MODULE := relocation_packer |
| 54 | |
| 55 | LOCAL_CPPFLAGS := $(common_cppflags) |
| 56 | |
| 57 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 58 | |
| 59 | include $(BUILD_HOST_EXECUTABLE) |
| 60 | |
| 61 | include $(CLEAR_VARS) |
| 62 | |
| 63 | LOCAL_CPP_EXTENSION := .cc |
| 64 | |
| 65 | LOCAL_SRC_FILES := \ |
| 66 | src/debug_unittest.cc \ |
| 67 | src/delta_encoder_unittest.cc \ |
| 68 | src/elf_file_unittest.cc \ |
Dmitriy Ivanov | f8ff6b1 | 2015-01-27 19:32:56 -0800 | [diff] [blame] | 69 | src/sleb128_unittest.cc \ |
| 70 | src/packer_unittest.cc \ |
| 71 | |
| 72 | LOCAL_STATIC_LIBRARIES := lib_relocation_packer libelf |
| 73 | LOCAL_C_INCLUDES := external/elfutils/src/libelf |
| 74 | |
| 75 | LOCAL_CPPFLAGS := $(common_cppflags) |
| 76 | |
| 77 | LOCAL_MODULE := relocation_packer_unit_tests |
| 78 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 79 | |
| 80 | include $(BUILD_HOST_NATIVE_TEST) |
| 81 | |
| 82 | # $(1) library name |
| 83 | define copy-test-library |
| 84 | include $(CLEAR_VARS) |
| 85 | LOCAL_IS_HOST_MODULE := true |
| 86 | LOCAL_MODULE := $(1) |
| 87 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 88 | LOCAL_MODULE_PATH := $(HOST_OUT_EXECUTABLES) |
| 89 | LOCAL_STRIP_MODULE := false |
| 90 | LOCAL_SRC_FILES := test_data/$(1) |
| 91 | include $(BUILD_PREBUILT) |
| 92 | endef |
| 93 | |
| 94 | $(eval $(call copy-test-library,elf_file_unittest_relocs_arm32.so)) |
| 95 | $(eval $(call copy-test-library,elf_file_unittest_relocs_arm32_packed.so)) |
| 96 | $(eval $(call copy-test-library,elf_file_unittest_relocs_arm64.so)) |
| 97 | $(eval $(call copy-test-library,elf_file_unittest_relocs_arm64_packed.so)) |