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 $(STACK_USAGE_NO_ERROR) 27 28bin_PROGRAMS = readelf nm size strip elflint findtextrel addr2line \ 29 elfcmp objdump ranlib strings ar unstrip stack elfcompress \ 30 elfclassify 31 32noinst_LIBRARIES = libar.a 33 34libar_a_SOURCES = arlib.c arlib2.c arlib-argp.c 35 36EXTRA_DIST = arlib.h debugpred.h 37 38bin_SCRIPTS = make-debug-archive 39EXTRA_DIST += make-debug-archive.in 40CLEANFILES += make-debug-archive 41 42if BUILD_STATIC 43libasm = ../libasm/libasm.a 44libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) -ldl -lpthread 45libelf = ../libelf/libelf.a -lz 46else 47libasm = ../libasm/libasm.so 48libdw = ../libdw/libdw.so 49libelf = ../libelf/libelf.so 50endif 51libebl = ../libebl/libebl.a ../backends/libebl_backends.a ../libcpu/libcpu.a 52libeu = ../lib/libeu.a 53 54if DEMANGLE 55demanglelib = -lstdc++ 56endif 57 58# Bad, bad stack usage... 59readelf_no_Wstack_usage = yes 60nm_no_Wstack_usage = yes 61size_no_Wstack_usage = yes 62strip_no_Wstack_usage = yes 63elflint_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) 71nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS) \ 72 $(demanglelib) 73size_LDADD = $(libelf) $(libeu) $(argp_LDADD) 74strip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) 75elflint_LDADD = $(libebl) $(libdw) $(libelf) $(libeu) $(argp_LDADD) 76findtextrel_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) 77addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(demanglelib) 78elfcmp_LDADD = $(libebl) $(libdw) $(libelf) $(libeu) $(argp_LDADD) 79objdump_LDADD = $(libasm) $(libebl) $(libdw) $(libelf) $(libeu) $(argp_LDADD) 80ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS) 81strings_LDADD = $(libelf) $(libeu) $(argp_LDADD) 82ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS) 83unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) 84stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) $(demanglelib) 85elfcompress_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) 86elfclassify_LDADD = $(libelf) $(libdw) $(libeu) $(argp_LDADD) 87 88installcheck-binPROGRAMS: $(bin_PROGRAMS) 89 bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \ 90 case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ 91 *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ 92 esac; \ 93 f=`echo "$$p" | \ 94 sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ 95 for opt in --help --version; do \ 96 if LD_LIBRARY_PATH=$(DESTDIR)$(libdir) \ 97 $(DESTDIR)$(bindir)/$$f $$opt > c$${pid}_.out 2> c$${pid}_.err \ 98 && test -n "`cat c$${pid}_.out`" \ 99 && test -z "`cat c$${pid}_.err`"; then :; \ 100 else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \ 101 done; \ 102 done; rm -f c$${pid}_.???; exit $$bad 103 104CLEANFILES += *.gconv 105 106make-debug-archive: $(srcdir)/make-debug-archive.in 107 $(AM_V_GEN)UNSTRIP=$(bindir)/`echo unstrip | sed '$(transform)'`; \ 108 AR=$(bindir)/`echo ar | sed '$(transform)'`; \ 109 sed -e "s,[@]UNSTRIP[@],$$UNSTRIP,g" -e "s,[@]AR[@],$$AR,g" \ 110 -e "s%[@]PACKAGE_NAME[@]%$(PACKAGE_NAME)%g" \ 111 -e "s%[@]PACKAGE_VERSION[@]%$(PACKAGE_VERSION)%g" \ 112 $(srcdir)/make-debug-archive.in > $@.new 113 $(AM_V_at)chmod +x $@.new 114 $(AM_V_at)mv -f $@.new $@ 115