blob: 155b3093663a90d00a47a7343d20dfadf1d89263 [file] [log] [blame]
Christopher Ferrise8bc77e2015-05-22 14:26:13 -07001LOCAL_PATH := $(call my-dir)
2
3common_cppflags := \
Christopher Ferrise8bc77e2015-05-22 14:26:13 -07004 -W \
5 -Wall \
6 -Wextra \
7 -Wunused \
8 -Werror \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -08009
Josh Gao9c02dc52016-06-15 17:29:00 -070010ifeq ($(TARGET_IS_64_BIT),true)
11common_cppflags += -DTARGET_IS_64_BIT
12endif
13
Ben Chengbdcff7d2009-12-17 12:50:58 -080014include $(CLEAR_VARS)
Colin Crosse951f602010-03-08 19:21:07 -080015
Colin Cross87a6b1d2014-03-21 16:58:30 -070016LOCAL_SRC_FILES:= \
Elliott Hughes8c597682014-06-03 15:12:07 -070017 backtrace.cpp \
18 debuggerd.cpp \
Christopher Ferrisa21bd932015-02-27 13:39:47 -080019 elf_utils.cpp \
Elliott Hughes8c597682014-06-03 15:12:07 -070020 getevent.cpp \
Josh Gaof5e8f0b2016-03-16 18:09:15 -070021 signal_sender.cpp \
Elliott Hughes8c597682014-06-03 15:12:07 -070022 tombstone.cpp \
23 utility.cpp \
Colin Cross87a6b1d2014-03-21 16:58:30 -070024
25LOCAL_SRC_FILES_arm := arm/machine.cpp
26LOCAL_SRC_FILES_arm64 := arm64/machine.cpp
27LOCAL_SRC_FILES_mips := mips/machine.cpp
Douglas Leung2ea9a322015-03-09 18:41:32 -070028LOCAL_SRC_FILES_mips64 := mips64/machine.cpp
Colin Cross87a6b1d2014-03-21 16:58:30 -070029LOCAL_SRC_FILES_x86 := x86/machine.cpp
30LOCAL_SRC_FILES_x86_64 := x86_64/machine.cpp
31
Josh Gao9c02dc52016-06-15 17:29:00 -070032LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
Christopher Ferrise8bc77e2015-05-22 14:26:13 -070033LOCAL_CPPFLAGS := $(common_cppflags)
Colin Cross87a6b1d2014-03-21 16:58:30 -070034
Tom Cherry20391b12015-08-14 13:02:51 -070035LOCAL_INIT_RC_32 := debuggerd.rc
36LOCAL_INIT_RC_64 := debuggerd64.rc
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
Josh Gao9c02dc52016-06-15 17:29:00 -070054crasher_cppflags := $(common_cppflags) -fstack-protector-all -Wno-free-nonheap-object -Wno-date-time
Elliott Hughescb7aae12014-07-09 16:41:04 -070055
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
Josh Gao9c02dc52016-06-15 17:29:00 -070066LOCAL_CPPFLAGS := $(crasher_cppflags)
Elliott Hughes23d1cad2016-05-10 13:29:58 -070067LOCAL_SHARED_LIBRARIES := libcutils liblog
Colin Cross87a6b1d2014-03-21 16:58:30 -070068
Elliott Hughescb7aae12014-07-09 16:41:04 -070069# The arm emulator has VFP but not VFPv3-D32.
70ifeq ($(ARCH_ARM_HAVE_VFP_D32),true)
71LOCAL_ASFLAGS_arm += -DHAS_VFP_D32
72endif
73
Colin Cross87a6b1d2014-03-21 16:58:30 -070074LOCAL_MODULE := crasher
75LOCAL_MODULE_STEM_32 := crasher
76LOCAL_MODULE_STEM_64 := crasher64
77LOCAL_MULTILIB := both
78
79include $(BUILD_EXECUTABLE)
Christopher Ferrise8bc77e2015-05-22 14:26:13 -070080
Josh Gao9c02dc52016-06-15 17:29:00 -070081include $(CLEAR_VARS)
82LOCAL_SRC_FILES := crasher.cpp
83LOCAL_SRC_FILES_arm := arm/crashglue.S
84LOCAL_SRC_FILES_arm64 := arm64/crashglue.S
85LOCAL_SRC_FILES_mips := mips/crashglue.S
86LOCAL_SRC_FILES_mips64 := mips64/crashglue.S
87LOCAL_SRC_FILES_x86 := x86/crashglue.S
88LOCAL_SRC_FILES_x86_64 := x86_64/crashglue.S
89LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
90LOCAL_MODULE_TAGS := optional
91LOCAL_CPPFLAGS := $(crasher_cppflags) -DSTATIC_CRASHER
92LOCAL_FORCE_STATIC_EXECUTABLE := true
93LOCAL_SHARED_LIBRARIES := libcutils liblog
94
95# The arm emulator has VFP but not VFPv3-D32.
96ifeq ($(ARCH_ARM_HAVE_VFP_D32),true)
97LOCAL_ASFLAGS_arm += -DHAS_VFP_D32
98endif
99
100LOCAL_MODULE := static_crasher
101LOCAL_MODULE_STEM_32 := static_crasher
102LOCAL_MODULE_STEM_64 := static_crasher64
103LOCAL_MULTILIB := both
104
105LOCAL_STATIC_LIBRARIES := libdebuggerd_client libcutils liblog
106
107include $(BUILD_EXECUTABLE)
108
Christopher Ferris862fe022015-06-02 14:52:44 -0700109debuggerd_test_src_files := \
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700110 utility.cpp \
111 test/dump_memory_test.cpp \
Christopher Ferris862fe022015-06-02 14:52:44 -0700112 test/elf_fake.cpp \
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700113 test/log_fake.cpp \
Christopher Ferris862fe022015-06-02 14:52:44 -0700114 test/property_fake.cpp \
115 test/ptrace_fake.cpp \
Christopher Ferrisb36b5922015-06-17 18:35:59 -0700116 test/tombstone_test.cpp \
Christopher Ferris862fe022015-06-02 14:52:44 -0700117 test/selinux_fake.cpp \
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700118
Christopher Ferris862fe022015-06-02 14:52:44 -0700119debuggerd_shared_libraries := \
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700120 libbacktrace \
121 libbase \
Christopher Ferris862fe022015-06-02 14:52:44 -0700122 libcutils \
Mark Salyzyndafe3842016-03-28 15:43:50 -0700123 liblog
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)