| 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 \ | 
| Josh Gao | f5e8f0b | 2016-03-16 18:09:15 -0700 | [diff] [blame] | 21 | signal_sender.cpp \ | 
| Elliott Hughes | 8c59768 | 2014-06-03 15:12:07 -0700 | [diff] [blame] | 22 | tombstone.cpp \ | 
|  | 23 | utility.cpp \ | 
| Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 24 |  | 
|  | 25 | LOCAL_SRC_FILES_arm    := arm/machine.cpp | 
|  | 26 | LOCAL_SRC_FILES_arm64  := arm64/machine.cpp | 
|  | 27 | LOCAL_SRC_FILES_mips   := mips/machine.cpp | 
| Douglas Leung | 2ea9a32 | 2015-03-09 18:41:32 -0700 | [diff] [blame] | 28 | LOCAL_SRC_FILES_mips64 := mips64/machine.cpp | 
| Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 29 | LOCAL_SRC_FILES_x86    := x86/machine.cpp | 
|  | 30 | LOCAL_SRC_FILES_x86_64 := x86_64/machine.cpp | 
|  | 31 |  | 
| Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 32 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include | 
| Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 33 | LOCAL_CPPFLAGS := $(common_cppflags) | 
| Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 34 |  | 
| Tom Cherry | 20391b1 | 2015-08-14 13:02:51 -0700 | [diff] [blame] | 35 | LOCAL_INIT_RC_32 := debuggerd.rc | 
|  | 36 | LOCAL_INIT_RC_64 := debuggerd64.rc | 
|  | 37 |  | 
| Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 38 | LOCAL_SHARED_LIBRARIES := \ | 
| Elliott Hughes | 8c59768 | 2014-06-03 15:12:07 -0700 | [diff] [blame] | 39 | libbacktrace \ | 
| Christopher Ferris | a21bd93 | 2015-02-27 13:39:47 -0800 | [diff] [blame] | 40 | libbase \ | 
| Elliott Hughes | 8c59768 | 2014-06-03 15:12:07 -0700 | [diff] [blame] | 41 | libcutils \ | 
|  | 42 | liblog \ | 
|  | 43 | libselinux \ | 
| Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 44 |  | 
| Elliott Hughes | c184d56 | 2014-12-18 15:47:09 -0800 | [diff] [blame] | 45 | LOCAL_CLANG := true | 
|  | 46 |  | 
| Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 47 | LOCAL_MODULE := debuggerd | 
|  | 48 | LOCAL_MODULE_STEM_32 := debuggerd | 
|  | 49 | LOCAL_MODULE_STEM_64 := debuggerd64 | 
|  | 50 | LOCAL_MULTILIB := both | 
|  | 51 |  | 
|  | 52 | include $(BUILD_EXECUTABLE) | 
|  | 53 |  | 
| Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 54 | 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] | 55 |  | 
| Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 56 | include $(CLEAR_VARS) | 
| Elliott Hughes | 23d1cad | 2016-05-10 13:29:58 -0700 | [diff] [blame] | 57 | LOCAL_SRC_FILES := crasher.cpp | 
| Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 58 | LOCAL_SRC_FILES_arm    := arm/crashglue.S | 
|  | 59 | LOCAL_SRC_FILES_arm64  := arm64/crashglue.S | 
|  | 60 | LOCAL_SRC_FILES_mips   := mips/crashglue.S | 
| Douglas Leung | 2ea9a32 | 2015-03-09 18:41:32 -0700 | [diff] [blame] | 61 | LOCAL_SRC_FILES_mips64 := mips64/crashglue.S | 
| Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 62 | LOCAL_SRC_FILES_x86    := x86/crashglue.S | 
|  | 63 | LOCAL_SRC_FILES_x86_64 := x86_64/crashglue.S | 
|  | 64 | LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) | 
|  | 65 | LOCAL_MODULE_TAGS := optional | 
| Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 66 | LOCAL_CPPFLAGS := $(crasher_cppflags) | 
| Elliott Hughes | 23d1cad | 2016-05-10 13:29:58 -0700 | [diff] [blame] | 67 | LOCAL_SHARED_LIBRARIES := libcutils liblog | 
| Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 68 |  | 
| Elliott Hughes | cb7aae1 | 2014-07-09 16:41:04 -0700 | [diff] [blame] | 69 | # The arm emulator has VFP but not VFPv3-D32. | 
|  | 70 | ifeq ($(ARCH_ARM_HAVE_VFP_D32),true) | 
|  | 71 | LOCAL_ASFLAGS_arm += -DHAS_VFP_D32 | 
|  | 72 | endif | 
|  | 73 |  | 
| Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 74 | LOCAL_MODULE := crasher | 
|  | 75 | LOCAL_MODULE_STEM_32 := crasher | 
|  | 76 | LOCAL_MODULE_STEM_64 := crasher64 | 
|  | 77 | LOCAL_MULTILIB := both | 
|  | 78 |  | 
|  | 79 | include $(BUILD_EXECUTABLE) | 
| Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 80 |  | 
| Josh Gao | 9c02dc5 | 2016-06-15 17:29:00 -0700 | [diff] [blame] | 81 | include $(CLEAR_VARS) | 
|  | 82 | LOCAL_SRC_FILES := crasher.cpp | 
|  | 83 | LOCAL_SRC_FILES_arm    := arm/crashglue.S | 
|  | 84 | LOCAL_SRC_FILES_arm64  := arm64/crashglue.S | 
|  | 85 | LOCAL_SRC_FILES_mips   := mips/crashglue.S | 
|  | 86 | LOCAL_SRC_FILES_mips64 := mips64/crashglue.S | 
|  | 87 | LOCAL_SRC_FILES_x86    := x86/crashglue.S | 
|  | 88 | LOCAL_SRC_FILES_x86_64 := x86_64/crashglue.S | 
|  | 89 | LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) | 
|  | 90 | LOCAL_MODULE_TAGS := optional | 
|  | 91 | LOCAL_CPPFLAGS := $(crasher_cppflags) -DSTATIC_CRASHER | 
|  | 92 | LOCAL_FORCE_STATIC_EXECUTABLE := true | 
|  | 93 | LOCAL_SHARED_LIBRARIES := libcutils liblog | 
|  | 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 |  | 
|  | 105 | LOCAL_STATIC_LIBRARIES := libdebuggerd_client libcutils liblog | 
|  | 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 \ | 
|  | 111 | test/dump_memory_test.cpp \ | 
| Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 112 | test/elf_fake.cpp \ | 
| Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 113 | test/log_fake.cpp \ | 
| Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 114 | test/property_fake.cpp \ | 
|  | 115 | test/ptrace_fake.cpp \ | 
| Christopher Ferris | b36b592 | 2015-06-17 18:35:59 -0700 | [diff] [blame] | 116 | test/tombstone_test.cpp \ | 
| Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 117 | test/selinux_fake.cpp \ | 
| Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 118 |  | 
| Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 119 | debuggerd_shared_libraries := \ | 
| Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 120 | libbacktrace \ | 
|  | 121 | libbase \ | 
| Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 122 | libcutils \ | 
| Mark Salyzyn | dafe384 | 2016-03-28 15:43:50 -0700 | [diff] [blame] | 123 | liblog | 
| 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) |