1LOCAL_PATH := $(call my-dir) 2 3common_cppflags := \ 4 -std=gnu++11 \ 5 -W \ 6 -Wall \ 7 -Wextra \ 8 -Wunused \ 9 -Werror \ 10 11include $(CLEAR_VARS) 12 13LOCAL_SRC_FILES:= \ 14 backtrace.cpp \ 15 debuggerd.cpp \ 16 elf_utils.cpp \ 17 getevent.cpp \ 18 tombstone.cpp \ 19 utility.cpp \ 20 21LOCAL_SRC_FILES_arm := arm/machine.cpp 22LOCAL_SRC_FILES_arm64 := arm64/machine.cpp 23LOCAL_SRC_FILES_mips := mips/machine.cpp 24LOCAL_SRC_FILES_mips64 := mips64/machine.cpp 25LOCAL_SRC_FILES_x86 := x86/machine.cpp 26LOCAL_SRC_FILES_x86_64 := x86_64/machine.cpp 27 28LOCAL_CPPFLAGS := $(common_cppflags) 29 30ifeq ($(TARGET_IS_64_BIT),true) 31LOCAL_CPPFLAGS += -DTARGET_IS_64_BIT 32endif 33 34LOCAL_SHARED_LIBRARIES := \ 35 libbacktrace \ 36 libbase \ 37 libcutils \ 38 liblog \ 39 libselinux \ 40 41LOCAL_CLANG := true 42 43LOCAL_MODULE := debuggerd 44LOCAL_MODULE_STEM_32 := debuggerd 45LOCAL_MODULE_STEM_64 := debuggerd64 46LOCAL_MULTILIB := both 47 48include $(BUILD_EXECUTABLE) 49 50 51 52include $(CLEAR_VARS) 53LOCAL_SRC_FILES := crasher.c 54LOCAL_SRC_FILES_arm := arm/crashglue.S 55LOCAL_SRC_FILES_arm64 := arm64/crashglue.S 56LOCAL_SRC_FILES_mips := mips/crashglue.S 57LOCAL_SRC_FILES_mips64 := mips64/crashglue.S 58LOCAL_SRC_FILES_x86 := x86/crashglue.S 59LOCAL_SRC_FILES_x86_64 := x86_64/crashglue.S 60LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) 61LOCAL_MODULE_TAGS := optional 62LOCAL_CFLAGS += -fstack-protector-all -Werror -Wno-free-nonheap-object 63#LOCAL_FORCE_STATIC_EXECUTABLE := true 64LOCAL_SHARED_LIBRARIES := libcutils liblog libc 65 66# The arm emulator has VFP but not VFPv3-D32. 67ifeq ($(ARCH_ARM_HAVE_VFP_D32),true) 68LOCAL_ASFLAGS_arm += -DHAS_VFP_D32 69endif 70 71LOCAL_MODULE := crasher 72LOCAL_MODULE_STEM_32 := crasher 73LOCAL_MODULE_STEM_64 := crasher64 74LOCAL_MULTILIB := both 75 76include $(BUILD_EXECUTABLE) 77 78debuggerd_test_src_files := \ 79 utility.cpp \ 80 test/dump_maps_test.cpp \ 81 test/dump_memory_test.cpp \ 82 test/elf_fake.cpp \ 83 test/log_fake.cpp \ 84 test/property_fake.cpp \ 85 test/ptrace_fake.cpp \ 86 test/selinux_fake.cpp \ 87 88debuggerd_shared_libraries := \ 89 libbacktrace \ 90 libbase \ 91 libcutils \ 92 93debuggerd_c_includes := \ 94 $(LOCAL_PATH)/test \ 95 96debuggerd_cpp_flags := \ 97 $(common_cppflags) \ 98 -Wno-missing-field-initializers \ 99 100# Only build the host tests on linux. 101ifeq ($(HOST_OS),linux) 102 103include $(CLEAR_VARS) 104 105LOCAL_MODULE := debuggerd_test 106LOCAL_SRC_FILES := $(debuggerd_test_src_files) 107LOCAL_SHARED_LIBRARIES := $(debuggerd_shared_libraries) 108LOCAL_C_INCLUDES := $(debuggerd_c_includes) 109LOCAL_CPPFLAGS := $(debuggerd_cpp_flags) 110 111LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 112LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 113LOCAL_MULTILIB := both 114include $(BUILD_HOST_NATIVE_TEST) 115 116endif 117 118include $(CLEAR_VARS) 119 120LOCAL_MODULE := debuggerd_test 121LOCAL_SRC_FILES := $(debuggerd_test_src_files) 122LOCAL_SHARED_LIBRARIES := $(debuggerd_shared_libraries) 123LOCAL_C_INCLUDES := $(debuggerd_c_includes) 124LOCAL_CPPFLAGS := $(debuggerd_cpp_flags) 125 126LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 127LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 128LOCAL_MULTILIB := both 129include $(BUILD_NATIVE_TEST) 130