1 # Copyright (C) 2013 The Android Open Source Project 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 15 LOCAL_PATH := $(call my-dir) 16 17 LIBDWFL_SRC_FILES := \ 18 core-file.c \ 19 cu.c \ 20 derelocate.c \ 21 dwfl_addrdie.c \ 22 dwfl_addrdwarf.c \ 23 dwfl_addrmodule.c \ 24 dwfl_begin.c \ 25 dwfl_build_id_find_debuginfo.c \ 26 dwfl_build_id_find_elf.c \ 27 dwfl_cumodule.c \ 28 dwfl_dwarf_line.c \ 29 dwfl_end.c \ 30 dwfl_error.c \ 31 dwfl_frame.c \ 32 dwfl_frame_pc.c \ 33 dwfl_frame_regs.c \ 34 dwfl_getdwarf.c \ 35 dwfl_getmodules.c \ 36 dwfl_getsrc.c \ 37 dwfl_getsrclines.c \ 38 dwfl_line_comp_dir.c \ 39 dwfl_linecu.c \ 40 dwfl_lineinfo.c \ 41 dwfl_linemodule.c \ 42 dwfl_module_addrdie.c \ 43 dwfl_module_addrname.c \ 44 dwfl_module_addrsym.c \ 45 dwfl_module_build_id.c \ 46 dwfl_module.c \ 47 dwfl_module_dwarf_cfi.c \ 48 dwfl_module_eh_cfi.c \ 49 dwfl_module_getdwarf.c \ 50 dwfl_module_getelf.c \ 51 dwfl_module_getsrc.c \ 52 dwfl_module_getsrc_file.c \ 53 dwfl_module_getsym.c \ 54 dwfl_module_info.c \ 55 dwfl_module_nextcu.c \ 56 dwfl_module_register_names.c \ 57 dwfl_module_report_build_id.c \ 58 dwfl_module_return_value_location.c \ 59 dwfl_nextcu.c \ 60 dwfl_onesrcline.c \ 61 dwfl_report_elf.c \ 62 dwfl_segment_report_module.c \ 63 dwfl_validate_address.c \ 64 dwfl_version.c \ 65 elf-from-memory.c \ 66 find-debuginfo.c \ 67 frame_unwind.c \ 68 gzip.c \ 69 image-header.c \ 70 libdwfl_crc32.c \ 71 libdwfl_crc32_file.c \ 72 lines.c \ 73 link_map.c \ 74 linux-core-attach.c \ 75 linux-kernel-modules.c \ 76 linux-pid-attach.c \ 77 linux-proc-maps.c \ 78 offline.c \ 79 open.c \ 80 relocate.c \ 81 segment.c \ 82 83 84 ifeq ($(HOST_OS),linux) 85 86 # 87 # host libdwfl 88 # 89 90 include $(CLEAR_VARS) 91 92 # Clang has no nested functions. 93 LOCAL_CLANG := false 94 95 LOCAL_SRC_FILES := $(LIBDWFL_SRC_FILES) 96 97 LOCAL_C_INCLUDES := \ 98 $(LOCAL_PATH)/.. \ 99 $(LOCAL_PATH)/../lib \ 100 $(LOCAL_PATH)/../libdwelf \ 101 $(LOCAL_PATH)/../libdwfl \ 102 $(LOCAL_PATH)/../libebl \ 103 $(LOCAL_PATH)/../libdw \ 104 $(LOCAL_PATH)/../libelf 105 106 LOCAL_CFLAGS += -DHAVE_CONFIG_H -std=gnu99 -D_GNU_SOURCE 107 108 # to suppress the "pointer of type void * used in arithmetic" warning 109 LOCAL_CFLAGS += -Wno-pointer-arith 110 111 # Asserts are not compiled, so some debug variables appear unused. Rather than 112 # fix, we prefer to turn off the warning locally. 113 LOCAL_CFLAGS += -Wno-unused-but-set-variable 114 115 LOCAL_MODULE:= libdwfl 116 117 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 118 119 LOCAL_STATIC_LIBRARIES := libz 120 121 include $(BUILD_HOST_STATIC_LIBRARY) 122 123 endif # linux 124 125 # 126 # target libdwfl 127 # 128 129 include $(CLEAR_VARS) 130 131 # Clang has no nested functions. 132 LOCAL_CLANG := false 133 134 LOCAL_SRC_FILES := $(LIBDWFL_SRC_FILES) 135 136 LOCAL_C_INCLUDES := \ 137 $(LOCAL_PATH)/.. \ 138 $(LOCAL_PATH)/../lib \ 139 $(LOCAL_PATH)/../libdwelf \ 140 $(LOCAL_PATH)/../libdwfl \ 141 $(LOCAL_PATH)/../libebl \ 142 $(LOCAL_PATH)/../libdw \ 143 $(LOCAL_PATH)/../libelf 144 145 LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../bionic-fixup 146 147 LOCAL_CFLAGS += -include $(LOCAL_PATH)/../../bionic-fixup/AndroidFixup.h 148 149 LOCAL_CFLAGS += -DHAVE_CONFIG_H -std=gnu99 -D_GNU_SOURCE -Werror 150 151 # to suppress the "pointer of type void * used in arithmetic" warning 152 LOCAL_CFLAGS += -Wno-pointer-arith 153 154 # See above. 155 LOCAL_CFLAGS += -Wno-unused-but-set-variable 156 157 LOCAL_MODULE:= libdwfl 158 159 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 160 161 LOCAL_STATIC_LIBRARIES := libz 162 163 include $(BUILD_STATIC_LIBRARY) 164