Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 1 | LOCAL_PATH := $(call my-dir) |
| 2 | |
| 3 | libunwind_cflags := \ |
| 4 | -DHAVE_CONFIG_H \ |
| 5 | -DNDEBUG \ |
| 6 | -D_GNU_SOURCE \ |
Christopher Ferris | 9fc75e8 | 2014-01-26 21:39:06 -0800 | [diff] [blame] | 7 | -Wno-unused-parameter \ |
| 8 | |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 9 | libunwind_includes := \ |
| 10 | $(LOCAL_PATH)/src \ |
| 11 | $(LOCAL_PATH)/include \ |
Colin Cross | 26183d2 | 2014-01-24 15:59:56 -0800 | [diff] [blame^] | 12 | |
| 13 | define libunwind-arch |
| 14 | $(if $(filter arm64,$(1)),aarch64,$(1)) |
| 15 | endef |
| 16 | |
| 17 | libunwind_arches := arm arm64 mips x86 |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 18 | |
| 19 | include $(CLEAR_VARS) |
| 20 | |
| 21 | LOCAL_MODULE := libunwind |
| 22 | |
| 23 | LOCAL_CFLAGS += $(libunwind_cflags) |
| 24 | LOCAL_C_INCLUDES := $(libunwind_includes) |
Colin Cross | 26183d2 | 2014-01-24 15:59:56 -0800 | [diff] [blame^] | 25 | $(foreach arch,$(libunwind_arches), \ |
| 26 | $(eval LOCAL_C_INCLUDES_$(arch) := $(LOCAL_PATH)/include/tdep-$(call libunwind-arch,$(arch)))) |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 27 | |
| 28 | LOCAL_SRC_FILES := \ |
| 29 | src/mi/init.c \ |
| 30 | src/mi/flush_cache.c \ |
| 31 | src/mi/mempool.c \ |
| 32 | src/mi/strerror.c \ |
| 33 | src/mi/backtrace.c \ |
| 34 | src/mi/dyn-cancel.c \ |
| 35 | src/mi/dyn-info-list.c \ |
| 36 | src/mi/dyn-register.c \ |
Christopher Ferris | 16b95a6 | 2014-01-22 16:07:26 -0800 | [diff] [blame] | 37 | src/mi/maps.c \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 38 | src/mi/Ldyn-extract.c \ |
| 39 | src/mi/Lfind_dynamic_proc_info.c \ |
| 40 | src/mi/Lget_proc_info_by_ip.c \ |
| 41 | src/mi/Lget_proc_name.c \ |
| 42 | src/mi/Lput_dynamic_unwind_info.c \ |
| 43 | src/mi/Ldestroy_addr_space.c \ |
| 44 | src/mi/Lget_reg.c \ |
| 45 | src/mi/Lset_reg.c \ |
| 46 | src/mi/Lget_fpreg.c \ |
| 47 | src/mi/Lset_fpreg.c \ |
| 48 | src/mi/Lset_caching_policy.c \ |
| 49 | src/mi/Gdyn-extract.c \ |
| 50 | src/mi/Gdyn-remote.c \ |
| 51 | src/mi/Gfind_dynamic_proc_info.c \ |
| 52 | src/mi/Gget_accessors.c \ |
| 53 | src/mi/Gget_proc_info_by_ip.c \ |
| 54 | src/mi/Gget_proc_name.c \ |
| 55 | src/mi/Gput_dynamic_unwind_info.c \ |
| 56 | src/mi/Gdestroy_addr_space.c \ |
| 57 | src/mi/Gget_reg.c \ |
| 58 | src/mi/Gset_reg.c \ |
| 59 | src/mi/Gget_fpreg.c \ |
| 60 | src/mi/Gset_fpreg.c \ |
| 61 | src/mi/Gset_caching_policy.c \ |
| 62 | src/dwarf/Lexpr.c \ |
| 63 | src/dwarf/Lfde.c \ |
| 64 | src/dwarf/Lparser.c \ |
| 65 | src/dwarf/Lpe.c \ |
| 66 | src/dwarf/Lstep.c \ |
| 67 | src/dwarf/Lfind_proc_info-lsb.c \ |
| 68 | src/dwarf/Lfind_unwind_table.c \ |
| 69 | src/dwarf/Gexpr.c \ |
| 70 | src/dwarf/Gfde.c \ |
| 71 | src/dwarf/Gfind_proc_info-lsb.c \ |
| 72 | src/dwarf/Gfind_unwind_table.c \ |
| 73 | src/dwarf/Gparser.c \ |
| 74 | src/dwarf/Gpe.c \ |
| 75 | src/dwarf/Gstep.c \ |
| 76 | src/dwarf/global.c \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 77 | src/os-linux.c \ |
| 78 | |
Colin Cross | 26183d2 | 2014-01-24 15:59:56 -0800 | [diff] [blame^] | 79 | # 64-bit architectures |
| 80 | LOCAL_SRC_FILES_arm64 += src/elf64.c |
| 81 | |
| 82 | # 32-bit architectures |
| 83 | LOCAL_SRC_FILES_arm += src/elf32.c |
| 84 | LOCAL_SRC_FILES_mips += src/elf32.c |
| 85 | LOCAL_SRC_FILES_x86 += src/elf32.c |
Christopher Ferris | 9fc75e8 | 2014-01-26 21:39:06 -0800 | [diff] [blame] | 86 | |
| 87 | # Arch specific source files. |
Colin Cross | 26183d2 | 2014-01-24 15:59:56 -0800 | [diff] [blame^] | 88 | $(foreach arch,$(libunwind_arches), \ |
| 89 | $(eval LOCAL_SRC_FILES_$(arch) += \ |
| 90 | src/$(call libunwind-arch,$(arch))/is_fpreg.c \ |
| 91 | src/$(call libunwind-arch,$(arch))/regname.c \ |
| 92 | src/$(call libunwind-arch,$(arch))/Gcreate_addr_space.c \ |
| 93 | src/$(call libunwind-arch,$(arch))/Gget_proc_info.c \ |
| 94 | src/$(call libunwind-arch,$(arch))/Gget_save_loc.c \ |
| 95 | src/$(call libunwind-arch,$(arch))/Gglobal.c \ |
| 96 | src/$(call libunwind-arch,$(arch))/Ginit.c \ |
| 97 | src/$(call libunwind-arch,$(arch))/Ginit_local.c \ |
| 98 | src/$(call libunwind-arch,$(arch))/Ginit_remote.c \ |
| 99 | src/$(call libunwind-arch,$(arch))/Gregs.c \ |
| 100 | src/$(call libunwind-arch,$(arch))/Gresume.c \ |
| 101 | src/$(call libunwind-arch,$(arch))/Gstep.c \ |
| 102 | src/$(call libunwind-arch,$(arch))/Lcreate_addr_space.c \ |
| 103 | src/$(call libunwind-arch,$(arch))/Lget_proc_info.c \ |
| 104 | src/$(call libunwind-arch,$(arch))/Lget_save_loc.c \ |
| 105 | src/$(call libunwind-arch,$(arch))/Lglobal.c \ |
| 106 | src/$(call libunwind-arch,$(arch))/Linit.c \ |
| 107 | src/$(call libunwind-arch,$(arch))/Linit_local.c \ |
| 108 | src/$(call libunwind-arch,$(arch))/Linit_remote.c \ |
| 109 | src/$(call libunwind-arch,$(arch))/Lregs.c \ |
| 110 | src/$(call libunwind-arch,$(arch))/Lresume.c \ |
| 111 | src/$(call libunwind-arch,$(arch))/Lstep.c \ |
| 112 | )) |
Christopher Ferris | 9fc75e8 | 2014-01-26 21:39:06 -0800 | [diff] [blame] | 113 | |
Colin Cross | 26183d2 | 2014-01-24 15:59:56 -0800 | [diff] [blame^] | 114 | LOCAL_SRC_FILES_arm += \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 115 | src/arm/getcontext.S \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 116 | src/arm/Gis_signal_frame.c \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 117 | src/arm/Gex_tables.c \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 118 | src/arm/Lis_signal_frame.c \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 119 | src/arm/Lex_tables.c \ |
| 120 | |
Colin Cross | 26183d2 | 2014-01-24 15:59:56 -0800 | [diff] [blame^] | 121 | LOCAL_SRC_FILES_arm64 += \ |
Christopher Ferris | 9fc75e8 | 2014-01-26 21:39:06 -0800 | [diff] [blame] | 122 | src/aarch64/Gis_signal_frame.c \ |
| 123 | src/aarch64/Lis_signal_frame.c \ |
| 124 | |
Colin Cross | 26183d2 | 2014-01-24 15:59:56 -0800 | [diff] [blame^] | 125 | LOCAL_SRC_FILES_mips += \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 126 | src/mips/getcontext-android.S \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 127 | src/mips/Gis_signal_frame.c \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 128 | src/mips/Lis_signal_frame.c \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 129 | |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 130 | |
Colin Cross | 26183d2 | 2014-01-24 15:59:56 -0800 | [diff] [blame^] | 131 | LOCAL_SRC_FILES_x86 += \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 132 | src/x86/getcontext-linux.S \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 133 | src/x86/Gos-linux.c \ |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 134 | src/x86/Los-linux.c \ |
| 135 | |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 136 | LOCAL_SHARED_LIBRARIES := \ |
| 137 | libdl \ |
| 138 | |
Christopher Ferris | 836d915 | 2013-12-02 12:27:30 -0800 | [diff] [blame] | 139 | LOCAL_ADDITIONAL_DEPENDENCIES := \ |
| 140 | $(LOCAL_PATH)/Android.mk \ |
| 141 | |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 142 | include $(BUILD_SHARED_LIBRARY) |
| 143 | |
| 144 | include $(CLEAR_VARS) |
| 145 | |
| 146 | LOCAL_MODULE := libunwind-ptrace |
| 147 | |
| 148 | LOCAL_CFLAGS += $(libunwind_cflags) |
| 149 | LOCAL_C_INCLUDES := $(libunwind_includes) |
Colin Cross | 26183d2 | 2014-01-24 15:59:56 -0800 | [diff] [blame^] | 150 | $(foreach arch,$(libunwind_arches), \ |
| 151 | $(eval LOCAL_C_INCLUDES_$(arch) := $(LOCAL_PATH)/include/tdep-$(call libunwind-arch,$(arch)))) |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 152 | |
| 153 | # Files needed to trace running processes. |
| 154 | LOCAL_SRC_FILES += \ |
| 155 | src/ptrace/_UPT_elf.c \ |
| 156 | src/ptrace/_UPT_accessors.c \ |
| 157 | src/ptrace/_UPT_access_fpreg.c \ |
| 158 | src/ptrace/_UPT_access_mem.c \ |
| 159 | src/ptrace/_UPT_access_reg.c \ |
| 160 | src/ptrace/_UPT_create.c \ |
| 161 | src/ptrace/_UPT_destroy.c \ |
| 162 | src/ptrace/_UPT_find_proc_info.c \ |
| 163 | src/ptrace/_UPT_get_dyn_info_list_addr.c \ |
| 164 | src/ptrace/_UPT_put_unwind_info.c \ |
| 165 | src/ptrace/_UPT_get_proc_name.c \ |
| 166 | src/ptrace/_UPT_reg_offset.c \ |
| 167 | src/ptrace/_UPT_resume.c \ |
| 168 | |
| 169 | LOCAL_SHARED_LIBRARIES := \ |
| 170 | libunwind \ |
| 171 | |
Christopher Ferris | 836d915 | 2013-12-02 12:27:30 -0800 | [diff] [blame] | 172 | LOCAL_ADDITIONAL_DEPENDENCIES := \ |
| 173 | $(LOCAL_PATH)/Android.mk \ |
| 174 | |
Christopher Ferris | 1c82a52 | 2013-10-01 12:38:42 -0700 | [diff] [blame] | 175 | include $(BUILD_SHARED_LIBRARY) |