Colin Cross | ced0308 | 2016-12-15 20:44:30 +0000 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2014 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 | LOCAL_PATH:= $(call my-dir) |
| 18 | |
| 19 | libbacktrace_common_cflags := \ |
| 20 | -Wall \ |
| 21 | -Werror \ |
| 22 | |
| 23 | libbacktrace_common_c_includes := \ |
| 24 | external/libunwind/include/tdep \ |
| 25 | |
| 26 | # The latest clang (r230699) does not allow SP/PC to be declared in inline asm lists. |
| 27 | libbacktrace_common_clang_cflags += \ |
| 28 | -Wno-inline-asm |
| 29 | |
| 30 | build_host := false |
| 31 | ifeq ($(HOST_OS),linux) |
| 32 | ifeq ($(HOST_ARCH),$(filter $(HOST_ARCH),x86 x86_64)) |
| 33 | build_host := true |
| 34 | endif |
| 35 | endif |
| 36 | |
| 37 | LLVM_ROOT_PATH := external/llvm |
| 38 | include $(LLVM_ROOT_PATH)/llvm.mk |
| 39 | |
| 40 | #------------------------------------------------------------------------- |
| 41 | # The libbacktrace_offline static library. |
| 42 | #------------------------------------------------------------------------- |
| 43 | libbacktrace_offline_src_files := \ |
| 44 | BacktraceOffline.cpp \ |
| 45 | |
| 46 | # Use shared libraries so their headers get included during build. |
| 47 | libbacktrace_offline_shared_libraries := \ |
| 48 | libbase \ |
| 49 | libunwind \ |
| 50 | |
| 51 | module := libbacktrace_offline |
| 52 | build_type := target |
| 53 | build_target := STATIC_LIBRARY |
| 54 | libbacktrace_offline_multilib := both |
| 55 | include $(LOCAL_PATH)/Android.build.mk |
| 56 | build_type := host |
| 57 | include $(LOCAL_PATH)/Android.build.mk |
| 58 | |
| 59 | #------------------------------------------------------------------------- |
| 60 | # The backtrace_test executable. |
| 61 | #------------------------------------------------------------------------- |
| 62 | backtrace_test_cflags := \ |
| 63 | -fno-builtin \ |
| 64 | -O0 \ |
| 65 | -g \ |
| 66 | |
| 67 | backtrace_test_cflags_target := \ |
| 68 | -DENABLE_PSS_TESTS \ |
| 69 | |
| 70 | backtrace_test_src_files := \ |
| 71 | backtrace_offline_test.cpp \ |
| 72 | backtrace_test.cpp \ |
| 73 | GetPss.cpp \ |
| 74 | thread_utils.c \ |
| 75 | |
| 76 | backtrace_test_ldlibs_host := \ |
| 77 | -lpthread \ |
| 78 | -lrt \ |
| 79 | |
| 80 | backtrace_test_shared_libraries := \ |
| 81 | libbacktrace_test \ |
| 82 | libbacktrace \ |
| 83 | libbase \ |
| 84 | libcutils \ |
| 85 | liblog \ |
| 86 | libunwind \ |
| 87 | |
| 88 | backtrace_test_shared_libraries_target += \ |
| 89 | libdl \ |
| 90 | libutils \ |
| 91 | |
| 92 | # Statically link LLVMlibraries to remove dependency on llvm shared library. |
| 93 | backtrace_test_static_libraries := \ |
| 94 | libbacktrace_offline \ |
| 95 | libLLVMObject \ |
| 96 | libLLVMBitReader \ |
| 97 | libLLVMMC \ |
| 98 | libLLVMMCParser \ |
| 99 | libLLVMCore \ |
| 100 | libLLVMSupport \ |
| 101 | |
| 102 | backtrace_test_static_libraries_target := \ |
| 103 | libziparchive \ |
| 104 | libz \ |
| 105 | |
| 106 | backtrace_test_static_libraries_host := \ |
| 107 | libziparchive \ |
| 108 | libz \ |
| 109 | libutils \ |
| 110 | |
| 111 | backtrace_test_ldlibs_host += \ |
| 112 | -ldl \ |
| 113 | |
| 114 | module := backtrace_test |
| 115 | module_tag := debug |
| 116 | build_type := target |
| 117 | build_target := NATIVE_TEST |
| 118 | backtrace_test_multilib := both |
| 119 | include $(LOCAL_PATH)/Android.build.mk |
| 120 | build_type := host |
| 121 | include $(LOCAL_PATH)/Android.build.mk |