blob: f4976e95492bf8cb36f07c5a5244c6942c0bb6ab [file] [log] [blame]
Colin Crossced03082016-12-15 20:44:30 +00001#
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#
16
17LOCAL_PATH:= $(call my-dir)
18
19libbacktrace_common_cflags := \
20 -Wall \
21 -Werror \
22
23libbacktrace_common_c_includes := \
24 external/libunwind/include/tdep \
25
26# 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
30build_host := false
31ifeq ($(HOST_OS),linux)
32ifeq ($(HOST_ARCH),$(filter $(HOST_ARCH),x86 x86_64))
33build_host := true
34endif
35endif
36
37LLVM_ROOT_PATH := external/llvm
38include $(LLVM_ROOT_PATH)/llvm.mk
39
40#-------------------------------------------------------------------------
41# The libbacktrace_offline static library.
42#-------------------------------------------------------------------------
43libbacktrace_offline_src_files := \
44 BacktraceOffline.cpp \
45
46# Use shared libraries so their headers get included during build.
47libbacktrace_offline_shared_libraries := \
48 libbase \
49 libunwind \
50
51module := libbacktrace_offline
52build_type := target
53build_target := STATIC_LIBRARY
54libbacktrace_offline_multilib := both
55include $(LOCAL_PATH)/Android.build.mk
56build_type := host
57include $(LOCAL_PATH)/Android.build.mk
58
59#-------------------------------------------------------------------------
60# The backtrace_test executable.
61#-------------------------------------------------------------------------
62backtrace_test_cflags := \
63 -fno-builtin \
64 -O0 \
65 -g \
66
67backtrace_test_cflags_target := \
68 -DENABLE_PSS_TESTS \
69
70backtrace_test_src_files := \
71 backtrace_offline_test.cpp \
72 backtrace_test.cpp \
73 GetPss.cpp \
74 thread_utils.c \
75
76backtrace_test_ldlibs_host := \
77 -lpthread \
78 -lrt \
79
80backtrace_test_shared_libraries := \
81 libbacktrace_test \
82 libbacktrace \
83 libbase \
84 libcutils \
85 liblog \
86 libunwind \
87
88backtrace_test_shared_libraries_target += \
89 libdl \
90 libutils \
91
92# Statically link LLVMlibraries to remove dependency on llvm shared library.
93backtrace_test_static_libraries := \
94 libbacktrace_offline \
95 libLLVMObject \
96 libLLVMBitReader \
97 libLLVMMC \
98 libLLVMMCParser \
99 libLLVMCore \
100 libLLVMSupport \
101
102backtrace_test_static_libraries_target := \
103 libziparchive \
104 libz \
105
106backtrace_test_static_libraries_host := \
107 libziparchive \
108 libz \
109 libutils \
110
111backtrace_test_ldlibs_host += \
112 -ldl \
113
114module := backtrace_test
115module_tag := debug
116build_type := target
117build_target := NATIVE_TEST
118backtrace_test_multilib := both
119include $(LOCAL_PATH)/Android.build.mk
120build_type := host
121include $(LOCAL_PATH)/Android.build.mk