blob: 6cfb5413db30e8c0fe77460b833e55e7b2715c8e [file] [log] [blame]
Christopher Ferris0c3f1ae2015-05-22 14:26:13 -07001LOCAL_PATH := $(call my-dir)
2
3common_cppflags := \
4 -std=gnu++11 \
5 -W \
6 -Wall \
7 -Wextra \
8 -Wunused \
9 -Werror \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080010
Ben Chengbdcff7d2009-12-17 12:50:58 -080011include $(CLEAR_VARS)
Colin Crosse951f602010-03-08 19:21:07 -080012
Colin Cross87a6b1d2014-03-21 16:58:30 -070013LOCAL_SRC_FILES:= \
Elliott Hughes8c597682014-06-03 15:12:07 -070014 backtrace.cpp \
15 debuggerd.cpp \
Christopher Ferrisa21bd932015-02-27 13:39:47 -080016 elf_utils.cpp \
Elliott Hughes8c597682014-06-03 15:12:07 -070017 getevent.cpp \
18 tombstone.cpp \
19 utility.cpp \
Colin Cross87a6b1d2014-03-21 16:58:30 -070020
21LOCAL_SRC_FILES_arm := arm/machine.cpp
22LOCAL_SRC_FILES_arm64 := arm64/machine.cpp
23LOCAL_SRC_FILES_mips := mips/machine.cpp
Douglas Leung2ea9a322015-03-09 18:41:32 -070024LOCAL_SRC_FILES_mips64 := mips64/machine.cpp
Colin Cross87a6b1d2014-03-21 16:58:30 -070025LOCAL_SRC_FILES_x86 := x86/machine.cpp
26LOCAL_SRC_FILES_x86_64 := x86_64/machine.cpp
27
Christopher Ferris0c3f1ae2015-05-22 14:26:13 -070028LOCAL_CPPFLAGS := $(common_cppflags)
Colin Cross87a6b1d2014-03-21 16:58:30 -070029
Christopher Ferris9774df62015-01-15 14:47:36 -080030ifeq ($(TARGET_IS_64_BIT),true)
31LOCAL_CPPFLAGS += -DTARGET_IS_64_BIT
32endif
33
Colin Cross87a6b1d2014-03-21 16:58:30 -070034LOCAL_SHARED_LIBRARIES := \
Elliott Hughes8c597682014-06-03 15:12:07 -070035 libbacktrace \
Christopher Ferrisa21bd932015-02-27 13:39:47 -080036 libbase \
Elliott Hughes8c597682014-06-03 15:12:07 -070037 libcutils \
38 liblog \
39 libselinux \
Colin Cross87a6b1d2014-03-21 16:58:30 -070040
Elliott Hughesc184d562014-12-18 15:47:09 -080041LOCAL_CLANG := true
42
Colin Cross87a6b1d2014-03-21 16:58:30 -070043LOCAL_MODULE := debuggerd
44LOCAL_MODULE_STEM_32 := debuggerd
45LOCAL_MODULE_STEM_64 := debuggerd64
46LOCAL_MULTILIB := both
47
48include $(BUILD_EXECUTABLE)
49
Elliott Hughescb7aae12014-07-09 16:41:04 -070050
51
Colin Cross87a6b1d2014-03-21 16:58:30 -070052include $(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
Douglas Leung2ea9a322015-03-09 18:41:32 -070057LOCAL_SRC_FILES_mips64 := mips64/crashglue.S
Colin Cross87a6b1d2014-03-21 16:58:30 -070058LOCAL_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
Mark Salyzynf1a8dfa2014-04-30 09:24:08 -070062LOCAL_CFLAGS += -fstack-protector-all -Werror -Wno-free-nonheap-object
Colin Cross87a6b1d2014-03-21 16:58:30 -070063#LOCAL_FORCE_STATIC_EXECUTABLE := true
64LOCAL_SHARED_LIBRARIES := libcutils liblog libc
65
Elliott Hughescb7aae12014-07-09 16:41:04 -070066# The arm emulator has VFP but not VFPv3-D32.
67ifeq ($(ARCH_ARM_HAVE_VFP_D32),true)
68LOCAL_ASFLAGS_arm += -DHAS_VFP_D32
69endif
70
Colin Cross87a6b1d2014-03-21 16:58:30 -070071LOCAL_MODULE := crasher
72LOCAL_MODULE_STEM_32 := crasher
73LOCAL_MODULE_STEM_64 := crasher64
74LOCAL_MULTILIB := both
75
76include $(BUILD_EXECUTABLE)
Christopher Ferris0c3f1ae2015-05-22 14:26:13 -070077
Christopher Ferris21bd0402015-06-02 14:52:44 -070078debuggerd_test_src_files := \
Christopher Ferris0c3f1ae2015-05-22 14:26:13 -070079 utility.cpp \
Christopher Ferris21bd0402015-06-02 14:52:44 -070080 test/dump_maps_test.cpp \
Christopher Ferris0c3f1ae2015-05-22 14:26:13 -070081 test/dump_memory_test.cpp \
Christopher Ferris21bd0402015-06-02 14:52:44 -070082 test/elf_fake.cpp \
Christopher Ferris0c3f1ae2015-05-22 14:26:13 -070083 test/log_fake.cpp \
Christopher Ferris21bd0402015-06-02 14:52:44 -070084 test/property_fake.cpp \
85 test/ptrace_fake.cpp \
86 test/selinux_fake.cpp \
Christopher Ferris0c3f1ae2015-05-22 14:26:13 -070087
Christopher Ferris21bd0402015-06-02 14:52:44 -070088debuggerd_shared_libraries := \
Christopher Ferris0c3f1ae2015-05-22 14:26:13 -070089 libbacktrace \
90 libbase \
Christopher Ferris21bd0402015-06-02 14:52:44 -070091 libcutils \
Christopher Ferris0c3f1ae2015-05-22 14:26:13 -070092
Christopher Ferris21bd0402015-06-02 14:52:44 -070093debuggerd_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)
Christopher Ferris0c3f1ae2015-05-22 14:26:13 -0700110
111LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
112LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
113LOCAL_MULTILIB := both
Christopher Ferris0c3f1ae2015-05-22 14:26:13 -0700114include $(BUILD_HOST_NATIVE_TEST)
115
Christopher Ferris21bd0402015-06-02 14:52:44 -0700116endif
117
Christopher Ferris0c3f1ae2015-05-22 14:26:13 -0700118include $(CLEAR_VARS)
119
Christopher Ferris0c3f1ae2015-05-22 14:26:13 -0700120LOCAL_MODULE := debuggerd_test
Christopher Ferris21bd0402015-06-02 14:52:44 -0700121LOCAL_SRC_FILES := $(debuggerd_test_src_files)
122LOCAL_SHARED_LIBRARIES := $(debuggerd_shared_libraries)
123LOCAL_C_INCLUDES := $(debuggerd_c_includes)
124LOCAL_CPPFLAGS := $(debuggerd_cpp_flags)
Christopher Ferris0c3f1ae2015-05-22 14:26:13 -0700125
126LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
127LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
128LOCAL_MULTILIB := both
Christopher Ferris0c3f1ae2015-05-22 14:26:13 -0700129include $(BUILD_NATIVE_TEST)