1# Copyright (C) 2015 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15LOCAL_PATH := $(call my-dir)
16
17# Static library.
18# =================================================
19include $(CLEAR_VARS)
20
21LOCAL_MODULE := breakpad_client
22
23LOCAL_CPP_EXTENSION := .cc
24
25LOCAL_SRC_FILES := \
26    src/client/linux/dump_writer_common/seccomp_unwinder.cc \
27    src/client/linux/dump_writer_common/thread_info.cc \
28    src/client/linux/dump_writer_common/ucontext_reader.cc \
29    src/client/linux/handler/minidump_descriptor.cc \
30    src/client/linux/minidump_writer/linux_core_dumper.cc \
31    src/client/linux/minidump_writer/linux_dumper.cc \
32    src/client/linux/minidump_writer/linux_ptrace_dumper.cc \
33    src/client/linux/minidump_writer/minidump_writer.cc \
34    src/client/minidump_file_writer.cc \
35    src/common/convert_UTF.c \
36    src/common/linux/elf_core_dump.cc \
37    src/common/linux/elfutils.cc \
38    src/common/linux/file_id.cc \
39    src/common/linux/guid_creator.cc \
40    src/common/linux/linux_libc_support.cc \
41    src/common/linux/memory_mapped_file.cc \
42    src/common/linux/safe_readlink.cc \
43    src/common/string_conversion.cc \
44
45LOCAL_C_INCLUDES := \
46    $(LOCAL_PATH)/src/common/android/include \
47    $(LOCAL_PATH)/src \
48
49LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_C_INCLUDES)
50
51# Work around b/25435766 core2md segfault.
52LOCAL_CLANG_CFLAGS_x86 += -mno-stackrealign
53LOCAL_CLANG := true
54
55include $(BUILD_STATIC_LIBRARY)
56
57# core2md binary.
58# =================================================
59include $(CLEAR_VARS)
60
61LOCAL_MODULE := core2md
62
63LOCAL_CPP_EXTENSION := .cc
64
65LOCAL_SRC_FILES := src/tools/linux/core2md/core2md.cc
66
67LOCAL_STATIC_LIBRARIES := breakpad_client
68
69# Work around b/25435766 core2md segfault.
70LOCAL_CLANG_CFLAGS_x86 += -mno-stackrealign
71LOCAL_CLANG := true
72
73include $(BUILD_EXECUTABLE)
74
75# dump_syms host tool.
76# =================================================
77include $(CLEAR_VARS)
78LOCAL_MODULE := dump_syms
79LOCAL_MODULE_HOST_OS := linux
80LOCAL_CLANG := true
81LOCAL_CPPFLAGS_linux := -DHAVE_A_OUT_H -Wno-unused-parameter
82LOCAL_CPP_EXTENSION := .cc
83LOCAL_C_INCLUDES := \
84    $(LOCAL_PATH)/src
85LOCAL_SRC_FILES := \
86    src/common/dwarf/bytereader.cc \
87    src/common/dwarf/dwarf2diehandler.cc \
88    src/common/dwarf/dwarf2reader.cc \
89    src/common/dwarf_cfi_to_module.cc \
90    src/common/dwarf_cu_to_module.cc \
91    src/common/dwarf_line_to_module.cc \
92    src/common/language.cc \
93    src/common/module.cc \
94    src/common/stabs_reader.cc \
95    src/common/stabs_to_module.cc
96LOCAL_SRC_FILES_linux := \
97    src/common/linux/crc32.cc \
98    src/common/linux/dump_symbols.cc \
99    src/common/linux/elfutils.cc \
100    src/common/linux/elf_symbols_to_module.cc \
101    src/common/linux/file_id.cc \
102    src/common/linux/linux_libc_support.cc \
103    src/common/linux/memory_mapped_file.cc \
104    src/tools/linux/dump_syms/dump_syms.cc
105include $(BUILD_HOST_EXECUTABLE)
106