Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [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 | # |
Christopher Ferris | 7fb2287 | 2013-09-27 12:43:15 -0700 | [diff] [blame] | 16 | |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 17 | LOCAL_PATH:= $(call my-dir) |
Christopher Ferris | 17e91d4 | 2013-10-21 13:30:52 -0700 | [diff] [blame] | 18 | |
Christopher Ferris | 2c43cff | 2015-03-26 19:18:36 -0700 | [diff] [blame] | 19 | libbacktrace_common_cflags := \ |
Christopher Ferris | 17e91d4 | 2013-10-21 13:30:52 -0700 | [diff] [blame] | 20 | -Wall \ |
Christopher Ferris | 17e91d4 | 2013-10-21 13:30:52 -0700 | [diff] [blame] | 21 | -Werror \ |
| 22 | |
Dan Willemsen | ee2da03 | 2016-05-25 13:19:49 -0700 | [diff] [blame] | 23 | libbacktrace_common_c_includes := \ |
| 24 | external/libunwind/include/tdep \ |
Christopher Ferris | 17e91d4 | 2013-10-21 13:30:52 -0700 | [diff] [blame] | 25 | |
Stephen Hines | 035e9ba | 2015-03-31 09:39:20 -0700 | [diff] [blame] | 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 | |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 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 | |
Yabin Cui | 9e402bb | 2015-09-22 04:46:57 +0000 | [diff] [blame] | 37 | LLVM_ROOT_PATH := external/llvm |
| 38 | include $(LLVM_ROOT_PATH)/llvm.mk |
| 39 | |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 40 | #------------------------------------------------------------------------- |
Christopher Ferris | 8540216 | 2016-01-25 16:17:48 -0800 | [diff] [blame] | 41 | # The libbacktrace_offline shared library. |
| 42 | #------------------------------------------------------------------------- |
| 43 | libbacktrace_offline_src_files := \ |
| 44 | BacktraceOffline.cpp \ |
| 45 | |
Yabin Cui | b791a76 | 2016-03-18 18:46:08 -0700 | [diff] [blame] | 46 | # Use shared llvm library on device to save space. |
Yabin Cui | 51e6070 | 2016-04-13 21:21:47 -0700 | [diff] [blame] | 47 | libbacktrace_offline_shared_libraries_target := \ |
Christopher Ferris | 8540216 | 2016-01-25 16:17:48 -0800 | [diff] [blame] | 48 | libbacktrace \ |
Yabin Cui | b791a76 | 2016-03-18 18:46:08 -0700 | [diff] [blame] | 49 | libbase \ |
Christopher Ferris | 8540216 | 2016-01-25 16:17:48 -0800 | [diff] [blame] | 50 | liblog \ |
| 51 | libunwind \ |
Yabin Cui | b791a76 | 2016-03-18 18:46:08 -0700 | [diff] [blame] | 52 | libutils \ |
Christopher Ferris | 8540216 | 2016-01-25 16:17:48 -0800 | [diff] [blame] | 53 | libLLVM \ |
| 54 | |
Yabin Cui | 51e6070 | 2016-04-13 21:21:47 -0700 | [diff] [blame] | 55 | libbacktrace_offline_static_libraries_target := \ |
Yabin Cui | b791a76 | 2016-03-18 18:46:08 -0700 | [diff] [blame] | 56 | libziparchive \ |
| 57 | libz \ |
| 58 | |
Christopher Ferris | 8540216 | 2016-01-25 16:17:48 -0800 | [diff] [blame] | 59 | # Use static llvm libraries on host to remove dependency on 32-bit llvm shared library |
| 60 | # which is not included in the prebuilt. |
Yabin Cui | 51e6070 | 2016-04-13 21:21:47 -0700 | [diff] [blame] | 61 | libbacktrace_offline_static_libraries_host := \ |
Yabin Cui | 9946a8f | 2016-02-10 13:46:06 -0800 | [diff] [blame] | 62 | libbacktrace \ |
Yabin Cui | 9946a8f | 2016-02-10 13:46:06 -0800 | [diff] [blame] | 63 | libunwind \ |
Colin Cross | 99f6b86 | 2016-08-26 11:12:38 -0700 | [diff] [blame] | 64 | libziparchive \ |
Yabin Cui | b791a76 | 2016-03-18 18:46:08 -0700 | [diff] [blame] | 65 | libz \ |
Yabin Cui | 51e6070 | 2016-04-13 21:21:47 -0700 | [diff] [blame] | 66 | libbase \ |
| 67 | liblog \ |
| 68 | libutils \ |
Yabin Cui | 9946a8f | 2016-02-10 13:46:06 -0800 | [diff] [blame] | 69 | libLLVMObject \ |
| 70 | libLLVMBitReader \ |
| 71 | libLLVMMC \ |
| 72 | libLLVMMCParser \ |
| 73 | libLLVMCore \ |
| 74 | libLLVMSupport \ |
| 75 | |
| 76 | module := libbacktrace_offline |
| 77 | build_type := target |
| 78 | build_target := STATIC_LIBRARY |
Yabin Cui | 51e6070 | 2016-04-13 21:21:47 -0700 | [diff] [blame] | 79 | libbacktrace_offline_multilib := both |
| 80 | include $(LOCAL_PATH)/Android.build.mk |
| 81 | build_type := host |
Yabin Cui | 9946a8f | 2016-02-10 13:46:06 -0800 | [diff] [blame] | 82 | include $(LOCAL_PATH)/Android.build.mk |
| 83 | |
Christopher Ferris | 8540216 | 2016-01-25 16:17:48 -0800 | [diff] [blame] | 84 | #------------------------------------------------------------------------- |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 85 | # The backtrace_test executable. |
| 86 | #------------------------------------------------------------------------- |
| 87 | backtrace_test_cflags := \ |
Christopher Ferris | 17e91d4 | 2013-10-21 13:30:52 -0700 | [diff] [blame] | 88 | -fno-builtin \ |
Christopher Ferris | 17e91d4 | 2013-10-21 13:30:52 -0700 | [diff] [blame] | 89 | -O0 \ |
| 90 | -g \ |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 91 | |
| 92 | backtrace_test_cflags_target := \ |
Christopher Ferris | e296091 | 2014-03-07 19:42:19 -0800 | [diff] [blame] | 93 | -DENABLE_PSS_TESTS \ |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 94 | |
| 95 | backtrace_test_src_files := \ |
Yabin Cui | 9e402bb | 2015-09-22 04:46:57 +0000 | [diff] [blame] | 96 | backtrace_offline_test.cpp \ |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 97 | backtrace_test.cpp \ |
Christopher Ferris | e296091 | 2014-03-07 19:42:19 -0800 | [diff] [blame] | 98 | GetPss.cpp \ |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 99 | thread_utils.c \ |
| 100 | |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 101 | backtrace_test_ldlibs_host := \ |
Ying Wang | 9f437d7 | 2014-05-07 15:36:05 -0700 | [diff] [blame] | 102 | -lpthread \ |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 103 | -lrt \ |
| 104 | |
| 105 | backtrace_test_shared_libraries := \ |
Christopher Ferris | 7fb2287 | 2013-09-27 12:43:15 -0700 | [diff] [blame] | 106 | libbacktrace_test \ |
| 107 | libbacktrace \ |
Christopher Ferris | 67aba68 | 2015-05-08 15:44:46 -0700 | [diff] [blame] | 108 | libbase \ |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 109 | libcutils \ |
Yabin Cui | 51e6070 | 2016-04-13 21:21:47 -0700 | [diff] [blame] | 110 | liblog \ |
Yabin Cui | 9e402bb | 2015-09-22 04:46:57 +0000 | [diff] [blame] | 111 | libunwind \ |
Christopher Ferris | 17e91d4 | 2013-10-21 13:30:52 -0700 | [diff] [blame] | 112 | |
Christopher Ferris | 67aba68 | 2015-05-08 15:44:46 -0700 | [diff] [blame] | 113 | backtrace_test_shared_libraries_target += \ |
| 114 | libdl \ |
Yabin Cui | 51e6070 | 2016-04-13 21:21:47 -0700 | [diff] [blame] | 115 | libutils \ |
| 116 | libLLVM \ |
| 117 | |
| 118 | backtrace_test_static_libraries := \ |
| 119 | libbacktrace_offline \ |
| 120 | |
| 121 | backtrace_test_static_libraries_target := \ |
| 122 | libziparchive \ |
| 123 | libz \ |
| 124 | |
| 125 | backtrace_test_static_libraries_host := \ |
Colin Cross | 99f6b86 | 2016-08-26 11:12:38 -0700 | [diff] [blame] | 126 | libziparchive \ |
Yabin Cui | 51e6070 | 2016-04-13 21:21:47 -0700 | [diff] [blame] | 127 | libz \ |
| 128 | libutils \ |
| 129 | libLLVMObject \ |
| 130 | libLLVMBitReader \ |
| 131 | libLLVMMC \ |
| 132 | libLLVMMCParser \ |
| 133 | libLLVMCore \ |
| 134 | libLLVMSupport \ |
Christopher Ferris | 67aba68 | 2015-05-08 15:44:46 -0700 | [diff] [blame] | 135 | |
| 136 | backtrace_test_ldlibs_host += \ |
| 137 | -ldl \ |
Christopher Ferris | a2efd3a | 2014-05-06 15:23:59 -0700 | [diff] [blame] | 138 | |
Yabin Cui | 9e402bb | 2015-09-22 04:46:57 +0000 | [diff] [blame] | 139 | backtrace_test_strip_module := false |
| 140 | |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 141 | module := backtrace_test |
| 142 | module_tag := debug |
| 143 | build_type := target |
| 144 | build_target := NATIVE_TEST |
Christopher Ferris | 2c43cff | 2015-03-26 19:18:36 -0700 | [diff] [blame] | 145 | backtrace_test_multilib := both |
Christopher Ferris | 04b1e8c | 2014-01-30 01:13:33 -0800 | [diff] [blame] | 146 | include $(LOCAL_PATH)/Android.build.mk |
| 147 | build_type := host |
| 148 | include $(LOCAL_PATH)/Android.build.mk |