blob: 9e4f1f7d2f3d6ac5da63c58756c4296314eb5418 [file] [log] [blame]
Christopher Ferrise8bc77e2015-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 Ferrise8bc77e2015-05-22 14:26:13 -070028LOCAL_CPPFLAGS := $(common_cppflags)
Colin Cross87a6b1d2014-03-21 16:58:30 -070029
Tom Cherry20391b12015-08-14 13:02:51 -070030LOCAL_INIT_RC_32 := debuggerd.rc
31LOCAL_INIT_RC_64 := debuggerd64.rc
32
Christopher Ferris9774df62015-01-15 14:47:36 -080033ifeq ($(TARGET_IS_64_BIT),true)
34LOCAL_CPPFLAGS += -DTARGET_IS_64_BIT
35endif
36
Colin Cross87a6b1d2014-03-21 16:58:30 -070037LOCAL_SHARED_LIBRARIES := \
Elliott Hughes8c597682014-06-03 15:12:07 -070038 libbacktrace \
Christopher Ferrisa21bd932015-02-27 13:39:47 -080039 libbase \
Elliott Hughes8c597682014-06-03 15:12:07 -070040 libcutils \
41 liblog \
42 libselinux \
Colin Cross87a6b1d2014-03-21 16:58:30 -070043
Elliott Hughesc184d562014-12-18 15:47:09 -080044LOCAL_CLANG := true
45
Colin Cross87a6b1d2014-03-21 16:58:30 -070046LOCAL_MODULE := debuggerd
47LOCAL_MODULE_STEM_32 := debuggerd
48LOCAL_MODULE_STEM_64 := debuggerd64
49LOCAL_MULTILIB := both
50
51include $(BUILD_EXECUTABLE)
52
Elliott Hughescb7aae12014-07-09 16:41:04 -070053
54
Colin Cross87a6b1d2014-03-21 16:58:30 -070055include $(CLEAR_VARS)
56LOCAL_SRC_FILES := crasher.c
57LOCAL_SRC_FILES_arm := arm/crashglue.S
58LOCAL_SRC_FILES_arm64 := arm64/crashglue.S
59LOCAL_SRC_FILES_mips := mips/crashglue.S
Douglas Leung2ea9a322015-03-09 18:41:32 -070060LOCAL_SRC_FILES_mips64 := mips64/crashglue.S
Colin Cross87a6b1d2014-03-21 16:58:30 -070061LOCAL_SRC_FILES_x86 := x86/crashglue.S
62LOCAL_SRC_FILES_x86_64 := x86_64/crashglue.S
63LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
64LOCAL_MODULE_TAGS := optional
Dan Willemsen9bef9662015-11-02 15:41:59 -080065LOCAL_CFLAGS += -fstack-protector-all -Werror -Wno-free-nonheap-object -Wno-date-time
Colin Cross87a6b1d2014-03-21 16:58:30 -070066#LOCAL_FORCE_STATIC_EXECUTABLE := true
67LOCAL_SHARED_LIBRARIES := libcutils liblog libc
68
Elliott Hughescb7aae12014-07-09 16:41:04 -070069# The arm emulator has VFP but not VFPv3-D32.
70ifeq ($(ARCH_ARM_HAVE_VFP_D32),true)
71LOCAL_ASFLAGS_arm += -DHAS_VFP_D32
72endif
73
Colin Cross87a6b1d2014-03-21 16:58:30 -070074LOCAL_MODULE := crasher
75LOCAL_MODULE_STEM_32 := crasher
76LOCAL_MODULE_STEM_64 := crasher64
77LOCAL_MULTILIB := both
78
79include $(BUILD_EXECUTABLE)
Christopher Ferrise8bc77e2015-05-22 14:26:13 -070080
Christopher Ferris862fe022015-06-02 14:52:44 -070081debuggerd_test_src_files := \
Christopher Ferrise8bc77e2015-05-22 14:26:13 -070082 utility.cpp \
83 test/dump_memory_test.cpp \
Christopher Ferris862fe022015-06-02 14:52:44 -070084 test/elf_fake.cpp \
Christopher Ferrise8bc77e2015-05-22 14:26:13 -070085 test/log_fake.cpp \
Christopher Ferris862fe022015-06-02 14:52:44 -070086 test/property_fake.cpp \
87 test/ptrace_fake.cpp \
Christopher Ferrisb36b5922015-06-17 18:35:59 -070088 test/tombstone_test.cpp \
Christopher Ferris862fe022015-06-02 14:52:44 -070089 test/selinux_fake.cpp \
Christopher Ferrise8bc77e2015-05-22 14:26:13 -070090
Christopher Ferris862fe022015-06-02 14:52:44 -070091debuggerd_shared_libraries := \
Christopher Ferrise8bc77e2015-05-22 14:26:13 -070092 libbacktrace \
93 libbase \
Christopher Ferris862fe022015-06-02 14:52:44 -070094 libcutils \
Christopher Ferrise8bc77e2015-05-22 14:26:13 -070095
Christopher Ferris862fe022015-06-02 14:52:44 -070096debuggerd_c_includes := \
97 $(LOCAL_PATH)/test \
98
99debuggerd_cpp_flags := \
100 $(common_cppflags) \
101 -Wno-missing-field-initializers \
Yabin Cui9e402bb2015-09-22 04:46:57 +0000102 -fno-rtti \
Christopher Ferris862fe022015-06-02 14:52:44 -0700103
104# Only build the host tests on linux.
105ifeq ($(HOST_OS),linux)
106
107include $(CLEAR_VARS)
108
109LOCAL_MODULE := debuggerd_test
110LOCAL_SRC_FILES := $(debuggerd_test_src_files)
111LOCAL_SHARED_LIBRARIES := $(debuggerd_shared_libraries)
112LOCAL_C_INCLUDES := $(debuggerd_c_includes)
113LOCAL_CPPFLAGS := $(debuggerd_cpp_flags)
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700114
115LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
116LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
117LOCAL_MULTILIB := both
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700118include $(BUILD_HOST_NATIVE_TEST)
119
Christopher Ferris862fe022015-06-02 14:52:44 -0700120endif
121
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700122include $(CLEAR_VARS)
123
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700124LOCAL_MODULE := debuggerd_test
Christopher Ferris862fe022015-06-02 14:52:44 -0700125LOCAL_SRC_FILES := $(debuggerd_test_src_files)
126LOCAL_SHARED_LIBRARIES := $(debuggerd_shared_libraries)
127LOCAL_C_INCLUDES := $(debuggerd_c_includes)
128LOCAL_CPPFLAGS := $(debuggerd_cpp_flags)
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700129
130LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
131LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
132LOCAL_MULTILIB := both
Christopher Ferrise8bc77e2015-05-22 14:26:13 -0700133include $(BUILD_NATIVE_TEST)