blob: f4976e95492bf8cb36f07c5a5244c6942c0bb6ab [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#-------------------------------------------------------------------------
Pirama Arumuga Nainarc198b152016-11-28 15:27:40 -080041# The libbacktrace_offline static library.
Christopher Ferris85402162016-01-25 16:17:48 -080042#-------------------------------------------------------------------------
43libbacktrace_offline_src_files := \
44 BacktraceOffline.cpp \
45
Pirama Arumuga Nainarc198b152016-11-28 15:27:40 -080046# Use shared libraries so their headers get included during build.
47libbacktrace_offline_shared_libraries := \
Yabin Cuib791a762016-03-18 18:46:08 -070048 libbase \
Christopher Ferris85402162016-01-25 16:17:48 -080049 libunwind \
Yabin Cui9946a8f2016-02-10 13:46:06 -080050
51module := libbacktrace_offline
52build_type := target
53build_target := STATIC_LIBRARY
Yabin Cui51e60702016-04-13 21:21:47 -070054libbacktrace_offline_multilib := both
55include $(LOCAL_PATH)/Android.build.mk
56build_type := host
Yabin Cui9946a8f2016-02-10 13:46:06 -080057include $(LOCAL_PATH)/Android.build.mk
58
Christopher Ferris85402162016-01-25 16:17:48 -080059#-------------------------------------------------------------------------
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080060# The backtrace_test executable.
61#-------------------------------------------------------------------------
62backtrace_test_cflags := \
Christopher Ferris17e91d42013-10-21 13:30:52 -070063 -fno-builtin \
Christopher Ferris17e91d42013-10-21 13:30:52 -070064 -O0 \
65 -g \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080066
67backtrace_test_cflags_target := \
Christopher Ferrise2960912014-03-07 19:42:19 -080068 -DENABLE_PSS_TESTS \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080069
70backtrace_test_src_files := \
Yabin Cui9e402bb2015-09-22 04:46:57 +000071 backtrace_offline_test.cpp \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080072 backtrace_test.cpp \
Christopher Ferrise2960912014-03-07 19:42:19 -080073 GetPss.cpp \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080074 thread_utils.c \
75
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080076backtrace_test_ldlibs_host := \
Ying Wang9f437d72014-05-07 15:36:05 -070077 -lpthread \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080078 -lrt \
79
80backtrace_test_shared_libraries := \
Christopher Ferris7fb22872013-09-27 12:43:15 -070081 libbacktrace_test \
82 libbacktrace \
Christopher Ferris67aba682015-05-08 15:44:46 -070083 libbase \
Christopher Ferris04b1e8c2014-01-30 01:13:33 -080084 libcutils \
Yabin Cui51e60702016-04-13 21:21:47 -070085 liblog \
Yabin Cui9e402bb2015-09-22 04:46:57 +000086 libunwind \
Christopher Ferris17e91d42013-10-21 13:30:52 -070087
Christopher Ferris67aba682015-05-08 15:44:46 -070088backtrace_test_shared_libraries_target += \
89 libdl \
Yabin Cui51e60702016-04-13 21:21:47 -070090 libutils \
Yabin Cui51e60702016-04-13 21:21:47 -070091
Pirama Arumuga Nainarc198b152016-11-28 15:27:40 -080092# Statically link LLVMlibraries to remove dependency on llvm shared library.
Yabin Cui51e60702016-04-13 21:21:47 -070093backtrace_test_static_libraries := \
94 libbacktrace_offline \
Pirama Arumuga Nainarc198b152016-11-28 15:27:40 -080095 libLLVMObject \
96 libLLVMBitReader \
97 libLLVMMC \
98 libLLVMMCParser \
99 libLLVMCore \
100 libLLVMSupport \
Yabin Cui51e60702016-04-13 21:21:47 -0700101
102backtrace_test_static_libraries_target := \
103 libziparchive \
104 libz \
105
106backtrace_test_static_libraries_host := \
Colin Cross99f6b862016-08-26 11:12:38 -0700107 libziparchive \
Yabin Cui51e60702016-04-13 21:21:47 -0700108 libz \
109 libutils \
Christopher Ferris67aba682015-05-08 15:44:46 -0700110
111backtrace_test_ldlibs_host += \
112 -ldl \
Christopher Ferrisa2efd3a2014-05-06 15:23:59 -0700113
Christopher Ferris04b1e8c2014-01-30 01:13:33 -0800114module := backtrace_test
115module_tag := debug
116build_type := target
117build_target := NATIVE_TEST
Christopher Ferris2c43cff2015-03-26 19:18:36 -0700118backtrace_test_multilib := both
Christopher Ferris04b1e8c2014-01-30 01:13:33 -0800119include $(LOCAL_PATH)/Android.build.mk
120build_type := host
121include $(LOCAL_PATH)/Android.build.mk