1 ## Process this file with automake to create Makefile.in 2 ## Makefile for libdw. 3 ## 4 ## Copyright (C) 2002, 2003, 2004 Red Hat, Inc. 5 ## 6 ## This program is Open Source software; you can redistribute it and/or 7 ## modify it under the terms of the Open Software License version 1.0 as 8 ## published by the Open Source Initiative. 9 ## 10 ## You should have received a copy of the Open Software License along 11 ## with this program; if not, you may obtain a copy of the Open Software 12 ## License version 1.0 from http://www.opensource.org/licenses/osl.php or 13 ## by writing the Open Source Initiative c/o Lawrence Rosen, Esq., 14 ## 3001 King Ranch Road, Ukiah, CA 95482. 15 ## 16 DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H 17 if MUDFLAP 18 AM_CFLAGS = -Wall -Wshadow -std=gnu99 19 else 20 AM_CFLAGS = -Wall -Werror -Wshadow -std=gnu99 21 endif 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_child.c dwarf_haschildren.c dwarf_formaddr.c \ 40 dwarf_formudata.c dwarf_formsdata.c dwarf_lowpc.c \ 41 dwarf_highpc.c dwarf_formref.c dwarf_siblingof.c \ 42 dwarf_dieoffset.c dwarf_cuoffset.c dwarf_hasattr.c \ 43 dwarf_hasform.c dwarf_whatform.c dwarf_whatattr.c \ 44 dwarf_bytesize.c dwarf_arrayorder.c dwarf_bitsize.c \ 45 dwarf_bitoffset.c dwarf_srclang.c dwarf_getabbrevtag.c \ 46 dwarf_getabbrevcode.c dwarf_abbrevhaschildren.c \ 47 dwarf_getattrcnt.c dwarf_getabbrevattr.c \ 48 dwarf_getsrclines.c dwarf_getsrc_die.c \ 49 dwarf_linesrc.c dwarf_lineno.c dwarf_lineaddr.c \ 50 dwarf_linecol.c dwarf_linebeginstatement.c \ 51 dwarf_lineendsequence.c dwarf_lineblock.c \ 52 dwarf_lineprologueend.c dwarf_lineepiloguebegin.c \ 53 dwarf_onesrcline.c dwarf_formblock.c \ 54 dwarf_getsrcfiles.c dwarf_filesrc.c \ 55 dwarf_getloclist.c dwarf_getstring.c dwarf_offabbrev.c \ 56 dwarf_getaranges.c dwarf_onearange.c dwarf_getarangeinfo.c \ 57 dwarf_getarange_addr.c dwarf_getattrs.c dwarf_formflag.c \ 58 dwarf_getmacros.c \ 59 libdw_findcu.c libdw_form.c libdw_alloc.c 60 61 62 if !MUDFLAP 63 libdw_pic_a_SOURCES = 64 am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os) 65 66 libdw_so_SOURCES = 67 libdw.so: libdw_pic.a $(srcdir)/libdw.map 68 $(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \ 69 -Wl,--version-script,$(srcdir)/libdw.map,--no-undefined \ 70 -Wl,--soname,$@.$(VERSION),-z,defs \ 71 ../libelf/libelf.so 72 ln -fs $@ $@.$(VERSION) 73 74 75 %.os: %.c %.o 76 if $(COMPILE) -c -o $@ -fpic -DPIC -DSHARED -MT $@ -MD -MP \ 77 -MF "$(DEPDIR)/$*.Tpo" `test -f '$<' || echo '$(srcdir)/'`$<; \ 78 then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \ 79 rm -f "$(DEPDIR)/$*.Tpo"; \ 80 else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ 81 fi 82 83 install: install-am libdw.so 84 $(mkinstalldirs) $(DESTDIR)$(libdir) 85 $(INSTALL_PROGRAM) libdw.so $(DESTDIR)$(libdir)/libdw-$(PACKAGE_VERSION).so 86 ln -fs libdw-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libdw.so.$(VERSION) 87 ln -fs libdw.so.$(VERSION) $(DESTDIR)$(libdir)/libdw.so 88 89 uninstall: uninstall-am 90 rm -f $(DESTDIR)$(libdir)/libdw-$(PACKAGE_VERSION).so 91 rm -f $(DESTDIR)$(libdir)/libdw.so.$(VERSION) 92 rm -f $(DESTDIR)$(libdir)/libdw.so 93 rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils 94 endif 95 96 noinst_HEADERS = libdwP.h memory-access.h dwarf_abbrev_hash.h 97 98 EXTRA_DIST = libdw.map 99 100 CLEANFILES = $(am_libdw_pic_a_OBJECTS) 101