Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 1 | LOCAL_PATH := $(call my-dir) |
| 2 | |
| 3 | common_cppflags := \ |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 4 | -W \ |
| 5 | -Wall \ |
| 6 | -Wextra \ |
| 7 | -Wunused \ |
| 8 | -Werror \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 9 | |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 10 | ifeq ($(TARGET_IS_64_BIT),true) |
| 11 | common_cppflags += -DTARGET_IS_64_BIT |
| 12 | endif |
| 13 | |
Ben Cheng | bdcff7d | 2009-12-17 12:50:58 -0800 | [diff] [blame] | 14 | include $(CLEAR_VARS) |
Colin Cross | e951f60 | 2010-03-08 19:21:07 -0800 | [diff] [blame] | 15 | |
Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 16 | LOCAL_SRC_FILES:= \ |
Elliott Hughes | 8c59768 | 2014-06-03 15:12:07 -0700 | [diff] [blame] | 17 | backtrace.cpp \ |
| 18 | debuggerd.cpp \ |
Christopher Ferris | a21bd93 | 2015-02-27 13:39:47 -0800 | [diff] [blame] | 19 | elf_utils.cpp \ |
Elliott Hughes | 8c59768 | 2014-06-03 15:12:07 -0700 | [diff] [blame] | 20 | getevent.cpp \ |
Richard Uhler | 53fb32f | 2016-10-28 16:37:33 +0100 | [diff] [blame] | 21 | open_files_list.cpp \ |
Josh Gao | f5e8f0b | 2016-03-16 18:09:15 -0700 | [diff] [blame] | 22 | signal_sender.cpp \ |
Elliott Hughes | 8c59768 | 2014-06-03 15:12:07 -0700 | [diff] [blame] | 23 | tombstone.cpp \ |
| 24 | utility.cpp \ |
Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 25 | |
| 26 | LOCAL_SRC_FILES_arm := arm/machine.cpp |
| 27 | LOCAL_SRC_FILES_arm64 := arm64/machine.cpp |
| 28 | LOCAL_SRC_FILES_mips := mips/machine.cpp |
Douglas Leung | 2ea9a32 | 2015-03-09 18:41:32 -0700 | [diff] [blame] | 29 | LOCAL_SRC_FILES_mips64 := mips64/machine.cpp |
Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 30 | LOCAL_SRC_FILES_x86 := x86/machine.cpp |
| 31 | LOCAL_SRC_FILES_x86_64 := x86_64/machine.cpp |
| 32 | |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 33 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 34 | LOCAL_CPPFLAGS := $(common_cppflags) |
Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 35 | |
Tom Cherry | 20391b1 | 2015-08-14 13:02:51 -0700 | [diff] [blame] | 36 | LOCAL_INIT_RC_32 := debuggerd.rc |
| 37 | LOCAL_INIT_RC_64 := debuggerd64.rc |
| 38 | |
Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 39 | LOCAL_SHARED_LIBRARIES := \ |
Elliott Hughes | 8c59768 | 2014-06-03 15:12:07 -0700 | [diff] [blame] | 40 | libbacktrace \ |
Christopher Ferris | a21bd93 | 2015-02-27 13:39:47 -0800 | [diff] [blame] | 41 | libbase \ |
Elliott Hughes | 8c59768 | 2014-06-03 15:12:07 -0700 | [diff] [blame] | 42 | libcutils \ |
| 43 | liblog \ |
| 44 | libselinux \ |
Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 45 | |
Elliott Hughes | c184d56 | 2014-12-18 15:47:09 -0800 | [diff] [blame] | 46 | LOCAL_CLANG := true |
| 47 | |
Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 48 | LOCAL_MODULE := debuggerd |
| 49 | LOCAL_MODULE_STEM_32 := debuggerd |
| 50 | LOCAL_MODULE_STEM_64 := debuggerd64 |
| 51 | LOCAL_MULTILIB := both |
| 52 | |
| 53 | include $(BUILD_EXECUTABLE) |
| 54 | |
Elliott Hughes | 400628a | 2016-12-14 17:33:46 -0800 | [diff] [blame] | 55 | crasher_cppflags := $(common_cppflags) -O0 -fstack-protector-all -Wno-free-nonheap-object |
Elliott Hughes | cb7aae1 | 2014-07-09 16:41:04 -0700 | [diff] [blame] | 56 | |
Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 57 | include $(CLEAR_VARS) |
Elliott Hughes | 23d1cad | 2016-05-10 13:29:58 -0700 | [diff] [blame] | 58 | LOCAL_SRC_FILES := crasher.cpp |
Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 59 | LOCAL_SRC_FILES_arm := arm/crashglue.S |
| 60 | LOCAL_SRC_FILES_arm64 := arm64/crashglue.S |
| 61 | LOCAL_SRC_FILES_mips := mips/crashglue.S |
Douglas Leung | 2ea9a32 | 2015-03-09 18:41:32 -0700 | [diff] [blame] | 62 | LOCAL_SRC_FILES_mips64 := mips64/crashglue.S |
Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 63 | LOCAL_SRC_FILES_x86 := x86/crashglue.S |
| 64 | LOCAL_SRC_FILES_x86_64 := x86_64/crashglue.S |
| 65 | LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) |
| 66 | LOCAL_MODULE_TAGS := optional |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 67 | LOCAL_CPPFLAGS := $(crasher_cppflags) |
Elliott Hughes | 400628a | 2016-12-14 17:33:46 -0800 | [diff] [blame] | 68 | LOCAL_SHARED_LIBRARIES := libbase liblog |
Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 69 | |
Elliott Hughes | cb7aae1 | 2014-07-09 16:41:04 -0700 | [diff] [blame] | 70 | # The arm emulator has VFP but not VFPv3-D32. |
| 71 | ifeq ($(ARCH_ARM_HAVE_VFP_D32),true) |
| 72 | LOCAL_ASFLAGS_arm += -DHAS_VFP_D32 |
| 73 | endif |
| 74 | |
Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 75 | LOCAL_MODULE := crasher |
| 76 | LOCAL_MODULE_STEM_32 := crasher |
| 77 | LOCAL_MODULE_STEM_64 := crasher64 |
| 78 | LOCAL_MULTILIB := both |
| 79 | |
| 80 | include $(BUILD_EXECUTABLE) |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 81 | |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 82 | include $(CLEAR_VARS) |
| 83 | LOCAL_SRC_FILES := crasher.cpp |
| 84 | LOCAL_SRC_FILES_arm := arm/crashglue.S |
| 85 | LOCAL_SRC_FILES_arm64 := arm64/crashglue.S |
| 86 | LOCAL_SRC_FILES_mips := mips/crashglue.S |
| 87 | LOCAL_SRC_FILES_mips64 := mips64/crashglue.S |
| 88 | LOCAL_SRC_FILES_x86 := x86/crashglue.S |
| 89 | LOCAL_SRC_FILES_x86_64 := x86_64/crashglue.S |
| 90 | LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) |
| 91 | LOCAL_MODULE_TAGS := optional |
| 92 | LOCAL_CPPFLAGS := $(crasher_cppflags) -DSTATIC_CRASHER |
| 93 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 94 | |
| 95 | # The arm emulator has VFP but not VFPv3-D32. |
| 96 | ifeq ($(ARCH_ARM_HAVE_VFP_D32),true) |
| 97 | LOCAL_ASFLAGS_arm += -DHAS_VFP_D32 |
| 98 | endif |
| 99 | |
| 100 | LOCAL_MODULE := static_crasher |
| 101 | LOCAL_MODULE_STEM_32 := static_crasher |
| 102 | LOCAL_MODULE_STEM_64 := static_crasher64 |
| 103 | LOCAL_MULTILIB := both |
| 104 | |
Elliott Hughes | 400628a | 2016-12-14 17:33:46 -0800 | [diff] [blame] | 105 | LOCAL_STATIC_LIBRARIES := libdebuggerd_client libbase liblog |
Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 106 | |
| 107 | include $(BUILD_EXECUTABLE) |
| 108 | |
Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 109 | debuggerd_test_src_files := \ |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 110 | utility.cpp \ |
Richard Uhler | 53fb32f | 2016-10-28 16:37:33 +0100 | [diff] [blame] | 111 | open_files_list.cpp \ |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 112 | test/dump_memory_test.cpp \ |
Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 113 | test/elf_fake.cpp \ |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 114 | test/log_fake.cpp \ |
Richard Uhler | 53fb32f | 2016-10-28 16:37:33 +0100 | [diff] [blame] | 115 | test/open_files_list_test.cpp \ |
Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 116 | test/property_fake.cpp \ |
| 117 | test/ptrace_fake.cpp \ |
Christopher Ferris | b36b592 | 2015-06-17 18:35:59 -0700 | [diff] [blame] | 118 | test/tombstone_test.cpp \ |
Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 119 | test/selinux_fake.cpp \ |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 120 | |
Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 121 | debuggerd_shared_libraries := \ |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 122 | libbacktrace \ |
| 123 | libbase \ |
Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 124 | libcutils \ |
Mark Salyzyn | dafe384 | 2016-03-28 15:43:50 -0700 | [diff] [blame] | 125 | liblog |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 126 | |
Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 127 | debuggerd_c_includes := \ |
| 128 | $(LOCAL_PATH)/test \ |
| 129 | |
| 130 | debuggerd_cpp_flags := \ |
| 131 | $(common_cppflags) \ |
| 132 | -Wno-missing-field-initializers \ |
Yabin Cui | 9e402bb | 2015-09-22 04:46:57 +0000 | [diff] [blame] | 133 | -fno-rtti \ |
Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 134 | |
Pirama Arumuga Nainar | 6fbbc4c | 2016-06-28 16:07:53 -0700 | [diff] [blame] | 135 | # Bug: http://b/29823425 Disable -Wvarargs for Clang update to r271374 |
| 136 | debuggerd_cpp_flags += -Wno-varargs |
| 137 | |
Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 138 | # Only build the host tests on linux. |
| 139 | ifeq ($(HOST_OS),linux) |
| 140 | |
| 141 | include $(CLEAR_VARS) |
| 142 | |
| 143 | LOCAL_MODULE := debuggerd_test |
| 144 | LOCAL_SRC_FILES := $(debuggerd_test_src_files) |
| 145 | LOCAL_SHARED_LIBRARIES := $(debuggerd_shared_libraries) |
| 146 | LOCAL_C_INCLUDES := $(debuggerd_c_includes) |
| 147 | LOCAL_CPPFLAGS := $(debuggerd_cpp_flags) |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 148 | |
| 149 | LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 |
| 150 | LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 |
| 151 | LOCAL_MULTILIB := both |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 152 | include $(BUILD_HOST_NATIVE_TEST) |
| 153 | |
Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 154 | endif |
| 155 | |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 156 | include $(CLEAR_VARS) |
| 157 | |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 158 | LOCAL_MODULE := debuggerd_test |
Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 159 | LOCAL_SRC_FILES := $(debuggerd_test_src_files) |
| 160 | LOCAL_SHARED_LIBRARIES := $(debuggerd_shared_libraries) |
| 161 | LOCAL_C_INCLUDES := $(debuggerd_c_includes) |
| 162 | LOCAL_CPPFLAGS := $(debuggerd_cpp_flags) |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 163 | |
| 164 | LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 |
| 165 | LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 |
| 166 | LOCAL_MULTILIB := both |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 167 | include $(BUILD_NATIVE_TEST) |