blob: bb17325876ff743dc1aad276224dcf96d3539aa9 [file] [log] [blame]
Christopher Ferris04b1e8c2014-01-30 01:13:33 -08001#
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 Ferris7fb22872013-09-27 12:43:15 -070016
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080017LOCAL_PATH:= $(call my-dir)
Christopher Ferris17e91d42013-10-21 13:30:52 -070018
Christopher Ferris2c43cff2015-03-26 19:18:36 -070019libbacktrace_common_cflags := \
Christopher Ferris17e91d42013-10-21 13:30:52 -070020 -Wall \
Christopher Ferris17e91d42013-10-21 13:30:52 -070021 -Werror \
22
Dan Willemsenee2da032016-05-25 13:19:49 -070023libbacktrace_common_c_includes := \
24 external/libunwind/include/tdep \
Christopher Ferris17e91d42013-10-21 13:30:52 -070025
Stephen Hines035e9ba2015-03-31 09:39:20 -070026# The latest clang (r230699) does not allow SP/PC to be declared in inline asm lists.
27libbacktrace_common_clang_cflags += \
28 -Wno-inline-asm
29
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080030build_host := false
31ifeq ($(HOST_OS),linux)
32ifeq ($(HOST_ARCH),$(filter $(HOST_ARCH),x86 x86_64))
33build_host := true
34endif
35endif
36
Yabin Cui9e402bb2015-09-22 04:46:57 +000037LLVM_ROOT_PATH := external/llvm
38include $(LLVM_ROOT_PATH)/llvm.mk
39
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080040#-------------------------------------------------------------------------
Christopher Ferris85402162016-01-25 16:17:48 -080041# The libbacktrace_offline shared library.
42#-------------------------------------------------------------------------
43libbacktrace_offline_src_files := \
44 BacktraceOffline.cpp \
45
Yabin Cuib791a762016-03-18 18:46:08 -070046# Use shared llvm library on device to save space.
Yabin Cui51e60702016-04-13 21:21:47 -070047libbacktrace_offline_shared_libraries_target := \
Christopher Ferris85402162016-01-25 16:17:48 -080048 libbacktrace \
Yabin Cuib791a762016-03-18 18:46:08 -070049 libbase \
Christopher Ferris85402162016-01-25 16:17:48 -080050 liblog \
51 libunwind \
Yabin Cuib791a762016-03-18 18:46:08 -070052 libutils \
Christopher Ferris85402162016-01-25 16:17:48 -080053 libLLVM \
54
Yabin Cui51e60702016-04-13 21:21:47 -070055libbacktrace_offline_static_libraries_target := \
Yabin Cuib791a762016-03-18 18:46:08 -070056 libziparchive \
57 libz \
58
Christopher Ferris85402162016-01-25 16:17:48 -080059# Use static llvm libraries on host to remove dependency on 32-bit llvm shared library
60# which is not included in the prebuilt.
Yabin Cui51e60702016-04-13 21:21:47 -070061libbacktrace_offline_static_libraries_host := \
Yabin Cui9946a8f2016-02-10 13:46:06 -080062 libbacktrace \
Yabin Cui9946a8f2016-02-10 13:46:06 -080063 libunwind \
Colin Cross99f6b862016-08-26 11:12:38 -070064 libziparchive \
Yabin Cuib791a762016-03-18 18:46:08 -070065 libz \
Yabin Cui51e60702016-04-13 21:21:47 -070066 libbase \
67 liblog \
68 libutils \
Yabin Cui9946a8f2016-02-10 13:46:06 -080069 libLLVMObject \
70 libLLVMBitReader \
71 libLLVMMC \
72 libLLVMMCParser \
73 libLLVMCore \
74 libLLVMSupport \
75
76module := libbacktrace_offline
77build_type := target
78build_target := STATIC_LIBRARY
Yabin Cui51e60702016-04-13 21:21:47 -070079libbacktrace_offline_multilib := both
80include $(LOCAL_PATH)/Android.build.mk
81build_type := host
Yabin Cui9946a8f2016-02-10 13:46:06 -080082include $(LOCAL_PATH)/Android.build.mk
83
Christopher Ferris85402162016-01-25 16:17:48 -080084#-------------------------------------------------------------------------
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080085# The backtrace_test executable.
86#-------------------------------------------------------------------------
87backtrace_test_cflags := \
Christopher Ferris17e91d42013-10-21 13:30:52 -070088 -fno-builtin \
Christopher Ferris17e91d42013-10-21 13:30:52 -070089 -O0 \
90 -g \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080091
92backtrace_test_cflags_target := \
Christopher Ferrise2960912014-03-07 19:42:19 -080093 -DENABLE_PSS_TESTS \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080094
95backtrace_test_src_files := \
Yabin Cui9e402bb2015-09-22 04:46:57 +000096 backtrace_offline_test.cpp \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080097 backtrace_test.cpp \
Christopher Ferrise2960912014-03-07 19:42:19 -080098 GetPss.cpp \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080099 thread_utils.c \
100
Christopher Ferris04b1e8c2014-01-30 01:13:33 -0800101backtrace_test_ldlibs_host := \
Ying Wang9f437d72014-05-07 15:36:05 -0700102 -lpthread \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -0800103 -lrt \
104
105backtrace_test_shared_libraries := \
Christopher Ferris7fb22872013-09-27 12:43:15 -0700106 libbacktrace_test \
107 libbacktrace \
Christopher Ferris67aba682015-05-08 15:44:46 -0700108 libbase \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -0800109 libcutils \
Yabin Cui51e60702016-04-13 21:21:47 -0700110 liblog \
Yabin Cui9e402bb2015-09-22 04:46:57 +0000111 libunwind \
Christopher Ferris17e91d42013-10-21 13:30:52 -0700112
Christopher Ferris67aba682015-05-08 15:44:46 -0700113backtrace_test_shared_libraries_target += \
114 libdl \
Yabin Cui51e60702016-04-13 21:21:47 -0700115 libutils \
116 libLLVM \
117
118backtrace_test_static_libraries := \
119 libbacktrace_offline \
120
121backtrace_test_static_libraries_target := \
122 libziparchive \
123 libz \
124
125backtrace_test_static_libraries_host := \
Colin Cross99f6b862016-08-26 11:12:38 -0700126 libziparchive \
Yabin Cui51e60702016-04-13 21:21:47 -0700127 libz \
128 libutils \
129 libLLVMObject \
130 libLLVMBitReader \
131 libLLVMMC \
132 libLLVMMCParser \
133 libLLVMCore \
134 libLLVMSupport \
Christopher Ferris67aba682015-05-08 15:44:46 -0700135
136backtrace_test_ldlibs_host += \
137 -ldl \
Christopher Ferrisa2efd3a2014-05-06 15:23:59 -0700138
Yabin Cui9e402bb2015-09-22 04:46:57 +0000139backtrace_test_strip_module := false
140
Christopher Ferris04b1e8c2014-01-30 01:13:33 -0800141module := backtrace_test
142module_tag := debug
143build_type := target
144build_target := NATIVE_TEST
Christopher Ferris2c43cff2015-03-26 19:18:36 -0700145backtrace_test_multilib := both
Christopher Ferris04b1e8c2014-01-30 01:13:33 -0800146include $(LOCAL_PATH)/Android.build.mk
147build_type := host
148include $(LOCAL_PATH)/Android.build.mk