| Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 1 | LOCAL_PATH := $(call my-dir) | 
|  | 2 |  | 
|  | 3 | common_cppflags := \ | 
|  | 4 | -std=gnu++11 \ | 
|  | 5 | -W \ | 
|  | 6 | -Wall \ | 
|  | 7 | -Wextra \ | 
|  | 8 | -Wunused \ | 
|  | 9 | -Werror \ | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 10 |  | 
| Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 11 | ifeq ($(TARGET_IS_64_BIT),true) | 
|  | 12 | common_cppflags += -DTARGET_IS_64_BIT | 
|  | 13 | endif | 
|  | 14 |  | 
| Ben Cheng | bdcff7d | 2009-12-17 12:50:58 -0800 | [diff] [blame] | 15 | include $(CLEAR_VARS) | 
| Colin Cross | e951f60 | 2010-03-08 19:21:07 -0800 | [diff] [blame] | 16 |  | 
| Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 17 | LOCAL_SRC_FILES:= \ | 
| Elliott Hughes | 8c59768 | 2014-06-03 15:12:07 -0700 | [diff] [blame] | 18 | backtrace.cpp \ | 
|  | 19 | debuggerd.cpp \ | 
| Christopher Ferris | a21bd93 | 2015-02-27 13:39:47 -0800 | [diff] [blame] | 20 | elf_utils.cpp \ | 
| Elliott Hughes | 8c59768 | 2014-06-03 15:12:07 -0700 | [diff] [blame] | 21 | getevent.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 |  | 
| Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 55 | crasher_cppflags := $(common_cppflags) -fstack-protector-all -Wno-free-nonheap-object -Wno-date-time | 
| 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 | 23d1cad | 2016-05-10 13:29:58 -0700 | [diff] [blame] | 68 | LOCAL_SHARED_LIBRARIES := libcutils 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 | 
|  | 94 | LOCAL_SHARED_LIBRARIES := libcutils liblog | 
|  | 95 |  | 
|  | 96 | # The arm emulator has VFP but not VFPv3-D32. | 
|  | 97 | ifeq ($(ARCH_ARM_HAVE_VFP_D32),true) | 
|  | 98 | LOCAL_ASFLAGS_arm += -DHAS_VFP_D32 | 
|  | 99 | endif | 
|  | 100 |  | 
|  | 101 | LOCAL_MODULE := static_crasher | 
|  | 102 | LOCAL_MODULE_STEM_32 := static_crasher | 
|  | 103 | LOCAL_MODULE_STEM_64 := static_crasher64 | 
|  | 104 | LOCAL_MULTILIB := both | 
|  | 105 |  | 
|  | 106 | LOCAL_STATIC_LIBRARIES := libdebuggerd_client libcutils liblog | 
|  | 107 |  | 
|  | 108 | include $(BUILD_EXECUTABLE) | 
|  | 109 |  | 
| Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 110 | debuggerd_test_src_files := \ | 
| Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 111 | utility.cpp \ | 
|  | 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 \ | 
| Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 115 | test/property_fake.cpp \ | 
|  | 116 | test/ptrace_fake.cpp \ | 
| Christopher Ferris | b36b592 | 2015-06-17 18:35:59 -0700 | [diff] [blame] | 117 | test/tombstone_test.cpp \ | 
| Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 118 | test/selinux_fake.cpp \ | 
| Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 119 |  | 
| Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 120 | debuggerd_shared_libraries := \ | 
| Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 121 | libbacktrace \ | 
|  | 122 | libbase \ | 
| Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 123 | libcutils \ | 
| Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 124 |  | 
| Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 125 | debuggerd_c_includes := \ | 
|  | 126 | $(LOCAL_PATH)/test \ | 
|  | 127 |  | 
|  | 128 | debuggerd_cpp_flags := \ | 
|  | 129 | $(common_cppflags) \ | 
|  | 130 | -Wno-missing-field-initializers \ | 
| Yabin Cui | 9e402bb | 2015-09-22 04:46:57 +0000 | [diff] [blame] | 131 | -fno-rtti \ | 
| Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 132 |  | 
| Pirama Arumuga Nainar | 6fbbc4c | 2016-06-28 16:07:53 -0700 | [diff] [blame] | 133 | # Bug: http://b/29823425 Disable -Wvarargs for Clang update to r271374 | 
|  | 134 | debuggerd_cpp_flags += -Wno-varargs | 
|  | 135 |  | 
| Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 136 | # Only build the host tests on linux. | 
|  | 137 | ifeq ($(HOST_OS),linux) | 
|  | 138 |  | 
|  | 139 | include $(CLEAR_VARS) | 
|  | 140 |  | 
|  | 141 | LOCAL_MODULE := debuggerd_test | 
|  | 142 | LOCAL_SRC_FILES := $(debuggerd_test_src_files) | 
|  | 143 | LOCAL_SHARED_LIBRARIES := $(debuggerd_shared_libraries) | 
|  | 144 | LOCAL_C_INCLUDES := $(debuggerd_c_includes) | 
|  | 145 | LOCAL_CPPFLAGS := $(debuggerd_cpp_flags) | 
| Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 146 |  | 
|  | 147 | LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 | 
|  | 148 | LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 | 
|  | 149 | LOCAL_MULTILIB := both | 
| Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 150 | include $(BUILD_HOST_NATIVE_TEST) | 
|  | 151 |  | 
| Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 152 | endif | 
|  | 153 |  | 
| Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 154 | include $(CLEAR_VARS) | 
|  | 155 |  | 
| Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 156 | LOCAL_MODULE := debuggerd_test | 
| Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 157 | LOCAL_SRC_FILES := $(debuggerd_test_src_files) | 
|  | 158 | LOCAL_SHARED_LIBRARIES := $(debuggerd_shared_libraries) | 
|  | 159 | LOCAL_C_INCLUDES := $(debuggerd_c_includes) | 
|  | 160 | LOCAL_CPPFLAGS := $(debuggerd_cpp_flags) | 
| Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 161 |  | 
|  | 162 | LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 | 
|  | 163 | LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 | 
|  | 164 | LOCAL_MULTILIB := both | 
| Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 165 | include $(BUILD_NATIVE_TEST) |