Ben Cheng | cc6695e | 2012-03-07 23:04:02 -0800 | [diff] [blame^] | 1 | LOCAL_PATH := $(call my-dir) |
The Android Open Source Project | 593c365 | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 2 | |
Ben Cheng | cc6695e | 2012-03-07 23:04:02 -0800 | [diff] [blame^] | 3 | supported_platforms := linux-x86 darwin-x86 |
| 4 | cur_platform := $(filter $(HOST_OS)-$(HOST_ARCH),$(supported_platforms)) |
The Android Open Source Project | 593c365 | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 5 | |
Ben Cheng | cc6695e | 2012-03-07 23:04:02 -0800 | [diff] [blame^] | 6 | ifdef cur_platform |
The Android Open Source Project | 593c365 | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 7 | # |
Ben Cheng | cc6695e | 2012-03-07 23:04:02 -0800 | [diff] [blame^] | 8 | # host libelf |
The Android Open Source Project | 593c365 | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 9 | # |
| 10 | |
| 11 | include $(CLEAR_VARS) |
| 12 | |
Ben Cheng | cc6695e | 2012-03-07 23:04:02 -0800 | [diff] [blame^] | 13 | LIBELF_SRC_FILES := \ |
| 14 | libelf/elf32_checksum.c \ |
| 15 | libelf/elf32_fsize.c \ |
| 16 | libelf/elf32_getehdr.c \ |
| 17 | libelf/elf32_getphdr.c \ |
| 18 | libelf/elf32_getshdr.c \ |
| 19 | libelf/elf32_newehdr.c \ |
| 20 | libelf/elf32_newphdr.c \ |
| 21 | libelf/elf32_offscn.c \ |
| 22 | libelf/elf32_updatefile.c \ |
| 23 | libelf/elf32_updatenull.c \ |
| 24 | libelf/elf32_xlatetof.c \ |
| 25 | libelf/elf32_xlatetom.c \ |
| 26 | libelf/elf64_checksum.c \ |
| 27 | libelf/elf64_fsize.c \ |
| 28 | libelf/elf64_getehdr.c \ |
| 29 | libelf/elf64_getphdr.c \ |
| 30 | libelf/elf64_getshdr.c \ |
| 31 | libelf/elf64_newehdr.c \ |
| 32 | libelf/elf64_newphdr.c \ |
| 33 | libelf/elf64_offscn.c \ |
| 34 | libelf/elf64_updatefile.c \ |
| 35 | libelf/elf64_updatenull.c \ |
| 36 | libelf/elf64_xlatetof.c \ |
| 37 | libelf/elf64_xlatetom.c \ |
| 38 | libelf/elf_begin.c \ |
| 39 | libelf/elf_clone.c \ |
| 40 | libelf/elf_cntl.c \ |
| 41 | libelf/elf_end.c \ |
| 42 | libelf/elf_error.c \ |
| 43 | libelf/elf_fill.c \ |
| 44 | libelf/elf_flagdata.c \ |
| 45 | libelf/elf_flagehdr.c \ |
| 46 | libelf/elf_flagelf.c \ |
| 47 | libelf/elf_flagphdr.c \ |
| 48 | libelf/elf_flagscn.c \ |
| 49 | libelf/elf_flagshdr.c \ |
| 50 | libelf/elf_getarhdr.c \ |
| 51 | libelf/elf_getaroff.c \ |
| 52 | libelf/elf_getarsym.c \ |
| 53 | libelf/elf_getbase.c \ |
| 54 | libelf/elf_getdata.c \ |
| 55 | libelf/elf_getdata_rawchunk.c \ |
| 56 | libelf/elf_getident.c \ |
| 57 | libelf/elf_getscn.c \ |
| 58 | libelf/elf_getshnum.c \ |
| 59 | libelf/elf_getshstrndx.c \ |
| 60 | libelf/elf_gnu_hash.c \ |
| 61 | libelf/elf_hash.c \ |
| 62 | libelf/elf_kind.c \ |
| 63 | libelf/elf_memory.c \ |
| 64 | libelf/elf_ndxscn.c \ |
| 65 | libelf/elf_newdata.c \ |
| 66 | libelf/elf_newscn.c \ |
| 67 | libelf/elf_next.c \ |
| 68 | libelf/elf_nextscn.c \ |
| 69 | libelf/elf_rand.c \ |
| 70 | libelf/elf_rawdata.c \ |
| 71 | libelf/elf_rawfile.c \ |
| 72 | libelf/elf_readall.c \ |
| 73 | libelf/elf_scnshndx.c \ |
| 74 | libelf/elf_strptr.c \ |
| 75 | libelf/elf_update.c \ |
| 76 | libelf/elf_version.c \ |
| 77 | libelf/gelf_checksum.c \ |
| 78 | libelf/gelf_fsize.c \ |
| 79 | libelf/gelf_getauxv.c \ |
| 80 | libelf/gelf_getclass.c \ |
| 81 | libelf/gelf_getdyn.c \ |
| 82 | libelf/gelf_getehdr.c \ |
| 83 | libelf/gelf_getlib.c \ |
| 84 | libelf/gelf_getmove.c \ |
| 85 | libelf/gelf_getnote.c \ |
| 86 | libelf/gelf_getphdr.c \ |
| 87 | libelf/gelf_getrela.c \ |
| 88 | libelf/gelf_getrel.c \ |
| 89 | libelf/gelf_getshdr.c \ |
| 90 | libelf/gelf_getsym.c \ |
| 91 | libelf/gelf_getsyminfo.c \ |
| 92 | libelf/gelf_getsymshndx.c \ |
| 93 | libelf/gelf_getverdaux.c \ |
| 94 | libelf/gelf_getverdef.c \ |
| 95 | libelf/gelf_getvernaux.c \ |
| 96 | libelf/gelf_getverneed.c \ |
| 97 | libelf/gelf_getversym.c \ |
| 98 | libelf/gelf_newehdr.c \ |
| 99 | libelf/gelf_newphdr.c \ |
| 100 | libelf/gelf_offscn.c \ |
| 101 | libelf/gelf_update_auxv.c \ |
| 102 | libelf/gelf_update_dyn.c \ |
| 103 | libelf/gelf_update_ehdr.c \ |
| 104 | libelf/gelf_update_lib.c \ |
| 105 | libelf/gelf_update_move.c \ |
| 106 | libelf/gelf_update_phdr.c \ |
| 107 | libelf/gelf_update_rela.c \ |
| 108 | libelf/gelf_update_rel.c \ |
| 109 | libelf/gelf_update_shdr.c \ |
| 110 | libelf/gelf_update_sym.c \ |
| 111 | libelf/gelf_update_syminfo.c \ |
| 112 | libelf/gelf_update_symshndx.c \ |
| 113 | libelf/gelf_update_verdaux.c \ |
| 114 | libelf/gelf_update_verdef.c \ |
| 115 | libelf/gelf_update_vernaux.c \ |
| 116 | libelf/gelf_update_verneed.c \ |
| 117 | libelf/gelf_update_versym.c \ |
| 118 | libelf/gelf_xlate.c \ |
| 119 | libelf/gelf_xlatetof.c \ |
| 120 | libelf/gelf_xlatetom.c \ |
| 121 | libelf/libelf_crc32.c \ |
| 122 | libelf/libelf_next_prime.c \ |
| 123 | libelf/nlist.c |
The Android Open Source Project | 593c365 | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 124 | |
Ben Cheng | cc6695e | 2012-03-07 23:04:02 -0800 | [diff] [blame^] | 125 | LOCAL_SRC_FILES := $(LIBELF_SRC_FILES) |
| 126 | |
| 127 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/lib $(LOCAL_PATH)/libelf |
| 128 | |
| 129 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/host-$(HOST_OS)-fixup |
| 130 | |
| 131 | LOCAL_CFLAGS += -DHAVE_CONFIG_H -std=gnu99 -D_GNU_SOURCE |
| 132 | |
| 133 | # to suppress the "pointer of type ‘void *’ used in arithmetic" warning |
| 134 | LOCAL_CFLAGS += -Wno-pointer-arith |
| 135 | |
The Android Open Source Project | 593c365 | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 136 | ifeq ($(HOST_OS),darwin) |
Ben Cheng | cc6695e | 2012-03-07 23:04:02 -0800 | [diff] [blame^] | 137 | LOCAL_CFLAGS += -fnested-functions |
Alexey Tarasov | 63af8ad | 2008-11-07 11:17:52 +1000 | [diff] [blame] | 138 | endif |
The Android Open Source Project | 593c365 | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 139 | |
Ben Cheng | cc6695e | 2012-03-07 23:04:02 -0800 | [diff] [blame^] | 140 | # to fix machine-dependent issues |
| 141 | LOCAL_CFLAGS += -include $(LOCAL_PATH)/host-$(HOST_OS)-fixup/AndroidFixup.h |
The Android Open Source Project | 593c365 | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 142 | |
Ben Cheng | cc6695e | 2012-03-07 23:04:02 -0800 | [diff] [blame^] | 143 | LOCAL_MODULE := libelf |
The Android Open Source Project | 593c365 | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 144 | |
| 145 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 146 | |
Ben Cheng | cc6695e | 2012-03-07 23:04:02 -0800 | [diff] [blame^] | 147 | endif #cur_platform |