1
## Process this file with automake to create Makefile.in
3
## Copyright (C) 1996-2002, 2003, 2004, 2005, 2006 Red Hat, Inc.
4
## This file is part of Red Hat elfutils.
6
## Red Hat elfutils is free software; you can redistribute it and/or modify
7
## it under the terms of the GNU General Public License as published by the
8
## Free Software Foundation; version 2 of the License.
10
## Red Hat elfutils is distributed in the hope that it will be useful, but
11
## WITHOUT ANY WARRANTY; without even the implied warranty of
12
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
## General Public License for more details.
15
## You should have received a copy of the GNU General Public License along
16
## with Red Hat elfutils; if not, write to the Free Software Foundation,
17
## Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
19
## Red Hat elfutils is an included package of the Open Invention Network.
20
## An included package of the Open Invention Network is a package for which
21
## Open Invention Network licensees cross-license their patents. No patent
22
## license is granted, either expressly or impliedly, by designation as an
23
## included package. Should you wish to participate in the Open Invention
24
## Network licensing program, please visit www.openinventionnetwork.com
25
## <http://www.openinventionnetwork.com>.
27
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H $(YYDEBUG) \
28
-DSRCDIR=\"$(shell cd $(srcdir);pwd)\" -DOBJDIR=\"$(shell pwd)\"
34
AM_CFLAGS += -Wall -Wshadow -std=gnu99 $(native_ld_cflags) \
35
$(if $($(*F)_no_Werror),,-Werror) \
36
$(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
37
$(if $($(*F)_no_Wformat),,-Wformat=2)
39
INCLUDES = -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
40
-I$(srcdir)/../libdw -I$(srcdir)/../libdwfl \
41
-I$(srcdir)/../lib -I..
43
AM_LDFLAGS = -Wl,-rpath-link,../libelf:../libdw
47
AM_LFLAGS = -Pld -olex.yy.c
48
## Uncomment to enable debugging of linker script parser
49
##YYDEBUG = -DYYDEBUG=1
51
native_ld = @native_ld@
54
bin_PROGRAMS = readelf nm size strip ld elflint findtextrel addr2line \
55
elfcmp objdump ranlib strings
58
ld_dsos = libld_elf_i386_pic.a
60
noinst_LIBRARIES = libld_elf.a
61
native_ld_cflags = -DBASE_ELF_NAME=elf_$(base_cpu)
63
noinst_LIBRARIES = libld_elf.a $(ld_dsos)
64
noinst_PROGRAMS = $(ld_dsos:_pic.a=.so)
67
# We never build this library but we need to get the dependency files
68
# of all the linker backends that might be used in a non-generic linker.
69
noinst_LIBRARIES += libdummy.a
70
libdummy_a_SOURCES = i386_ld.c
73
textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
76
ld_SOURCES = ld.c ldgeneric.c ldlex.l ldscript.y symbolhash.c sectionhash.c \
79
noinst_HEADERS = ld.h symbolhash.h sectionhash.h versionhash.h \
80
ldscript.h xelf.h unaligned.h
82
EXTRA_DIST = elf32-i386.script libld_elf_i386.map $(ld_modules)
83
ld_modules = i386_ld.c
86
libmudflap = -lmudflap
90
libdw = ../libdw/libdw.a $(libelf) $(libebl) -ldl
91
libelf = ../libelf/libelf.a
93
libdw = ../libdw/libdw.so
94
libelf = ../libelf/libelf.so
96
libebl = ../libebl/libebl.a
97
libeu = ../lib/libeu.a
100
size_no_Wformat = yes
101
strings_no_Wformat = yes
102
# XXX While the file is not finished, don't warn about this
103
ldgeneric_no_Wunused = yes
105
readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
106
nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
107
size_LDADD = $(libelf) $(libeu) $(libmudflap)
108
strip_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
109
ld_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
111
# -ldl is always needed for libebl.
112
ld_LDADD += libld_elf.a
114
ld_LDFLAGS = -rdynamic
115
elflint_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
116
findtextrel_LDADD = $(libdw) $(libelf) $(libmudflap)
117
addr2line_LDADD = $(libdw) $(libmudflap)
118
elfcmp_LDADD = $(libebl) $(libelf) $(libmudflap) -ldl
119
objdump_LDADD = $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
120
ranlib_LDADD = $(libelf) $(libeu) $(libmudflap)
121
strings_LDADD = $(libelf) $(libeu) $(libmudflap)
124
ldlex_no_Werror = yes
125
ldscript.h: ldscript.c
128
# Machine-specific linker code.
129
libld_elf_a_SOURCES := $(base_cpu)_ld.c
131
libld_elf_i386_pic_a_SOURCES =
132
am_libld_elf_i386_pic_a_OBJECTS = i386_ld.os
134
libld_elf_i386_so_SOURCES =
135
libld_elf_i386.so: libld_elf_i386_pic.a libld_elf_i386.map
136
$(CC) -shared -o $@ -Wl,--whole-archive,$<,--no-whole-archive \
138
-Wl,--version-script,$(srcdir)/libld_elf_i386.map
144
if $(filter-out -fmudflap,$(COMPILE)) -c -o $@ -fpic -DPIC -DSHARED \
145
-MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
146
`test -f '$<' || echo '$(srcdir)/'`$<; \
147
then cat "$(DEPDIR)/$*.Tpo" >> "$(DEPDIR)/$*.Po"; \
148
rm -f "$(DEPDIR)/$*.Tpo"; \
149
else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
152
# Special rule to make it possible to define libld_elf_a_SOURCES as we do.
153
# Otherwise make would complain.
154
.deps/none_ld.Po: none_ld.os
158
installcheck-binPROGRAMS: $(bin_PROGRAMS)
159
bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \
160
case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
161
*" $$p "* | *" $(srcdir)/$$p "*) continue;; \
164
sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
165
for opt in --help --version; do \
166
if LD_LIBRARY_PATH=$(DESTDIR)$(libdir) \
167
$(DESTDIR)$(bindir)/$$f $$opt > c$${pid}_.out 2> c$${pid}_.err \
168
&& test -n "`cat c$${pid}_.out`" \
169
&& test -z "`cat c$${pid}_.err`"; then :; \
170
else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
172
done; rm -f c$${pid}_.???; exit $$bad
174
CLEANFILES = none_ld.os $(ld_modules:.c=.os) *.gcno *.gcda *.gconv