Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 1 | ## Process this file with automake to create Makefile.in |
| 2 | ## |
Roland McGrath | 6fd3cd1 | 2010-01-07 19:41:04 -0800 | [diff] [blame] | 3 | ## Copyright (C) 1996-2010 Red Hat, Inc. |
Ulrich Drepper | 361df7d | 2006-04-04 21:38:57 +0000 | [diff] [blame] | 4 | ## This file is part of Red Hat elfutils. |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 5 | ## |
Ulrich Drepper | 361df7d | 2006-04-04 21:38:57 +0000 | [diff] [blame] | 6 | ## Red Hat elfutils is free software; you can redistribute it and/or modify |
| 7 | ## it under the terms of the GNU General Public License as published by the |
| 8 | ## Free Software Foundation; version 2 of the License. |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 9 | ## |
Ulrich Drepper | 361df7d | 2006-04-04 21:38:57 +0000 | [diff] [blame] | 10 | ## Red Hat elfutils is distributed in the hope that it will be useful, but |
| 11 | ## WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | ## General Public License for more details. |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 14 | ## |
Ulrich Drepper | 361df7d | 2006-04-04 21:38:57 +0000 | [diff] [blame] | 15 | ## You should have received a copy of the GNU General Public License along |
| 16 | ## with Red Hat elfutils; if not, write to the Free Software Foundation, |
Ulrich Drepper | 1e9ef50 | 2006-04-04 22:29:06 +0000 | [diff] [blame] | 17 | ## Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. |
Ulrich Drepper | 361df7d | 2006-04-04 21:38:57 +0000 | [diff] [blame] | 18 | ## |
| 19 | ## Red Hat elfutils is an included package of the Open Invention Network. |
| 20 | ## An included package of the Open Invention Network is a package for which |
| 21 | ## Open Invention Network licensees cross-license their patents. No patent |
| 22 | ## license is granted, either expressly or impliedly, by designation as an |
| 23 | ## included package. Should you wish to participate in the Open Invention |
| 24 | ## Network licensing program, please visit www.openinventionnetwork.com |
| 25 | ## <http://www.openinventionnetwork.com>. |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 26 | ## |
Roland McGrath | 22359e2 | 2010-02-15 15:57:03 -0800 | [diff] [blame] | 27 | include $(top_srcdir)/config/eu.am |
Ulrich Drepper | 47be795 | 2005-08-07 04:41:39 +0000 | [diff] [blame] | 28 | if BUILD_STATIC |
| 29 | AM_CFLAGS += -fpic |
| 30 | endif |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 31 | GCC_INCLUDE = -I$(shell $(CC) -print-file-name=include) |
| 32 | VERSION = 1 |
Ulrich Drepper | fbe998a | 2005-08-29 16:27:10 +0000 | [diff] [blame] | 33 | |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 34 | lib_LIBRARIES = libelf.a |
| 35 | if !MUDFLAP |
| 36 | noinst_LIBRARIES = libelf_pic.a |
| 37 | noinst_PROGRAMS = $(noinst_LIBRARIES:_pic.a=.so) |
| 38 | endif |
| 39 | include_HEADERS = libelf.h gelf.h nlist.h |
| 40 | |
Ulrich Drepper | e219f1c | 2008-01-09 05:49:49 +0000 | [diff] [blame] | 41 | pkginclude_HEADERS = elf-knowledge.h |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 42 | |
| 43 | libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \ |
| 44 | elf_begin.c elf_next.c elf_rand.c elf_end.c elf_kind.c \ |
| 45 | gelf_getclass.c elf_getbase.c elf_getident.c \ |
| 46 | elf32_fsize.c elf64_fsize.c gelf_fsize.c \ |
| 47 | elf32_xlatetof.c elf32_xlatetom.c elf64_xlatetof.c \ |
| 48 | elf64_xlatetom.c gelf_xlate.c \ |
| 49 | elf32_getehdr.c elf64_getehdr.c gelf_getehdr.c \ |
| 50 | elf32_newehdr.c elf64_newehdr.c gelf_newehdr.c \ |
| 51 | gelf_update_ehdr.c \ |
| 52 | elf32_getphdr.c elf64_getphdr.c gelf_getphdr.c \ |
| 53 | elf32_newphdr.c elf64_newphdr.c gelf_newphdr.c \ |
| 54 | gelf_update_phdr.c \ |
| 55 | elf_getarhdr.c elf_getarsym.c \ |
| 56 | elf_rawfile.c elf_readall.c elf_cntl.c \ |
| 57 | elf_getscn.c elf_nextscn.c elf_ndxscn.c elf_newscn.c \ |
| 58 | elf32_getshdr.c elf64_getshdr.c gelf_getshdr.c \ |
| 59 | gelf_update_shdr.c \ |
| 60 | elf_strptr.c elf_rawdata.c elf_getdata.c elf_newdata.c \ |
Roland McGrath | 59ea7f3 | 2007-10-04 08:50:09 +0000 | [diff] [blame] | 61 | elf_getdata_rawchunk.c \ |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 62 | elf_flagelf.c elf_flagehdr.c elf_flagphdr.c elf_flagscn.c \ |
| 63 | elf_flagshdr.c elf_flagdata.c elf_memory.c \ |
| 64 | elf_update.c elf32_updatenull.c elf64_updatenull.c \ |
| 65 | elf32_updatefile.c elf64_updatefile.c \ |
| 66 | gelf_getsym.c gelf_update_sym.c \ |
| 67 | gelf_getversym.c gelf_getverneed.c gelf_getvernaux.c \ |
| 68 | gelf_getverdef.c gelf_getverdaux.c \ |
| 69 | gelf_getrel.c gelf_getrela.c \ |
| 70 | gelf_update_rel.c gelf_update_rela.c \ |
| 71 | gelf_getdyn.c gelf_update_dyn.c \ |
| 72 | gelf_getmove.c gelf_update_move.c \ |
| 73 | gelf_getsyminfo.c gelf_update_syminfo.c \ |
Roland McGrath | cb6d865 | 2007-08-23 08:10:54 +0000 | [diff] [blame] | 74 | gelf_getauxv.c gelf_update_auxv.c \ |
Roland McGrath | c76f0b0 | 2007-09-27 07:31:33 +0000 | [diff] [blame] | 75 | gelf_getnote.c \ |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 76 | gelf_xlatetof.c gelf_xlatetom.c \ |
| 77 | nlist.c \ |
| 78 | gelf_getsymshndx.c gelf_update_symshndx.c \ |
| 79 | gelf_update_versym.c gelf_update_verneed.c \ |
| 80 | gelf_update_vernaux.c gelf_update_verdef.c \ |
| 81 | gelf_update_verdaux.c \ |
Roland McGrath | 6fd3cd1 | 2010-01-07 19:41:04 -0800 | [diff] [blame] | 82 | elf_getphdrnum.c elf_getshdrnum.c elf_getshdrstrndx.c \ |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 83 | gelf_checksum.c elf32_checksum.c elf64_checksum.c \ |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 84 | libelf_crc32.c libelf_next_prime.c \ |
| 85 | elf_clone.c \ |
Ulrich Drepper | 41de488 | 2005-08-03 00:02:56 +0000 | [diff] [blame] | 86 | gelf_getlib.c gelf_update_lib.c \ |
Ulrich Drepper | 5d83229 | 2005-08-15 21:36:27 +0000 | [diff] [blame] | 87 | elf32_offscn.c elf64_offscn.c gelf_offscn.c \ |
Ulrich Drepper | 28ed895 | 2006-07-07 03:43:47 +0000 | [diff] [blame] | 88 | elf_getaroff.c \ |
Ulrich Drepper | 3cbdd38 | 2008-01-02 17:44:39 +0000 | [diff] [blame] | 89 | elf_gnu_hash.c \ |
| 90 | elf_scnshndx.c |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 91 | |
| 92 | if !MUDFLAP |
| 93 | libelf_pic_a_SOURCES = |
| 94 | am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os) |
| 95 | |
Ulrich Drepper | d56e232 | 2008-08-16 03:09:13 +0000 | [diff] [blame] | 96 | libelf_so_LDLIBS = |
Ulrich Drepper | 7e678fa | 2009-01-10 18:02:05 -0800 | [diff] [blame] | 97 | if USE_LOCKS |
Ulrich Drepper | d56e232 | 2008-08-16 03:09:13 +0000 | [diff] [blame] | 98 | libelf_so_LDLIBS += -lpthread |
| 99 | endif |
| 100 | |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 101 | libelf_so_SOURCES = |
| 102 | libelf.so: libelf_pic.a libelf.map |
Ulrich Drepper | fbe998a | 2005-08-29 16:27:10 +0000 | [diff] [blame] | 103 | $(LINK) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ |
| 104 | -Wl,--version-script,$(srcdir)/libelf.map,--no-undefined \ |
Mark Wielaard | e2fedf4 | 2009-08-12 12:00:17 +0200 | [diff] [blame] | 105 | -Wl,--soname,$@.$(VERSION),-z,defs,-z,relro $(libelf_so_LDLIBS) |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 106 | if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi |
| 107 | ln -fs $@ $@.$(VERSION) |
| 108 | |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 109 | install: install-am libelf.so |
| 110 | $(mkinstalldirs) $(DESTDIR)$(libdir) |
| 111 | $(INSTALL_PROGRAM) libelf.so $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so |
| 112 | ln -fs libelf-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libelf.so.$(VERSION) |
| 113 | ln -fs libelf.so.$(VERSION) $(DESTDIR)$(libdir)/libelf.so |
| 114 | |
| 115 | uninstall: uninstall-am |
| 116 | rm -f $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so |
| 117 | rm -f $(DESTDIR)$(libdir)/libelf.so.$(VERSION) |
| 118 | rm -f $(DESTDIR)$(libdir)/libelf.so |
| 119 | endif |
| 120 | |
| 121 | noinst_HEADERS = elf.h abstract.h common.h exttypes.h gelf_xlate.h libelfP.h \ |
Roland McGrath | c76f0b0 | 2007-09-27 07:31:33 +0000 | [diff] [blame] | 122 | version_xlate.h gnuhash_xlate.h note_xlate.h dl-hash.h |
Ulrich Drepper | b08d5a8 | 2005-07-26 05:00:05 +0000 | [diff] [blame] | 123 | EXTRA_DIST = libelf.map |
| 124 | |
Roland McGrath | 22359e2 | 2010-02-15 15:57:03 -0800 | [diff] [blame] | 125 | CLEANFILES += $(am_libelf_pic_a_OBJECTS) libelf.so.$(VERSION) |