blob: fdedb767e86f4b129d239586228bf04f10b1177c [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
Josh Gao9c02dc52016-06-15 17:29:00 -070011ifeq ($(TARGET_IS_64_BIT),true)
12common_cppflags += -DTARGET_IS_64_BIT
13endif
14
Ben Chengbdcff7d2009-12-17 12:50:58 -080015include $(CLEAR_VARS)
Colin Crosse951f602010-03-08 19:21:07 -080016
Colin Cross87a6b1d2014-03-21 16:58:30 -070017LOCAL_SRC_FILES:= \
Elliott Hughes8c597682014-06-03 15:12:07 -070018 backtrace.cpp \
19 debuggerd.cpp \
Christopher Ferrisa21bd932015-02-27 13:39:47 -080020 elf_utils.cpp \
Elliott Hughes8c597682014-06-03 15:12:07 -070021 getevent.cpp \
Josh Gaof5e8f0b2016-03-16 18:09:15 -070022 signal_sender.cpp \
Elliott Hughes8c597682014-06-03 15:12:07 -070023 tombstone.cpp \
24 utility.cpp \
Colin Cross87a6b1d2014-03-21 16:58:30 -070025
26LOCAL_SRC_FILES_arm := arm/machine.cpp
27LOCAL_SRC_FILES_arm64 := arm64/machine.cpp
28LOCAL_SRC_FILES_mips := mips/machine.cpp
Douglas Leung2ea9a322015-03-09 18:41:32 -070029LOCAL_SRC_FILES_mips64 := mips64/machine.cpp
Colin Cross87a6b1d2014-03-21 16:58:30 -070030LOCAL_SRC_FILES_x86 := x86/machine.cpp
31LOCAL_SRC_FILES_x86_64 := x86_64/machine.cpp
32
Josh Gao9c02dc52016-06-15 17:29:00 -070033LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Christopher Ferrise8bc77e2015-05-22 14:26:13 -070034LOCAL_CPPFLAGS := $(common_cppflags)
Colin Cross87a6b1d2014-03-21 16:58:30 -070035
Tom Cherry20391b12015-08-14 13:02:51 -070036LOCAL_INIT_RC_32 := debuggerd.rc
37LOCAL_INIT_RC_64 := debuggerd64.rc
38
Colin Cross87a6b1d2014-03-21 16:58:30 -070039LOCAL_SHARED_LIBRARIES := \
Elliott Hughes8c597682014-06-03 15:12:07 -070040 libbacktrace \
Christopher Ferrisa21bd932015-02-27 13:39:47 -080041 libbase \
Elliott Hughes8c597682014-06-03 15:12:07 -070042 libcutils \
43 liblog \
44 libselinux \
Colin Cross87a6b1d2014-03-21 16:58:30 -070045
Elliott Hughesc184d562014-12-18 15:47:09 -080046LOCAL_CLANG := true
47
Colin Cross87a6b1d2014-03-21 16:58:30 -070048LOCAL_MODULE := debuggerd
49LOCAL_MODULE_STEM_32 := debuggerd
50LOCAL_MODULE_STEM_64 := debuggerd64
51LOCAL_MULTILIB := both
52
53include $(BUILD_EXECUTABLE)
54
Josh Gao9c02dc52016-06-15 17:29:00 -070055crasher_cppflags := $(common_cppflags) -fstack-protector-all -Wno-free-nonheap-object -Wno-date-time
Elliott Hughescb7aae12014-07-09 16:41:04 -070056
Colin Cross87a6b1d2014-03-21 16:58:30 -070057include $(CLEAR_VARS)
Elliott Hughes23d1cad2016-05-10 13:29:58 -070058LOCAL_SRC_FILES := crasher.cpp
Colin Cross87a6b1d2014-03-21 16:58:30 -070059LOCAL_SRC_FILES_arm := arm/crashglue.S
60LOCAL_SRC_FILES_arm64 := arm64/crashglue.S
61LOCAL_SRC_FILES_mips := mips/crashglue.S
Douglas Leung2ea9a322015-03-09 18:41:32 -070062LOCAL_SRC_FILES_mips64 := mips64/crashglue.S
Colin Cross87a6b1d2014-03-21 16:58:30 -070063LOCAL_SRC_FILES_x86 := x86/crashglue.S
64LOCAL_SRC_FILES_x86_64 := x86_64/crashglue.S
65LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
66LOCAL_MODULE_TAGS := optional
Josh Gao9c02dc52016-06-15 17:29:00 -070067LOCAL_CPPFLAGS := $(crasher_cppflags)
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
Josh Gao9c02dc52016-06-15 17:29:00 -070082include $(CLEAR_VARS)
83LOCAL_SRC_FILES := crasher.cpp
84LOCAL_SRC_FILES_arm := arm/crashglue.S
85LOCAL_SRC_FILES_arm64 := arm64/crashglue.S
86LOCAL_SRC_FILES_mips := mips/crashglue.S
87LOCAL_SRC_FILES_mips64 := mips64/crashglue.S
88LOCAL_SRC_FILES_x86 := x86/crashglue.S
89LOCAL_SRC_FILES_x86_64 := x86_64/crashglue.S
90LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
91LOCAL_MODULE_TAGS := optional
92LOCAL_CPPFLAGS := $(crasher_cppflags) -DSTATIC_CRASHER
93LOCAL_FORCE_STATIC_EXECUTABLE := true
94LOCAL_SHARED_LIBRARIES := libcutils liblog
95
96# The arm emulator has VFP but not VFPv3-D32.
97ifeq ($(ARCH_ARM_HAVE_VFP_D32),true)
98LOCAL_ASFLAGS_arm += -DHAS_VFP_D32
99endif
100
101LOCAL_MODULE := static_crasher
102LOCAL_MODULE_STEM_32 := static_crasher
103LOCAL_MODULE_STEM_64 := static_crasher64
104LOCAL_MULTILIB := both
105
106LOCAL_STATIC_LIBRARIES := libdebuggerd_client libcutils liblog
107
108include $(BUILD_EXECUTABLE)
109
Christopher Ferris862fe022015-06-02 14:52:44 -0700110debuggerd_test_src_files := \
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700111 utility.cpp \
112 test/dump_memory_test.cpp \
Christopher Ferris862fe022015-06-02 14:52:44 -0700113 test/elf_fake.cpp \
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700114 test/log_fake.cpp \
Christopher Ferris862fe022015-06-02 14:52:44 -0700115 test/property_fake.cpp \
116 test/ptrace_fake.cpp \
Christopher Ferrisb36b5922015-06-17 18:35:59 -0700117 test/tombstone_test.cpp \
Christopher Ferris862fe022015-06-02 14:52:44 -0700118 test/selinux_fake.cpp \
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700119
Christopher Ferris862fe022015-06-02 14:52:44 -0700120debuggerd_shared_libraries := \
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700121 libbacktrace \
122 libbase \
Christopher Ferris862fe022015-06-02 14:52:44 -0700123 libcutils \
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700124
Christopher Ferris862fe022015-06-02 14:52:44 -0700125debuggerd_c_includes := \
126 $(LOCAL_PATH)/test \
127
128debuggerd_cpp_flags := \
129 $(common_cppflags) \
130 -Wno-missing-field-initializers \
Yabin Cui9e402bb2015-09-22 04:46:57 +0000131 -fno-rtti \
Christopher Ferris862fe022015-06-02 14:52:44 -0700132
Pirama Arumuga Nainar6fbbc4c2016-06-28 16:07:53 -0700133# Bug: http://b/29823425 Disable -Wvarargs for Clang update to r271374
134debuggerd_cpp_flags += -Wno-varargs
135
Christopher Ferris862fe022015-06-02 14:52:44 -0700136# Only build the host tests on linux.
137ifeq ($(HOST_OS),linux)
138
139include $(CLEAR_VARS)
140
141LOCAL_MODULE := debuggerd_test
142LOCAL_SRC_FILES := $(debuggerd_test_src_files)
143LOCAL_SHARED_LIBRARIES := $(debuggerd_shared_libraries)
144LOCAL_C_INCLUDES := $(debuggerd_c_includes)
145LOCAL_CPPFLAGS := $(debuggerd_cpp_flags)
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700146
147LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
148LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
149LOCAL_MULTILIB := both
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700150include $(BUILD_HOST_NATIVE_TEST)
151
Christopher Ferris862fe022015-06-02 14:52:44 -0700152endif
153
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700154include $(CLEAR_VARS)
155
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700156LOCAL_MODULE := debuggerd_test
Christopher Ferris862fe022015-06-02 14:52:44 -0700157LOCAL_SRC_FILES := $(debuggerd_test_src_files)
158LOCAL_SHARED_LIBRARIES := $(debuggerd_shared_libraries)
159LOCAL_C_INCLUDES := $(debuggerd_c_includes)
160LOCAL_CPPFLAGS := $(debuggerd_cpp_flags)
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700161
162LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
163LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
164LOCAL_MULTILIB := both
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700165include $(BUILD_NATIVE_TEST)