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 | |
Ben Cheng | bdcff7d | 2009-12-17 12:50:58 -0800 | [diff] [blame] | 11 | include $(CLEAR_VARS) |
Colin Cross | e951f60 | 2010-03-08 19:21:07 -0800 | [diff] [blame] | 12 | |
Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 13 | LOCAL_SRC_FILES:= \ |
Elliott Hughes | 8c59768 | 2014-06-03 15:12:07 -0700 | [diff] [blame] | 14 | backtrace.cpp \ |
| 15 | debuggerd.cpp \ |
Christopher Ferris | a21bd93 | 2015-02-27 13:39:47 -0800 | [diff] [blame] | 16 | elf_utils.cpp \ |
Elliott Hughes | 8c59768 | 2014-06-03 15:12:07 -0700 | [diff] [blame] | 17 | getevent.cpp \ |
| 18 | tombstone.cpp \ |
| 19 | utility.cpp \ |
Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 20 | |
| 21 | LOCAL_SRC_FILES_arm := arm/machine.cpp |
| 22 | LOCAL_SRC_FILES_arm64 := arm64/machine.cpp |
| 23 | LOCAL_SRC_FILES_mips := mips/machine.cpp |
Douglas Leung | 2ea9a32 | 2015-03-09 18:41:32 -0700 | [diff] [blame] | 24 | LOCAL_SRC_FILES_mips64 := mips64/machine.cpp |
Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 25 | LOCAL_SRC_FILES_x86 := x86/machine.cpp |
| 26 | LOCAL_SRC_FILES_x86_64 := x86_64/machine.cpp |
| 27 | |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 28 | LOCAL_CPPFLAGS := $(common_cppflags) |
Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 29 | |
Tom Cherry | 20391b1 | 2015-08-14 13:02:51 -0700 | [diff] [blame] | 30 | LOCAL_INIT_RC_32 := debuggerd.rc |
| 31 | LOCAL_INIT_RC_64 := debuggerd64.rc |
| 32 | |
Christopher Ferris | 9774df6 | 2015-01-15 14:47:36 -0800 | [diff] [blame] | 33 | ifeq ($(TARGET_IS_64_BIT),true) |
| 34 | LOCAL_CPPFLAGS += -DTARGET_IS_64_BIT |
| 35 | endif |
| 36 | |
Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 37 | LOCAL_SHARED_LIBRARIES := \ |
Elliott Hughes | 8c59768 | 2014-06-03 15:12:07 -0700 | [diff] [blame] | 38 | libbacktrace \ |
Christopher Ferris | a21bd93 | 2015-02-27 13:39:47 -0800 | [diff] [blame] | 39 | libbase \ |
Elliott Hughes | 8c59768 | 2014-06-03 15:12:07 -0700 | [diff] [blame] | 40 | libcutils \ |
| 41 | liblog \ |
| 42 | libselinux \ |
Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 43 | |
Elliott Hughes | c184d56 | 2014-12-18 15:47:09 -0800 | [diff] [blame] | 44 | LOCAL_CLANG := true |
| 45 | |
Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 46 | LOCAL_MODULE := debuggerd |
| 47 | LOCAL_MODULE_STEM_32 := debuggerd |
| 48 | LOCAL_MODULE_STEM_64 := debuggerd64 |
| 49 | LOCAL_MULTILIB := both |
| 50 | |
| 51 | include $(BUILD_EXECUTABLE) |
| 52 | |
Elliott Hughes | cb7aae1 | 2014-07-09 16:41:04 -0700 | [diff] [blame] | 53 | |
| 54 | |
Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 55 | include $(CLEAR_VARS) |
| 56 | LOCAL_SRC_FILES := crasher.c |
| 57 | LOCAL_SRC_FILES_arm := arm/crashglue.S |
| 58 | LOCAL_SRC_FILES_arm64 := arm64/crashglue.S |
| 59 | LOCAL_SRC_FILES_mips := mips/crashglue.S |
Douglas Leung | 2ea9a32 | 2015-03-09 18:41:32 -0700 | [diff] [blame] | 60 | LOCAL_SRC_FILES_mips64 := mips64/crashglue.S |
Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 61 | LOCAL_SRC_FILES_x86 := x86/crashglue.S |
| 62 | LOCAL_SRC_FILES_x86_64 := x86_64/crashglue.S |
| 63 | LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) |
| 64 | LOCAL_MODULE_TAGS := optional |
Mark Salyzyn | f1a8dfa | 2014-04-30 09:24:08 -0700 | [diff] [blame] | 65 | LOCAL_CFLAGS += -fstack-protector-all -Werror -Wno-free-nonheap-object |
Colin Cross | 87a6b1d | 2014-03-21 16:58:30 -0700 | [diff] [blame] | 66 | #LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 67 | LOCAL_SHARED_LIBRARIES := libcutils liblog libc |
| 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 | |
Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 81 | debuggerd_test_src_files := \ |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 82 | utility.cpp \ |
| 83 | test/dump_memory_test.cpp \ |
Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 84 | test/elf_fake.cpp \ |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 85 | test/log_fake.cpp \ |
Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 86 | test/property_fake.cpp \ |
| 87 | test/ptrace_fake.cpp \ |
Christopher Ferris | b36b592 | 2015-06-17 18:35:59 -0700 | [diff] [blame] | 88 | test/tombstone_test.cpp \ |
Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 89 | test/selinux_fake.cpp \ |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 90 | |
Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 91 | debuggerd_shared_libraries := \ |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 92 | libbacktrace \ |
| 93 | libbase \ |
Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 94 | libcutils \ |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 95 | |
Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 96 | debuggerd_c_includes := \ |
| 97 | $(LOCAL_PATH)/test \ |
| 98 | |
| 99 | debuggerd_cpp_flags := \ |
| 100 | $(common_cppflags) \ |
| 101 | -Wno-missing-field-initializers \ |
Yabin Cui | 9e402bb | 2015-09-22 04:46:57 +0000 | [diff] [blame] | 102 | -fno-rtti \ |
Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 103 | |
| 104 | # Only build the host tests on linux. |
| 105 | ifeq ($(HOST_OS),linux) |
| 106 | |
| 107 | include $(CLEAR_VARS) |
| 108 | |
| 109 | LOCAL_MODULE := debuggerd_test |
| 110 | LOCAL_SRC_FILES := $(debuggerd_test_src_files) |
| 111 | LOCAL_SHARED_LIBRARIES := $(debuggerd_shared_libraries) |
| 112 | LOCAL_C_INCLUDES := $(debuggerd_c_includes) |
| 113 | LOCAL_CPPFLAGS := $(debuggerd_cpp_flags) |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 114 | |
| 115 | LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 |
| 116 | LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 |
| 117 | LOCAL_MULTILIB := both |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 118 | include $(BUILD_HOST_NATIVE_TEST) |
| 119 | |
Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 120 | endif |
| 121 | |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 122 | include $(CLEAR_VARS) |
| 123 | |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 124 | LOCAL_MODULE := debuggerd_test |
Christopher Ferris | 862fe02 | 2015-06-02 14:52:44 -0700 | [diff] [blame] | 125 | LOCAL_SRC_FILES := $(debuggerd_test_src_files) |
| 126 | LOCAL_SHARED_LIBRARIES := $(debuggerd_shared_libraries) |
| 127 | LOCAL_C_INCLUDES := $(debuggerd_c_includes) |
| 128 | LOCAL_CPPFLAGS := $(debuggerd_cpp_flags) |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 129 | |
| 130 | LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 |
| 131 | LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 |
| 132 | LOCAL_MULTILIB := both |
Christopher Ferris | e8bc77e | 2015-05-22 14:26:13 -0700 | [diff] [blame] | 133 | include $(BUILD_NATIVE_TEST) |