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 ## 19 include $(top_srcdir)/config/eu.am 20 DEFS += $(YYDEBUG) -DDEBUGPRED=@DEBUGPRED@ \ 21 -DSRCDIR=\"$(shell cd $(srcdir);pwd)\" -DOBJDIR=\"$(shell pwd)\" 22 AM_CPPFLAGS += -I$(srcdir)/../libelf -I$(srcdir)/../libebl \ 23 -I$(srcdir)/../libdw -I$(srcdir)/../libdwelf \ 24 -I$(srcdir)/../libdwfl -I$(srcdir)/../libasm 25 26 AM_LDFLAGS = -Wl,-rpath-link,../libelf:../libdw 27 28 bin_PROGRAMS = readelf nm size strip elflint findtextrel addr2line \ 29 elfcmp objdump ranlib strings ar unstrip stack elfcompress 30 31 noinst_LIBRARIES = libar.a 32 33 libar_a_SOURCES = arlib.c arlib2.c arlib-argp.c 34 35 EXTRA_DIST = arlib.h debugpred.h 36 37 bin_SCRIPTS = make-debug-archive 38 EXTRA_DIST += make-debug-archive.in 39 CLEANFILES += make-debug-archive 40 41 if BUILD_STATIC 42 libasm = ../libasm/libasm.a 43 libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl 44 libelf = ../libelf/libelf.a -lz 45 else 46 libasm = ../libasm/libasm.so 47 libdw = ../libdw/libdw.so 48 libelf = ../libelf/libelf.so 49 endif 50 libebl = ../libebl/libebl.a 51 libeu = ../lib/libeu.a 52 53 if DEMANGLE 54 demanglelib = -lstdc++ 55 endif 56 57 # Bad, bad stack usage... 58 readelf_no_Wstack_usage = yes 59 nm_no_Wstack_usage = yes 60 size_no_Wstack_usage = yes 61 strip_no_Wstack_usage = yes 62 elflint_no_Wstack_usage = yes 63 findtextrel_no_Wstack_usage = yes 64 elfcmp_no_Wstack_usage = yes 65 objdump_no_Wstack_usage = yes 66 ranlib_no_Wstack_usage = yes 67 ar_no_Wstack_usage = yes 68 unstrip_no_Wstack_usage = yes 69 70 readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl 71 nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl \ 72 $(demanglelib) 73 size_LDADD = $(libelf) $(libeu) $(argp_LDADD) 74 strip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) -ldl 75 elflint_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl 76 findtextrel_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) 77 addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(demanglelib) 78 elfcmp_LDADD = $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl 79 objdump_LDADD = $(libasm) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl 80 ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) 81 strings_LDADD = $(libelf) $(libeu) $(argp_LDADD) 82 ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) 83 unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) -ldl 84 stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) -ldl $(demanglelib) 85 elfcompress_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) 86 87 installcheck-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 103 CLEANFILES += *.gconv 104 105 make-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