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