• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## Process this file with automake to create Makefile.in
2##
3## Copyright (C) 2002-2010, 2012, 2014, 2016, 2018 Red Hat, Inc.
4## This file is part of elfutils.
5##
6## This file is free software; you can redistribute it and/or modify
7## it under the terms of either
8##
9##   * the GNU Lesser General Public License as published by the Free
10##     Software Foundation; either version 3 of the License, or (at
11##     your option) any later version
12##
13## or
14##
15##   * the GNU General Public License as published by the Free
16##     Software Foundation; either version 2 of the License, or (at
17##     your option) any later version
18##
19## or both in parallel, as here.
20##
21## elfutils is distributed in the hope that it will be useful, but
22## WITHOUT ANY WARRANTY; without even the implied warranty of
23## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
24## General Public License for more details.
25##
26## You should have received copies of the GNU General Public License and
27## the GNU Lesser General Public License along with this program.  If
28## not, see <http://www.gnu.org/licenses/>.
29##
30include $(top_srcdir)/config/eu.am
31if BUILD_STATIC
32AM_CFLAGS += $(fpic_CFLAGS)
33endif
34AM_CPPFLAGS += -I$(srcdir)/../libelf -I$(srcdir)/../libdwelf
35VERSION = 1
36
37lib_LIBRARIES = libdw.a
38noinst_LIBRARIES = libdw_pic.a
39noinst_PROGRAMS = $(noinst_LIBRARIES:_pic.a=.so)
40
41include_HEADERS = dwarf.h
42pkginclude_HEADERS = libdw.h known-dwarf.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 dwarf_line_file.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_getparamcnt.c	\
75		  dwarf_macro_opcode.c dwarf_macro_param.c	\
76		  dwarf_macro_param1.c dwarf_macro_param2.c	\
77		  dwarf_macro_getsrcfiles.c			\
78		  dwarf_addrdie.c dwarf_getfuncs.c \
79		  dwarf_decl_file.c dwarf_decl_line.c dwarf_decl_column.c \
80		  dwarf_func_inline.c dwarf_getsrc_file.c \
81		  libdw_findcu.c libdw_form.c libdw_alloc.c \
82		  libdw_visit_scopes.c \
83		  dwarf_entry_breakpoints.c \
84		  dwarf_next_cfi.c \
85		  cie.c fde.c cfi.c frame-cache.c \
86		  dwarf_frame_info.c dwarf_frame_cfa.c dwarf_frame_register.c \
87		  dwarf_cfi_addrframe.c \
88		  dwarf_getcfi.c dwarf_getcfi_elf.c dwarf_cfi_end.c \
89		  dwarf_aggregate_size.c dwarf_getlocation_implicit_pointer.c \
90		  dwarf_getlocation_die.c dwarf_getlocation_attr.c \
91		  dwarf_getalt.c dwarf_setalt.c dwarf_cu_getdwarf.c \
92		  dwarf_cu_die.c dwarf_peel_type.c dwarf_default_lower_bound.c \
93		  dwarf_die_addr_die.c dwarf_get_units.c \
94		  libdw_find_split_unit.c dwarf_cu_info.c \
95		  dwarf_next_lines.c
96
97if MAINTAINER_MODE
98BUILT_SOURCES = $(srcdir)/known-dwarf.h
99MAINTAINERCLEANFILES = $(srcdir)/known-dwarf.h
100$(srcdir)/known-dwarf.h: $(top_srcdir)/config/known-dwarf.awk $(srcdir)/dwarf.h
101	gawk -f $^ > $@.new
102	mv -f $@.new $@
103endif
104
105libdw_pic_a_SOURCES =
106am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
107
108libdw_so_LIBS = libdw_pic.a ../libdwelf/libdwelf_pic.a \
109	  ../libdwfl/libdwfl_pic.a ../libebl/libebl.a
110libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so
111libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS)
112libdw_so_SOURCES =
113libdw.so$(EXEEXT): $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS)
114# The rpath is necessary for libebl because its $ORIGIN use will
115# not fly in a setuid executable that links in libdw.
116	$(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
117		-Wl,--soname,$@.$(VERSION) \
118		-Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
119		-Wl,--version-script,$<,--no-undefined \
120		-Wl,--whole-archive $(libdw_so_LIBS) -Wl,--no-whole-archive \
121		$(libdw_so_LDLIBS)
122	@$(textrel_check)
123	$(AM_V_at)ln -fs $@ $@.$(VERSION)
124
125install: install-am libdw.so
126	$(mkinstalldirs) $(DESTDIR)$(libdir)
127	$(INSTALL_PROGRAM) libdw.so $(DESTDIR)$(libdir)/libdw-$(PACKAGE_VERSION).so
128	ln -fs libdw-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libdw.so.$(VERSION)
129	ln -fs libdw.so.$(VERSION) $(DESTDIR)$(libdir)/libdw.so
130
131uninstall: uninstall-am
132	rm -f $(DESTDIR)$(libdir)/libdw-$(PACKAGE_VERSION).so
133	rm -f $(DESTDIR)$(libdir)/libdw.so.$(VERSION)
134	rm -f $(DESTDIR)$(libdir)/libdw.so
135	rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils
136
137libdwfl_objects = $(shell $(AR) t ../libdwfl/libdwfl.a)
138libdw_a_LIBADD = $(addprefix ../libdwfl/,$(libdwfl_objects))
139
140libdwelf_objects = $(shell $(AR) t ../libdwelf/libdwelf.a)
141libdw_a_LIBADD += $(addprefix ../libdwelf/,$(libdwelf_objects))
142
143noinst_HEADERS = libdwP.h memory-access.h dwarf_abbrev_hash.h \
144		 dwarf_sig8_hash.h cfi.h encoded-value.h
145
146EXTRA_DIST = libdw.map
147
148MOSTLYCLEANFILES = $(am_libdw_pic_a_OBJECTS) libdw.so.$(VERSION)
149