1## Process this file with automake to create Makefile.in 2## 3## Copyright (C) 2002-2010 Red Hat, Inc. 4## This file is part of Red Hat elfutils. 5## 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. 9## 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. 14## 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, 17## Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA. 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>. 26## 27include $(top_srcdir)/config/eu.am 28DEFS += -DIS_LIBDW 29if BUILD_STATIC 30AM_CFLAGS += -fpic 31endif 32INCLUDES += -I$(srcdir)/../libelf 33VERSION = 1 34 35lib_LIBRARIES = libdw.a 36if !MUDFLAP 37noinst_LIBRARIES = libdw_pic.a 38noinst_PROGRAMS = $(noinst_LIBRARIES:_pic.a=.so) 39endif 40 41include_HEADERS = dwarf.h 42pkginclude_HEADERS = libdw.h 43 44libdw_a_SOURCES = dwarf_begin.c dwarf_begin_elf.c dwarf_end.c dwarf_getelf.c \ 45 dwarf_getpubnames.c dwarf_getabbrev.c dwarf_tag.c \ 46 dwarf_error.c dwarf_nextcu.c dwarf_diename.c dwarf_offdie.c \ 47 dwarf_attr.c dwarf_formstring.c \ 48 dwarf_abbrev_hash.c dwarf_sig8_hash.c \ 49 dwarf_attr_integrate.c dwarf_hasattr_integrate.c \ 50 dwarf_child.c dwarf_haschildren.c dwarf_formaddr.c \ 51 dwarf_formudata.c dwarf_formsdata.c dwarf_lowpc.c \ 52 dwarf_entrypc.c dwarf_haspc.c dwarf_highpc.c dwarf_ranges.c \ 53 dwarf_formref.c dwarf_formref_die.c dwarf_siblingof.c \ 54 dwarf_dieoffset.c dwarf_cuoffset.c dwarf_diecu.c \ 55 dwarf_hasattr.c dwarf_hasform.c \ 56 dwarf_whatform.c dwarf_whatattr.c \ 57 dwarf_bytesize.c dwarf_arrayorder.c dwarf_bitsize.c \ 58 dwarf_bitoffset.c dwarf_srclang.c dwarf_getabbrevtag.c \ 59 dwarf_getabbrevcode.c dwarf_abbrevhaschildren.c \ 60 dwarf_getattrcnt.c dwarf_getabbrevattr.c \ 61 dwarf_getsrclines.c dwarf_getsrc_die.c \ 62 dwarf_getscopes.c dwarf_getscopes_die.c dwarf_getscopevar.c \ 63 dwarf_linesrc.c dwarf_lineno.c dwarf_lineaddr.c \ 64 dwarf_linecol.c dwarf_linebeginstatement.c \ 65 dwarf_lineendsequence.c dwarf_lineblock.c \ 66 dwarf_lineprologueend.c dwarf_lineepiloguebegin.c \ 67 dwarf_lineisa.c dwarf_linediscriminator.c \ 68 dwarf_lineop_index.c \ 69 dwarf_onesrcline.c dwarf_formblock.c \ 70 dwarf_getsrcfiles.c dwarf_filesrc.c dwarf_getsrcdirs.c \ 71 dwarf_getlocation.c dwarf_getstring.c dwarf_offabbrev.c \ 72 dwarf_getaranges.c dwarf_onearange.c dwarf_getarangeinfo.c \ 73 dwarf_getarange_addr.c dwarf_getattrs.c dwarf_formflag.c \ 74 dwarf_getmacros.c dwarf_macro_opcode.c dwarf_macro_param1.c \ 75 dwarf_macro_param2.c dwarf_addrdie.c \ 76 dwarf_getfuncs.c \ 77 dwarf_decl_file.c dwarf_decl_line.c dwarf_decl_column.c \ 78 dwarf_func_inline.c dwarf_getsrc_file.c \ 79 libdw_findcu.c libdw_form.c libdw_alloc.c memory-access.c \ 80 libdw_visit_scopes.c \ 81 dwarf_entry_breakpoints.c \ 82 dwarf_next_cfi.c \ 83 cie.c fde.c cfi.c frame-cache.c \ 84 dwarf_frame_info.c dwarf_frame_cfa.c dwarf_frame_register.c \ 85 dwarf_cfi_addrframe.c \ 86 dwarf_getcfi.c dwarf_getcfi_elf.c dwarf_cfi_end.c \ 87 dwarf_aggregate_size.c dwarf_getlocation_implicit_pointer.c 88 89if MAINTAINER_MODE 90BUILT_SOURCES = $(srcdir)/known-dwarf.h 91MAINTAINERCLEANFILES = $(srcdir)/known-dwarf.h 92$(srcdir)/known-dwarf.h: $(top_srcdir)/config/known-dwarf.awk $(srcdir)/dwarf.h 93 gawk -f $^ > $@.new 94 mv -f $@.new $@ 95endif 96 97if !MUDFLAP 98libdw_pic_a_SOURCES = 99am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os) 100 101libdw_so_SOURCES = 102libdw.so: $(srcdir)/libdw.map libdw_pic.a \ 103 ../libdwfl/libdwfl_pic.a ../libebl/libebl.a \ 104 ../libelf/libelf.so 105# The rpath is necessary for libebl because its $ORIGIN use will 106# not fly in a setuid executable that links in libdw. 107 $(LINK) -shared -o $@ -Wl,--soname,$@.$(VERSION),-z,defs \ 108 -Wl,--enable-new-dtags,-rpath,$(pkglibdir) \ 109 -Wl,--version-script,$<,--no-undefined \ 110 -Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\ 111 -ldl $(zip_LIBS) 112 if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi 113 ln -fs $@ $@.$(VERSION) 114 115install: install-am libdw.so 116 $(mkinstalldirs) $(DESTDIR)$(libdir) 117 $(INSTALL_PROGRAM) libdw.so $(DESTDIR)$(libdir)/libdw-$(PACKAGE_VERSION).so 118 ln -fs libdw-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libdw.so.$(VERSION) 119 ln -fs libdw.so.$(VERSION) $(DESTDIR)$(libdir)/libdw.so 120 121uninstall: uninstall-am 122 rm -f $(DESTDIR)$(libdir)/libdw-$(PACKAGE_VERSION).so 123 rm -f $(DESTDIR)$(libdir)/libdw.so.$(VERSION) 124 rm -f $(DESTDIR)$(libdir)/libdw.so 125 rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils 126endif 127 128libdw_a_LIBADD = $(addprefix ../libdwfl/,$(shell $(AR) t ../libdwfl/libdwfl.a)) 129 130noinst_HEADERS = libdwP.h memory-access.h dwarf_abbrev_hash.h \ 131 dwarf_sig8_hash.h cfi.h encoded-value.h 132 133EXTRA_DIST = libdw.map 134 135MOSTLYCLEANFILES = $(am_libdw_pic_a_OBJECTS) libdw.so.$(VERSION) 136