1# Copyright 2012 Google LLC 2# 3# Redistribution and use in source and binary forms, with or without 4# modification, are permitted provided that the following conditions are 5# met: 6# 7# * Redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer. 9# * Redistributions in binary form must reproduce the above 10# copyright notice, this list of conditions and the following disclaimer 11# in the documentation and/or other materials provided with the 12# distribution. 13# * Neither the name of Google LLC nor the names of its 14# contributors may be used to endorse or promote products derived from 15# this software without specific prior written permission. 16# 17# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 29# ndk-build module definition for the Google Breakpad client library 30# 31# To use this file, do the following: 32# 33# 1/ Include this file from your own Android.mk, either directly 34# or with through the NDK's import-module function. 35# 36# 2/ Use the client static library in your project with: 37# 38# LOCAL_STATIC_LIBRARIES += breakpad_client 39# 40# 3/ In your source code, include "src/client/linux/exception_handler.h" 41# and use the Linux instructions to use it. 42# 43# This module works with either the STLport or GNU libstdc++, but you need 44# to select one in your Application.mk 45# 46 47# The top Google Breakpad directory. 48# We assume this Android.mk to be under 'android/google_breakpad' 49 50LOCAL_PATH := $(call my-dir)/../.. 51 52# Defube the client library module, as a simple static library that 53# exports the right include path / linker flags to its users. 54 55include $(CLEAR_VARS) 56 57LOCAL_MODULE := breakpad_client 58LOCAL_LICENSE_KINDS := SPDX-license-identifier-BSD 59LOCAL_LICENSE_CONDITIONS := notice 60LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../LICENSE 61 62LOCAL_CPP_EXTENSION := .cc 63 64# Breakpad uses inline ARM assembly that requires the library 65# to be built in ARM mode. Otherwise, the build will fail with 66# cryptic assembler messages like: 67# Compile++ thumb : google_breakpad_client <= crash_generation_client.cc 68# /tmp/cc8aMSoD.s: Assembler messages: 69# /tmp/cc8aMSoD.s:132: Error: invalid immediate: 288 is out of range 70# /tmp/cc8aMSoD.s:244: Error: invalid immediate: 296 is out of range 71LOCAL_ARM_MODE := arm 72 73# List of client source files, directly taken from Makefile.am 74LOCAL_SRC_FILES := \ 75 src/client/linux/crash_generation/crash_generation_client.cc \ 76 src/client/linux/dump_writer_common/thread_info.cc \ 77 src/client/linux/dump_writer_common/ucontext_reader.cc \ 78 src/client/linux/handler/exception_handler.cc \ 79 src/client/linux/handler/minidump_descriptor.cc \ 80 src/client/linux/log/log.cc \ 81 src/client/linux/microdump_writer/microdump_writer.cc \ 82 src/client/linux/minidump_writer/linux_dumper.cc \ 83 src/client/linux/minidump_writer/linux_ptrace_dumper.cc \ 84 src/client/linux/minidump_writer/minidump_writer.cc \ 85 src/client/linux/minidump_writer/pe_file.cc \ 86 src/client/minidump_file_writer.cc \ 87 src/common/convert_UTF.cc \ 88 src/common/md5.cc \ 89 src/common/string_conversion.cc \ 90 src/common/linux/breakpad_getcontext.S \ 91 src/common/linux/elfutils.cc \ 92 src/common/linux/file_id.cc \ 93 src/common/linux/guid_creator.cc \ 94 src/common/linux/linux_libc_support.cc \ 95 src/common/linux/memory_mapped_file.cc \ 96 src/common/linux/safe_readlink.cc 97 98LOCAL_C_INCLUDES := $(LOCAL_PATH)/src/common/android/include \ 99 $(LOCAL_PATH)/src \ 100 $(LSS_PATH) 101 102LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES) 103LOCAL_EXPORT_LDLIBS := -llog 104 105include $(BUILD_STATIC_LIBRARY) 106 107# Done. 108