• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1LOCAL_PATH := $(call my-dir)
2
3common_cppflags := \
4    -std=gnu++11 \
5    -W \
6    -Wall \
7    -Wextra \
8    -Wunused \
9    -Werror \
10
11include $(CLEAR_VARS)
12
13LOCAL_SRC_FILES:= \
14    backtrace.cpp \
15    debuggerd.cpp \
16    elf_utils.cpp \
17    getevent.cpp \
18    signal_sender.cpp \
19    tombstone.cpp \
20    utility.cpp \
21
22LOCAL_SRC_FILES_arm    := arm/machine.cpp
23LOCAL_SRC_FILES_arm64  := arm64/machine.cpp
24LOCAL_SRC_FILES_mips   := mips/machine.cpp
25LOCAL_SRC_FILES_mips64 := mips64/machine.cpp
26LOCAL_SRC_FILES_x86    := x86/machine.cpp
27LOCAL_SRC_FILES_x86_64 := x86_64/machine.cpp
28
29LOCAL_CPPFLAGS := $(common_cppflags)
30
31LOCAL_INIT_RC_32 := debuggerd.rc
32LOCAL_INIT_RC_64 := debuggerd64.rc
33
34ifeq ($(TARGET_IS_64_BIT),true)
35LOCAL_CPPFLAGS += -DTARGET_IS_64_BIT
36endif
37
38LOCAL_SHARED_LIBRARIES := \
39    libbacktrace \
40    libbase \
41    libcutils \
42    liblog \
43    libselinux \
44
45LOCAL_CLANG := true
46
47LOCAL_MODULE := debuggerd
48LOCAL_MODULE_STEM_32 := debuggerd
49LOCAL_MODULE_STEM_64 := debuggerd64
50LOCAL_MULTILIB := both
51
52include $(BUILD_EXECUTABLE)
53
54
55
56include $(CLEAR_VARS)
57LOCAL_SRC_FILES := crasher.c
58LOCAL_SRC_FILES_arm    := arm/crashglue.S
59LOCAL_SRC_FILES_arm64  := arm64/crashglue.S
60LOCAL_SRC_FILES_mips   := mips/crashglue.S
61LOCAL_SRC_FILES_mips64 := mips64/crashglue.S
62LOCAL_SRC_FILES_x86    := x86/crashglue.S
63LOCAL_SRC_FILES_x86_64 := x86_64/crashglue.S
64LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
65LOCAL_MODULE_TAGS := optional
66LOCAL_CFLAGS += -fstack-protector-all -Werror -Wno-free-nonheap-object -Wno-date-time
67#LOCAL_FORCE_STATIC_EXECUTABLE := true
68LOCAL_SHARED_LIBRARIES := libcutils liblog libc
69
70# The arm emulator has VFP but not VFPv3-D32.
71ifeq ($(ARCH_ARM_HAVE_VFP_D32),true)
72LOCAL_ASFLAGS_arm += -DHAS_VFP_D32
73endif
74
75LOCAL_MODULE := crasher
76LOCAL_MODULE_STEM_32 := crasher
77LOCAL_MODULE_STEM_64 := crasher64
78LOCAL_MULTILIB := both
79
80include $(BUILD_EXECUTABLE)
81
82debuggerd_test_src_files := \
83    utility.cpp \
84    test/dump_memory_test.cpp \
85    test/elf_fake.cpp \
86    test/log_fake.cpp \
87    test/property_fake.cpp \
88    test/ptrace_fake.cpp \
89    test/tombstone_test.cpp \
90    test/selinux_fake.cpp \
91
92debuggerd_shared_libraries := \
93    libbacktrace \
94    libbase \
95    libcutils \
96
97debuggerd_c_includes := \
98    $(LOCAL_PATH)/test \
99
100debuggerd_cpp_flags := \
101    $(common_cppflags) \
102    -Wno-missing-field-initializers \
103    -fno-rtti \
104
105# Only build the host tests on linux.
106ifeq ($(HOST_OS),linux)
107
108include $(CLEAR_VARS)
109
110LOCAL_MODULE := debuggerd_test
111LOCAL_SRC_FILES := $(debuggerd_test_src_files)
112LOCAL_SHARED_LIBRARIES := $(debuggerd_shared_libraries)
113LOCAL_C_INCLUDES := $(debuggerd_c_includes)
114LOCAL_CPPFLAGS := $(debuggerd_cpp_flags)
115
116LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
117LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
118LOCAL_MULTILIB := both
119include $(BUILD_HOST_NATIVE_TEST)
120
121endif
122
123include $(CLEAR_VARS)
124
125LOCAL_MODULE := debuggerd_test
126LOCAL_SRC_FILES := $(debuggerd_test_src_files)
127LOCAL_SHARED_LIBRARIES := $(debuggerd_shared_libraries)
128LOCAL_C_INCLUDES := $(debuggerd_c_includes)
129LOCAL_CPPFLAGS := $(debuggerd_cpp_flags)
130
131LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
132LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
133LOCAL_MULTILIB := both
134include $(BUILD_NATIVE_TEST)
135