Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame^] | 1 | ## Process this file with automake to create Makefile.in |
| 2 | ## |
| 3 | ## Copyright (C) 1996-2001, 2002, 2003, 2004, 2005 Red Hat, Inc. |
| 4 | ## |
| 5 | ## This program is free software; you can redistribute it and/or modify |
| 6 | ## it under the terms of the GNU General Public License as published by |
| 7 | ## the Free Software Foundation, version 2. |
| 8 | ## |
| 9 | ## This program is distributed in the hope that it will be useful, |
| 10 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | ## GNU General Public License for more details. |
| 13 | ## |
| 14 | ## You should have received a copy of the GNU General Public License |
| 15 | ## along with this program; if not, write to the Free Software Foundation, |
| 16 | ## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 17 | ## |
| 18 | DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H |
| 19 | if MUDFLAP |
| 20 | AM_CFLAGS = -fpic -fmudflap |
| 21 | else |
| 22 | AM_CFLAGS = |
| 23 | endif |
| 24 | AM_CFLAGS += -Wall -Wshadow -Werror -Wunused -Wextra -Wformat=2 -std=gnu99 \ |
| 25 | $($(*F)_CFLAGS) |
| 26 | INCLUDES = -I$(srcdir) -I$(top_srcdir)/lib -I.. |
| 27 | GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include) |
| 28 | VERSION = 1 |
| 29 | PACKAGE_VERSION = @PACKAGE_VERSION@ |
| 30 | |
| 31 | lib_LIBRARIES = libelf.a |
| 32 | if !MUDFLAP |
| 33 | noinst_LIBRARIES = libelf_pic.a |
| 34 | noinst_PROGRAMS = $(noinst_LIBRARIES:_pic.a=.so) |
| 35 | endif |
| 36 | include_HEADERS = libelf.h gelf.h nlist.h |
| 37 | |
| 38 | euincludedir = $(includedir)/elfutils |
| 39 | euinclude_HEADERS = elf-knowledge.h |
| 40 | |
| 41 | libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \ |
| 42 | elf_begin.c elf_next.c elf_rand.c elf_end.c elf_kind.c \ |
| 43 | gelf_getclass.c elf_getbase.c elf_getident.c \ |
| 44 | elf32_fsize.c elf64_fsize.c gelf_fsize.c \ |
| 45 | elf32_xlatetof.c elf32_xlatetom.c elf64_xlatetof.c \ |
| 46 | elf64_xlatetom.c gelf_xlate.c \ |
| 47 | elf32_getehdr.c elf64_getehdr.c gelf_getehdr.c \ |
| 48 | elf32_newehdr.c elf64_newehdr.c gelf_newehdr.c \ |
| 49 | gelf_update_ehdr.c \ |
| 50 | elf32_getphdr.c elf64_getphdr.c gelf_getphdr.c \ |
| 51 | elf32_newphdr.c elf64_newphdr.c gelf_newphdr.c \ |
| 52 | gelf_update_phdr.c \ |
| 53 | elf_getarhdr.c elf_getarsym.c \ |
| 54 | elf_rawfile.c elf_readall.c elf_cntl.c \ |
| 55 | elf_getscn.c elf_nextscn.c elf_ndxscn.c elf_newscn.c \ |
| 56 | elf32_getshdr.c elf64_getshdr.c gelf_getshdr.c \ |
| 57 | gelf_update_shdr.c \ |
| 58 | elf_strptr.c elf_rawdata.c elf_getdata.c elf_newdata.c \ |
| 59 | elf_flagelf.c elf_flagehdr.c elf_flagphdr.c elf_flagscn.c \ |
| 60 | elf_flagshdr.c elf_flagdata.c elf_memory.c \ |
| 61 | elf_update.c elf32_updatenull.c elf64_updatenull.c \ |
| 62 | elf32_updatefile.c elf64_updatefile.c \ |
| 63 | gelf_getsym.c gelf_update_sym.c \ |
| 64 | gelf_getversym.c gelf_getverneed.c gelf_getvernaux.c \ |
| 65 | gelf_getverdef.c gelf_getverdaux.c \ |
| 66 | gelf_getrel.c gelf_getrela.c \ |
| 67 | gelf_update_rel.c gelf_update_rela.c \ |
| 68 | gelf_getdyn.c gelf_update_dyn.c \ |
| 69 | gelf_getmove.c gelf_update_move.c \ |
| 70 | gelf_getsyminfo.c gelf_update_syminfo.c \ |
| 71 | gelf_xlatetof.c gelf_xlatetom.c \ |
| 72 | nlist.c \ |
| 73 | gelf_getsymshndx.c gelf_update_symshndx.c \ |
| 74 | gelf_update_versym.c gelf_update_verneed.c \ |
| 75 | gelf_update_vernaux.c gelf_update_verdef.c \ |
| 76 | gelf_update_verdaux.c \ |
| 77 | elf_getshnum.c elf_getshstrndx.c \ |
| 78 | gelf_checksum.c elf32_checksum.c elf64_checksum.c \ |
| 79 | gelf_rawchunk.c gelf_freechunk.c \ |
| 80 | libelf_crc32.c libelf_next_prime.c \ |
| 81 | elf_clone.c \ |
| 82 | gelf_getlib.c gelf_update_lib.c |
| 83 | |
| 84 | if !MUDFLAP |
| 85 | libelf_pic_a_SOURCES = |
| 86 | am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os) |
| 87 | |
| 88 | libelf_so_SOURCES = |
| 89 | libelf.so: libelf_pic.a libelf.map |
| 90 | $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ |
| 91 | -Wl,--version-script,$(srcdir)/libelf.map,--no-undefined \ |
| 92 | -Wl,--soname,$@.$(VERSION),-z,-defs |
| 93 | if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi |
| 94 | ln -fs $@ $@.$(VERSION) |
| 95 | |
| 96 | %.os: %.c %.o |
| 97 | if $(COMPILE) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \ |
| 98 | -MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \ |
| 99 | then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \ |
| 100 | rm -f "$(DEPDIR)/$*.Tpo"; \ |
| 101 | else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ |
| 102 | fi |
| 103 | |
| 104 | install: install-am libelf.so |
| 105 | $(mkinstalldirs) $(DESTDIR)$(libdir) |
| 106 | $(INSTALL_PROGRAM) libelf.so $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so |
| 107 | ln -fs libelf-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libelf.so.$(VERSION) |
| 108 | ln -fs libelf.so.$(VERSION) $(DESTDIR)$(libdir)/libelf.so |
| 109 | |
| 110 | uninstall: uninstall-am |
| 111 | rm -f $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so |
| 112 | rm -f $(DESTDIR)$(libdir)/libelf.so.$(VERSION) |
| 113 | rm -f $(DESTDIR)$(libdir)/libelf.so |
| 114 | endif |
| 115 | |
| 116 | noinst_HEADERS = elf.h abstract.h common.h exttypes.h gelf_xlate.h libelfP.h \ |
| 117 | version_xlate.h dl-hash.h |
| 118 | EXTRA_DIST = libelf.map |
| 119 | |
| 120 | CLEANFILES = $(am_libelf_pic_a_OBJECTS) |