• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## Process this file with automake to create Makefile.in
2##
3## Copyright (C) 1996-2014, 2016 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 the GNU General Public License as published by
8## the Free Software Foundation; either version 3 of the License, or
9## (at your option) any later version.
10##
11## elfutils is distributed in the hope that it will be useful, but
12## WITHOUT ANY WARRANTY; without even the implied warranty of
13## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14## GNU General Public License for more details.
15##
16## You should have received a copy of the GNU General Public License
17## along with this program.  If not, see <http://www.gnu.org/licenses/>.
18##
19include $(top_srcdir)/config/eu.am
20DEFS += $(YYDEBUG) -DDEBUGPRED=@DEBUGPRED@ \
21	-DSRCDIR=\"$(shell cd $(srcdir);pwd)\" -DOBJDIR=\"$(shell pwd)\"
22AM_CPPFLAGS += -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
23	    -I$(srcdir)/../libdw -I$(srcdir)/../libdwelf \
24	    -I$(srcdir)/../libdwfl -I$(srcdir)/../libasm
25
26AM_LDFLAGS = -Wl,-rpath-link,../libelf:../libdw
27
28bin_PROGRAMS = readelf nm size strip elflint findtextrel addr2line \
29	       elfcmp objdump ranlib strings ar unstrip stack elfcompress
30
31noinst_LIBRARIES = libar.a
32
33libar_a_SOURCES = arlib.c arlib2.c arlib-argp.c
34
35EXTRA_DIST = arlib.h debugpred.h
36
37bin_SCRIPTS = make-debug-archive
38EXTRA_DIST += make-debug-archive.in
39CLEANFILES += make-debug-archive
40
41if BUILD_STATIC
42libasm = ../libasm/libasm.a
43libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl
44libelf = ../libelf/libelf.a -lz
45else
46libasm = ../libasm/libasm.so
47libdw = ../libdw/libdw.so
48libelf = ../libelf/libelf.so
49endif
50libebl = ../libebl/libebl.a
51libeu = ../lib/libeu.a
52
53if DEMANGLE
54demanglelib = -lstdc++
55endif
56
57# Bad, bad stack usage...
58readelf_no_Wstack_usage = yes
59nm_no_Wstack_usage = yes
60size_no_Wstack_usage = yes
61strip_no_Wstack_usage = yes
62elflint_no_Wstack_usage = yes
63findtextrel_no_Wstack_usage = yes
64elfcmp_no_Wstack_usage = yes
65objdump_no_Wstack_usage = yes
66ranlib_no_Wstack_usage = yes
67ar_no_Wstack_usage = yes
68unstrip_no_Wstack_usage = yes
69
70readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
71nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl \
72	   $(demanglelib)
73size_LDADD = $(libelf) $(libeu) $(argp_LDADD)
74strip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) -ldl
75elflint_LDADD  = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
76findtextrel_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD)
77addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(demanglelib)
78elfcmp_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
79objdump_LDADD  = $(libasm) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl
80ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD)
81strings_LDADD = $(libelf) $(libeu) $(argp_LDADD)
82ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD)
83unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) -ldl
84stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) -ldl $(demanglelib)
85elfcompress_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
86
87installcheck-binPROGRAMS: $(bin_PROGRAMS)
88	bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \
89	  case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
90	   *" $$p "* | *" $(srcdir)/$$p "*) continue;; \
91	  esac; \
92	  f=`echo "$$p" | \
93	     sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
94	  for opt in --help --version; do \
95	    if LD_LIBRARY_PATH=$(DESTDIR)$(libdir) \
96	       $(DESTDIR)$(bindir)/$$f $$opt > c$${pid}_.out 2> c$${pid}_.err \
97		 && test -n "`cat c$${pid}_.out`" \
98		 && test -z "`cat c$${pid}_.err`"; then :; \
99	    else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
100	  done; \
101	done; rm -f c$${pid}_.???; exit $$bad
102
103CLEANFILES += *.gconv
104
105make-debug-archive: $(srcdir)/make-debug-archive.in
106	$(AM_V_GEN)UNSTRIP=$(bindir)/`echo unstrip | sed '$(transform)'`; \
107	AR=$(bindir)/`echo ar | sed '$(transform)'`; \
108	sed -e "s,[@]UNSTRIP[@],$$UNSTRIP,g" -e "s,[@]AR[@],$$AR,g" \
109	    -e "s%[@]PACKAGE_NAME[@]%$(PACKAGE_NAME)%g" \
110	    -e "s%[@]PACKAGE_VERSION[@]%$(PACKAGE_VERSION)%g" \
111	    $(srcdir)/make-debug-archive.in > $@.new
112	$(AM_V_at)chmod +x $@.new
113	$(AM_V_at)mv -f $@.new $@
114