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) 2002, 2003, 2004, 2005 Red Hat, Inc. |
| 4 | ## |
| 5 | ## This program is Open Source software; you can redistribute it and/or |
| 6 | ## modify it under the terms of the Open Software License version 1.0 as |
| 7 | ## published by the Open Source Initiative. |
| 8 | ## |
| 9 | ## You should have received a copy of the Open Software License along |
| 10 | ## with this program; if not, you may obtain a copy of the Open Software |
| 11 | ## License version 1.0 from http://www.opensource.org/licenses/osl.php or |
| 12 | ## by writing the Open Source Initiative c/o Lawrence Rosen, Esq., |
| 13 | ## 3001 King Ranch Road, Ukiah, CA 95482. |
| 14 | ## |
| 15 | DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DIS_LIBDW |
| 16 | if MUDFLAP |
| 17 | AM_CFLAGS = -fmudflap |
| 18 | else |
| 19 | AM_CFLAGS = |
| 20 | endif |
| 21 | AM_CFLAGS += -Wall -Werror -Wshadow -Wunused -Wformat=2 -Wextra -std=gnu99 |
| 22 | INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../libelf -I.. -I$(srcdir)/../lib |
| 23 | VERSION = 1 |
| 24 | |
| 25 | lib_LIBRARIES = libdw.a |
| 26 | if !MUDFLAP |
| 27 | noinst_LIBRARIES = libdw_pic.a |
| 28 | noinst_PROGRAMS = $(noinst_LIBRARIES:_pic.a=.so) |
| 29 | endif |
| 30 | |
| 31 | include_HEADERS = dwarf.h |
| 32 | euincludedir = ${includedir}/elfutils |
| 33 | euinclude_HEADERS = libdw.h |
| 34 | |
| 35 | libdw_a_SOURCES = dwarf_begin.c dwarf_begin_elf.c dwarf_end.c dwarf_getelf.c \ |
| 36 | dwarf_getpubnames.c dwarf_getabbrev.c dwarf_tag.c \ |
| 37 | dwarf_error.c dwarf_nextcu.c dwarf_diename.c dwarf_offdie.c \ |
| 38 | dwarf_attr.c dwarf_formstring.c dwarf_abbrev_hash.c \ |
| 39 | dwarf_attr_integrate.c dwarf_hasattr_integrate.c \ |
| 40 | dwarf_child.c dwarf_haschildren.c dwarf_formaddr.c \ |
| 41 | dwarf_formudata.c dwarf_formsdata.c dwarf_lowpc.c \ |
| 42 | dwarf_haspc.c dwarf_highpc.c \ |
| 43 | dwarf_formref.c dwarf_formref_die.c dwarf_siblingof.c \ |
| 44 | dwarf_dieoffset.c dwarf_cuoffset.c dwarf_hasattr.c \ |
| 45 | dwarf_hasform.c dwarf_whatform.c dwarf_whatattr.c \ |
| 46 | dwarf_bytesize.c dwarf_arrayorder.c dwarf_bitsize.c \ |
| 47 | dwarf_bitoffset.c dwarf_srclang.c dwarf_getabbrevtag.c \ |
| 48 | dwarf_getabbrevcode.c dwarf_abbrevhaschildren.c \ |
| 49 | dwarf_getattrcnt.c dwarf_getabbrevattr.c \ |
| 50 | dwarf_getsrclines.c dwarf_getsrc_die.c \ |
| 51 | dwarf_getscopes.c dwarf_getscopevar.c \ |
| 52 | dwarf_linesrc.c dwarf_lineno.c dwarf_lineaddr.c \ |
| 53 | dwarf_linecol.c dwarf_linebeginstatement.c \ |
| 54 | dwarf_lineendsequence.c dwarf_lineblock.c \ |
| 55 | dwarf_lineprologueend.c dwarf_lineepiloguebegin.c \ |
| 56 | dwarf_onesrcline.c dwarf_formblock.c \ |
| 57 | dwarf_getsrcfiles.c dwarf_filesrc.c \ |
| 58 | dwarf_getloclist.c dwarf_getstring.c dwarf_offabbrev.c \ |
| 59 | dwarf_getaranges.c dwarf_onearange.c dwarf_getarangeinfo.c \ |
| 60 | dwarf_getarange_addr.c dwarf_getattrs.c dwarf_formflag.c \ |
| 61 | dwarf_getmacros.c dwarf_macro_opcode.c dwarf_macro_param1.c \ |
| 62 | dwarf_macro_param2.c dwarf_addrdie.c \ |
| 63 | dwarf_getfuncs.c dwarf_func_name.c dwarf_func_lowpc.c \ |
| 64 | dwarf_func_highpc.c dwarf_func_entrypc.c dwarf_func_file.c \ |
| 65 | dwarf_func_line.c dwarf_func_col.c dwarf_getsrc_file.c \ |
| 66 | libdw_findcu.c libdw_form.c libdw_alloc.c memory-access.c |
| 67 | |
| 68 | |
| 69 | if !MUDFLAP |
| 70 | libdw_pic_a_SOURCES = |
| 71 | am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os) |
| 72 | |
| 73 | libdw_so_SOURCES = |
| 74 | libdw.so: libdw_pic.a $(srcdir)/libdw.map |
| 75 | $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ |
| 76 | -Wl,--version-script,$(srcdir)/libdw.map,--no-undefined \ |
| 77 | -Wl,--soname,$@.$(VERSION),-z,defs \ |
| 78 | ../libelf/libelf.so |
| 79 | if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi |
| 80 | ln -fs $@ $@.$(VERSION) |
| 81 | |
| 82 | |
| 83 | %.os: %.c %.o |
| 84 | if $(COMPILE) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \ |
| 85 | -MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \ |
| 86 | then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \ |
| 87 | rm -f "$(DEPDIR)/$*.Tpo"; \ |
| 88 | else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ |
| 89 | fi |
| 90 | |
| 91 | install: install-am libdw.so |
| 92 | $(mkinstalldirs) $(DESTDIR)$(libdir) |
| 93 | $(INSTALL_PROGRAM) libdw.so $(DESTDIR)$(libdir)/libdw-$(PACKAGE_VERSION).so |
| 94 | ln -fs libdw-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libdw.so.$(VERSION) |
| 95 | ln -fs libdw.so.$(VERSION) $(DESTDIR)$(libdir)/libdw.so |
| 96 | |
| 97 | uninstall: uninstall-am |
| 98 | rm -f $(DESTDIR)$(libdir)/libdw-$(PACKAGE_VERSION).so |
| 99 | rm -f $(DESTDIR)$(libdir)/libdw.so.$(VERSION) |
| 100 | rm -f $(DESTDIR)$(libdir)/libdw.so |
| 101 | rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils |
| 102 | endif |
| 103 | |
| 104 | noinst_HEADERS = libdwP.h memory-access.h dwarf_abbrev_hash.h |
| 105 | |
| 106 | EXTRA_DIST = libdw.map |
| 107 | |
| 108 | CLEANFILES = $(am_libdw_pic_a_OBJECTS) |