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