blob: 56a397016a09096b298bd542a8e2c5a59b53cde7 [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
Christopher Ferris2c43cff2015-03-26 19:18:36 -070023libbacktrace_common_conlyflags := \
Christopher Ferris17e91d42013-10-21 13:30:52 -070024 -std=gnu99 \
25
Christopher Ferris2c43cff2015-03-26 19:18:36 -070026libbacktrace_common_cppflags := \
Christopher Ferris17e91d42013-10-21 13:30:52 -070027 -std=gnu++11 \
Dan Willemsenee2da032016-05-25 13:19:49 -070028
29libbacktrace_common_c_includes := \
30 external/libunwind/include/tdep \
Christopher Ferris17e91d42013-10-21 13:30:52 -070031
Stephen Hines035e9ba2015-03-31 09:39:20 -070032# The latest clang (r230699) does not allow SP/PC to be declared in inline asm lists.
33libbacktrace_common_clang_cflags += \
34 -Wno-inline-asm
35
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080036build_host := false
37ifeq ($(HOST_OS),linux)
38ifeq ($(HOST_ARCH),$(filter $(HOST_ARCH),x86 x86_64))
39build_host := true
40endif
41endif
42
Yabin Cui9e402bb2015-09-22 04:46:57 +000043LLVM_ROOT_PATH := external/llvm
44include $(LLVM_ROOT_PATH)/llvm.mk
45
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080046#-------------------------------------------------------------------------
Christopher Ferris85402162016-01-25 16:17:48 -080047# The libbacktrace_offline shared library.
48#-------------------------------------------------------------------------
49libbacktrace_offline_src_files := \
50 BacktraceOffline.cpp \
51
Yabin Cuib791a762016-03-18 18:46:08 -070052# Use shared llvm library on device to save space.
Yabin Cui51e60702016-04-13 21:21:47 -070053libbacktrace_offline_shared_libraries_target := \
Christopher Ferris85402162016-01-25 16:17:48 -080054 libbacktrace \
Yabin Cuib791a762016-03-18 18:46:08 -070055 libbase \
Christopher Ferris85402162016-01-25 16:17:48 -080056 liblog \
57 libunwind \
Yabin Cuib791a762016-03-18 18:46:08 -070058 libutils \
Christopher Ferris85402162016-01-25 16:17:48 -080059 libLLVM \
60
Yabin Cui51e60702016-04-13 21:21:47 -070061libbacktrace_offline_static_libraries_target := \
Yabin Cuib791a762016-03-18 18:46:08 -070062 libziparchive \
63 libz \
64
Christopher Ferris85402162016-01-25 16:17:48 -080065# Use static llvm libraries on host to remove dependency on 32-bit llvm shared library
66# which is not included in the prebuilt.
Yabin Cui51e60702016-04-13 21:21:47 -070067libbacktrace_offline_static_libraries_host := \
Yabin Cui9946a8f2016-02-10 13:46:06 -080068 libbacktrace \
Yabin Cui9946a8f2016-02-10 13:46:06 -080069 libunwind \
Colin Cross99f6b862016-08-26 11:12:38 -070070 libziparchive \
Yabin Cuib791a762016-03-18 18:46:08 -070071 libz \
Yabin Cui51e60702016-04-13 21:21:47 -070072 libbase \
73 liblog \
74 libutils \
Yabin Cui9946a8f2016-02-10 13:46:06 -080075 libLLVMObject \
76 libLLVMBitReader \
77 libLLVMMC \
78 libLLVMMCParser \
79 libLLVMCore \
80 libLLVMSupport \
81
82module := libbacktrace_offline
83build_type := target
84build_target := STATIC_LIBRARY
Yabin Cui51e60702016-04-13 21:21:47 -070085libbacktrace_offline_multilib := both
86include $(LOCAL_PATH)/Android.build.mk
87build_type := host
Yabin Cui9946a8f2016-02-10 13:46:06 -080088include $(LOCAL_PATH)/Android.build.mk
89
Christopher Ferris85402162016-01-25 16:17:48 -080090#-------------------------------------------------------------------------
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080091# The backtrace_test executable.
92#-------------------------------------------------------------------------
93backtrace_test_cflags := \
Christopher Ferris17e91d42013-10-21 13:30:52 -070094 -fno-builtin \
Christopher Ferris17e91d42013-10-21 13:30:52 -070095 -O0 \
96 -g \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080097
98backtrace_test_cflags_target := \
Christopher Ferrise2960912014-03-07 19:42:19 -080099 -DENABLE_PSS_TESTS \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -0800100
101backtrace_test_src_files := \
Yabin Cui9e402bb2015-09-22 04:46:57 +0000102 backtrace_offline_test.cpp \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -0800103 backtrace_test.cpp \
Christopher Ferrise2960912014-03-07 19:42:19 -0800104 GetPss.cpp \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -0800105 thread_utils.c \
106
Christopher Ferris04b1e8c2014-01-30 01:13:33 -0800107backtrace_test_ldlibs_host := \
Ying Wang9f437d72014-05-07 15:36:05 -0700108 -lpthread \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -0800109 -lrt \
110
111backtrace_test_shared_libraries := \
Christopher Ferris7fb22872013-09-27 12:43:15 -0700112 libbacktrace_test \
113 libbacktrace \
Christopher Ferris67aba682015-05-08 15:44:46 -0700114 libbase \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -0800115 libcutils \
Yabin Cui51e60702016-04-13 21:21:47 -0700116 liblog \
Yabin Cui9e402bb2015-09-22 04:46:57 +0000117 libunwind \
Christopher Ferris17e91d42013-10-21 13:30:52 -0700118
Christopher Ferris67aba682015-05-08 15:44:46 -0700119backtrace_test_shared_libraries_target += \
120 libdl \
Yabin Cui51e60702016-04-13 21:21:47 -0700121 libutils \
122 libLLVM \
123
124backtrace_test_static_libraries := \
125 libbacktrace_offline \
126
127backtrace_test_static_libraries_target := \
128 libziparchive \
129 libz \
130
131backtrace_test_static_libraries_host := \
Colin Cross99f6b862016-08-26 11:12:38 -0700132 libziparchive \
Yabin Cui51e60702016-04-13 21:21:47 -0700133 libz \
134 libutils \
135 libLLVMObject \
136 libLLVMBitReader \
137 libLLVMMC \
138 libLLVMMCParser \
139 libLLVMCore \
140 libLLVMSupport \
Christopher Ferris67aba682015-05-08 15:44:46 -0700141
142backtrace_test_ldlibs_host += \
143 -ldl \
Christopher Ferrisa2efd3a2014-05-06 15:23:59 -0700144
Yabin Cui9e402bb2015-09-22 04:46:57 +0000145backtrace_test_strip_module := false
146
Christopher Ferris04b1e8c2014-01-30 01:13:33 -0800147module := backtrace_test
148module_tag := debug
149build_type := target
150build_target := NATIVE_TEST
Christopher Ferris2c43cff2015-03-26 19:18:36 -0700151backtrace_test_multilib := both
Christopher Ferris04b1e8c2014-01-30 01:13:33 -0800152include $(LOCAL_PATH)/Android.build.mk
153build_type := host
154include $(LOCAL_PATH)/Android.build.mk