Christopher Ferris | 7fb2287 | 2013-09-27 12:43:15 -0700 | [diff] [blame] | 1 | LOCAL_PATH:= $(call my-dir) |
| 2 | |
| 3 | #---------------------------------------------------------------------------- |
| 4 | # The libbacktrace library using libunwind |
| 5 | #---------------------------------------------------------------------------- |
| 6 | include $(CLEAR_VARS) |
| 7 | |
| 8 | LOCAL_SRC_FILES:= \ |
| 9 | unwind.c \ |
| 10 | unwind_remote.c \ |
| 11 | unwind_local.c \ |
| 12 | common.c \ |
| 13 | demangle.c \ |
| 14 | map_info.c \ |
| 15 | |
| 16 | LOCAL_CFLAGS := \ |
| 17 | -Wall \ |
| 18 | -Wno-unused-parameter \ |
| 19 | -Werror \ |
| 20 | -std=gnu99 \ |
| 21 | |
| 22 | LOCAL_MODULE := libbacktrace |
| 23 | LOCAL_MODULE_TAGS := optional |
| 24 | |
| 25 | LOCAL_SHARED_LIBRARIES := \ |
| 26 | liblog \ |
| 27 | libunwind \ |
| 28 | libunwind-ptrace \ |
| 29 | libgccdemangle \ |
| 30 | |
| 31 | LOCAL_C_INCLUDES := \ |
| 32 | external/libunwind/include \ |
| 33 | |
| 34 | # The libunwind code is not in the tree yet, so don't build this library yet. |
| 35 | #include $(BUILD_SHARED_LIBRARY) |
| 36 | |
| 37 | #---------------------------------------------------------------------------- |
| 38 | # The libbacktrace library using libcorkscrew |
| 39 | #---------------------------------------------------------------------------- |
| 40 | include $(CLEAR_VARS) |
| 41 | |
| 42 | LOCAL_SRC_FILES:= \ |
| 43 | corkscrew.c \ |
| 44 | common.c \ |
| 45 | demangle.c \ |
| 46 | map_info.c \ |
| 47 | |
| 48 | LOCAL_CFLAGS := \ |
| 49 | -Wall \ |
| 50 | -Wno-unused-parameter \ |
| 51 | -Werror \ |
| 52 | -std=gnu99 \ |
| 53 | |
| 54 | LOCAL_MODULE := libbacktrace |
| 55 | LOCAL_MODULE_TAGS := optional |
| 56 | |
| 57 | LOCAL_SHARED_LIBRARIES := \ |
| 58 | libcorkscrew \ |
| 59 | libdl \ |
| 60 | libgccdemangle \ |
| 61 | liblog \ |
| 62 | |
| 63 | include $(BUILD_SHARED_LIBRARY) |
| 64 | |
| 65 | #---------------------------------------------------------------------------- |
| 66 | # The host libbacktrace library using libcorkscrew |
| 67 | #---------------------------------------------------------------------------- |
| 68 | include $(CLEAR_VARS) |
| 69 | |
| 70 | LOCAL_SRC_FILES += \ |
| 71 | corkscrew.c \ |
| 72 | common.c \ |
| 73 | demangle.c \ |
| 74 | map_info.c \ |
| 75 | |
| 76 | LOCAL_CFLAGS += \ |
| 77 | -Wall \ |
| 78 | -Wno-unused-parameter \ |
| 79 | -Werror \ |
| 80 | -std=gnu99 \ |
| 81 | |
| 82 | LOCAL_SHARED_LIBRARIES := \ |
| 83 | liblog \ |
| 84 | libcorkscrew \ |
| 85 | libgccdemangle \ |
| 86 | liblog \ |
| 87 | |
| 88 | LOCAL_LDLIBS += \ |
| 89 | -ldl \ |
| 90 | -lrt \ |
| 91 | |
| 92 | LOCAL_MODULE := libbacktrace |
| 93 | LOCAL_MODULE_TAGS := optional |
| 94 | |
| 95 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 96 | |
| 97 | #---------------------------------------------------------------------------- |
| 98 | # libbacktrace test library, all optimizations turned off |
| 99 | #---------------------------------------------------------------------------- |
| 100 | include $(CLEAR_VARS) |
| 101 | |
| 102 | LOCAL_MODULE := libbacktrace_test |
| 103 | LOCAL_MODULE_FLAGS := debug |
| 104 | |
| 105 | LOCAL_SRC_FILES := \ |
| 106 | backtrace_testlib.c |
| 107 | |
| 108 | LOCAL_CFLAGS += \ |
| 109 | -std=gnu99 \ |
| 110 | -O0 \ |
| 111 | |
| 112 | include $(BUILD_SHARED_LIBRARY) |
| 113 | |
| 114 | #---------------------------------------------------------------------------- |
| 115 | # libbacktrace test executable |
| 116 | #---------------------------------------------------------------------------- |
| 117 | include $(CLEAR_VARS) |
| 118 | |
| 119 | LOCAL_MODULE := backtrace_test |
| 120 | LOCAL_MODULE_FLAGS := debug |
| 121 | |
| 122 | LOCAL_SRC_FILES := \ |
| 123 | backtrace_test.c \ |
| 124 | |
| 125 | LOCAL_CFLAGS += \ |
| 126 | -std=gnu99 \ |
| 127 | |
| 128 | LOCAL_SHARED_LIBRARIES := \ |
| 129 | libbacktrace_test \ |
| 130 | libbacktrace \ |
| 131 | |
| 132 | include $(BUILD_EXECUTABLE) |
| 133 | |
| 134 | #---------------------------------------------------------------------------- |
| 135 | # Only linux-x86 host versions of libbacktrace supported. |
| 136 | #---------------------------------------------------------------------------- |
| 137 | ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86) |
| 138 | |
| 139 | #---------------------------------------------------------------------------- |
| 140 | # libbacktrace host test library, all optimizations turned off |
| 141 | #---------------------------------------------------------------------------- |
| 142 | include $(CLEAR_VARS) |
| 143 | |
| 144 | LOCAL_MODULE := libbacktrace_test |
| 145 | LOCAL_MODULE_FLAGS := debug |
| 146 | |
| 147 | LOCAL_SRC_FILES := \ |
| 148 | backtrace_testlib.c |
| 149 | |
| 150 | LOCAL_CFLAGS += \ |
| 151 | -std=gnu99 \ |
| 152 | -O0 \ |
| 153 | |
| 154 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 155 | |
| 156 | #---------------------------------------------------------------------------- |
| 157 | # libbacktrace host test executable |
| 158 | #---------------------------------------------------------------------------- |
| 159 | include $(CLEAR_VARS) |
| 160 | |
| 161 | LOCAL_MODULE := backtrace_test |
| 162 | LOCAL_MODULE_FLAGS := debug |
| 163 | |
| 164 | LOCAL_SRC_FILES := \ |
| 165 | backtrace_test.c \ |
| 166 | |
| 167 | LOCAL_CFLAGS += \ |
| 168 | -std=gnu99 \ |
| 169 | |
| 170 | LOCAL_SHARED_LIBRARIES := \ |
| 171 | libbacktrace_test \ |
| 172 | libbacktrace \ |
| 173 | |
| 174 | include $(BUILD_HOST_EXECUTABLE) |
| 175 | |
| 176 | endif # HOST_OS-HOST_ARCH == linux-x86 |