blob: 9ce94c5db18269e07f817828691c373a2199e9f3 [file] [log] [blame]
Christopher Ferrise8bc77e2015-05-22 14:26:13 -07001LOCAL_PATH := $(call my-dir)
2
3common_cppflags := \
4 -std=gnu++11 \
5 -W \
6 -Wall \
7 -Wextra \
8 -Wunused \
9 -Werror \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080010
Ben Chengbdcff7d2009-12-17 12:50:58 -080011include $(CLEAR_VARS)
Colin Crosse951f602010-03-08 19:21:07 -080012
Colin Cross87a6b1d2014-03-21 16:58:30 -070013LOCAL_SRC_FILES:= \
Elliott Hughes8c597682014-06-03 15:12:07 -070014 backtrace.cpp \
15 debuggerd.cpp \
Christopher Ferrisa21bd932015-02-27 13:39:47 -080016 elf_utils.cpp \
Elliott Hughes8c597682014-06-03 15:12:07 -070017 getevent.cpp \
Josh Gaof5e8f0b2016-03-16 18:09:15 -070018 signal_sender.cpp \
Elliott Hughes8c597682014-06-03 15:12:07 -070019 tombstone.cpp \
20 utility.cpp \
Colin Cross87a6b1d2014-03-21 16:58:30 -070021
22LOCAL_SRC_FILES_arm := arm/machine.cpp
23LOCAL_SRC_FILES_arm64 := arm64/machine.cpp
24LOCAL_SRC_FILES_mips := mips/machine.cpp
Douglas Leung2ea9a322015-03-09 18:41:32 -070025LOCAL_SRC_FILES_mips64 := mips64/machine.cpp
Colin Cross87a6b1d2014-03-21 16:58:30 -070026LOCAL_SRC_FILES_x86 := x86/machine.cpp
27LOCAL_SRC_FILES_x86_64 := x86_64/machine.cpp
28
Christopher Ferrise8bc77e2015-05-22 14:26:13 -070029LOCAL_CPPFLAGS := $(common_cppflags)
Colin Cross87a6b1d2014-03-21 16:58:30 -070030
Tom Cherry20391b12015-08-14 13:02:51 -070031LOCAL_INIT_RC_32 := debuggerd.rc
32LOCAL_INIT_RC_64 := debuggerd64.rc
33
Christopher Ferris9774df62015-01-15 14:47:36 -080034ifeq ($(TARGET_IS_64_BIT),true)
35LOCAL_CPPFLAGS += -DTARGET_IS_64_BIT
36endif
37
Colin Cross87a6b1d2014-03-21 16:58:30 -070038LOCAL_SHARED_LIBRARIES := \
Elliott Hughes8c597682014-06-03 15:12:07 -070039 libbacktrace \
Christopher Ferrisa21bd932015-02-27 13:39:47 -080040 libbase \
Elliott Hughes8c597682014-06-03 15:12:07 -070041 libcutils \
42 liblog \
43 libselinux \
Colin Cross87a6b1d2014-03-21 16:58:30 -070044
Elliott Hughesc184d562014-12-18 15:47:09 -080045LOCAL_CLANG := true
46
Colin Cross87a6b1d2014-03-21 16:58:30 -070047LOCAL_MODULE := debuggerd
48LOCAL_MODULE_STEM_32 := debuggerd
49LOCAL_MODULE_STEM_64 := debuggerd64
50LOCAL_MULTILIB := both
51
52include $(BUILD_EXECUTABLE)
53
Elliott Hughescb7aae12014-07-09 16:41:04 -070054
55
Colin Cross87a6b1d2014-03-21 16:58:30 -070056include $(CLEAR_VARS)
Elliott Hughes23d1cad2016-05-10 13:29:58 -070057LOCAL_SRC_FILES := crasher.cpp
Colin Cross87a6b1d2014-03-21 16:58:30 -070058LOCAL_SRC_FILES_arm := arm/crashglue.S
59LOCAL_SRC_FILES_arm64 := arm64/crashglue.S
60LOCAL_SRC_FILES_mips := mips/crashglue.S
Douglas Leung2ea9a322015-03-09 18:41:32 -070061LOCAL_SRC_FILES_mips64 := mips64/crashglue.S
Colin Cross87a6b1d2014-03-21 16:58:30 -070062LOCAL_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
Elliott Hughes23d1cad2016-05-10 13:29:58 -070066LOCAL_CPPFLAGS := $(common_cppflags) -fstack-protector-all -Wno-free-nonheap-object -Wno-date-time
Colin Cross87a6b1d2014-03-21 16:58:30 -070067#LOCAL_FORCE_STATIC_EXECUTABLE := true
Elliott Hughes23d1cad2016-05-10 13:29:58 -070068LOCAL_SHARED_LIBRARIES := libcutils liblog
Colin Cross87a6b1d2014-03-21 16:58:30 -070069
Elliott Hughescb7aae12014-07-09 16:41:04 -070070# The arm emulator has VFP but not VFPv3-D32.
71ifeq ($(ARCH_ARM_HAVE_VFP_D32),true)
72LOCAL_ASFLAGS_arm += -DHAS_VFP_D32
73endif
74
Colin Cross87a6b1d2014-03-21 16:58:30 -070075LOCAL_MODULE := crasher
76LOCAL_MODULE_STEM_32 := crasher
77LOCAL_MODULE_STEM_64 := crasher64
78LOCAL_MULTILIB := both
79
80include $(BUILD_EXECUTABLE)
Christopher Ferrise8bc77e2015-05-22 14:26:13 -070081
Christopher Ferris862fe022015-06-02 14:52:44 -070082debuggerd_test_src_files := \
Christopher Ferrise8bc77e2015-05-22 14:26:13 -070083 utility.cpp \
84 test/dump_memory_test.cpp \
Christopher Ferris862fe022015-06-02 14:52:44 -070085 test/elf_fake.cpp \
Christopher Ferrise8bc77e2015-05-22 14:26:13 -070086 test/log_fake.cpp \
Christopher Ferris862fe022015-06-02 14:52:44 -070087 test/property_fake.cpp \
88 test/ptrace_fake.cpp \
Christopher Ferrisb36b5922015-06-17 18:35:59 -070089 test/tombstone_test.cpp \
Christopher Ferris862fe022015-06-02 14:52:44 -070090 test/selinux_fake.cpp \
Christopher Ferrise8bc77e2015-05-22 14:26:13 -070091
Christopher Ferris862fe022015-06-02 14:52:44 -070092debuggerd_shared_libraries := \
Christopher Ferrise8bc77e2015-05-22 14:26:13 -070093 libbacktrace \
94 libbase \
Christopher Ferris862fe022015-06-02 14:52:44 -070095 libcutils \
Christopher Ferrise8bc77e2015-05-22 14:26:13 -070096
Christopher Ferris862fe022015-06-02 14:52:44 -070097debuggerd_c_includes := \
98 $(LOCAL_PATH)/test \
99
100debuggerd_cpp_flags := \
101 $(common_cppflags) \
102 -Wno-missing-field-initializers \
Yabin Cui9e402bb2015-09-22 04:46:57 +0000103 -fno-rtti \
Christopher Ferris862fe022015-06-02 14:52:44 -0700104
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)
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700115
116LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
117LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
118LOCAL_MULTILIB := both
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700119include $(BUILD_HOST_NATIVE_TEST)
120
Christopher Ferris862fe022015-06-02 14:52:44 -0700121endif
122
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700123include $(CLEAR_VARS)
124
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700125LOCAL_MODULE := debuggerd_test
Christopher Ferris862fe022015-06-02 14:52:44 -0700126LOCAL_SRC_FILES := $(debuggerd_test_src_files)
127LOCAL_SHARED_LIBRARIES := $(debuggerd_shared_libraries)
128LOCAL_C_INCLUDES := $(debuggerd_c_includes)
129LOCAL_CPPFLAGS := $(debuggerd_cpp_flags)
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700130
131LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
132LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
133LOCAL_MULTILIB := both
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700134include $(BUILD_NATIVE_TEST)