~ubuntu-branches/debian/lenny/elfutils/lenny

« back to all changes in this revision

Viewing changes to src/Makefile.am

  • Committer: Bazaar Package Importer
  • Author(s): Kurt Roeckx
  • Date: 2006-08-27 15:48:23 UTC
  • Revision ID: james.westby@ubuntu.com-20060827154823-mjwd7ydlbxgwqn4u
Tags: upstream-0.123
ImportĀ upstreamĀ versionĀ 0.123

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
## Process this file with automake to create Makefile.in
 
2
##
 
3
## Copyright (C) 1996-2002, 2003, 2004, 2005, 2006 Red Hat, Inc.
 
4
## This file is part of Red Hat elfutils.
 
5
##
 
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.
 
9
##
 
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.
 
14
##
 
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.
 
18
##
 
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>.
 
26
##
 
27
DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H $(YYDEBUG) \
 
28
       -DSRCDIR=\"$(shell cd $(srcdir);pwd)\" -DOBJDIR=\"$(shell pwd)\"
 
29
if MUDFLAP
 
30
AM_CFLAGS = -fmudflap
 
31
else
 
32
AM_CFLAGS =
 
33
endif
 
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)
 
38
 
 
39
INCLUDES = -I$(srcdir) -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
 
40
           -I$(srcdir)/../libdw -I$(srcdir)/../libdwfl \
 
41
           -I$(srcdir)/../lib -I..
 
42
 
 
43
AM_LDFLAGS = -Wl,-rpath-link,../libelf:../libdw
 
44
 
 
45
YACC = @YACC@ -d
 
46
AM_YFLAGS = -pld
 
47
AM_LFLAGS = -Pld -olex.yy.c
 
48
## Uncomment to enable debugging of linker script parser
 
49
##YYDEBUG = -DYYDEBUG=1
 
50
 
 
51
native_ld = @native_ld@
 
52
base_cpu = @base_cpu@
 
53
 
 
54
bin_PROGRAMS = readelf nm size strip ld elflint findtextrel addr2line \
 
55
               elfcmp objdump ranlib strings
 
56
 
 
57
 
 
58
ld_dsos = libld_elf_i386_pic.a
 
59
if NATIVE_LD
 
60
noinst_LIBRARIES = libld_elf.a
 
61
native_ld_cflags = -DBASE_ELF_NAME=elf_$(base_cpu)
 
62
else
 
63
noinst_LIBRARIES = libld_elf.a $(ld_dsos)
 
64
noinst_PROGRAMS = $(ld_dsos:_pic.a=.so)
 
65
endif
 
66
if NEVER
 
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
 
71
endif
 
72
 
 
73
textrel_check = if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
 
74
 
 
75
 
 
76
ld_SOURCES = ld.c ldgeneric.c ldlex.l ldscript.y symbolhash.c sectionhash.c \
 
77
             versionhash.c
 
78
 
 
79
noinst_HEADERS = ld.h symbolhash.h sectionhash.h versionhash.h \
 
80
                 ldscript.h xelf.h unaligned.h
 
81
 
 
82
EXTRA_DIST = elf32-i386.script libld_elf_i386.map $(ld_modules)
 
83
ld_modules = i386_ld.c
 
84
 
 
85
if MUDFLAP
 
86
libmudflap = -lmudflap
 
87
endif
 
88
 
 
89
if BUILD_STATIC
 
90
libdw = ../libdw/libdw.a $(libelf) $(libebl) -ldl
 
91
libelf = ../libelf/libelf.a
 
92
else
 
93
libdw = ../libdw/libdw.so
 
94
libelf = ../libelf/libelf.so
 
95
endif
 
96
libebl = ../libebl/libebl.a
 
97
libeu = ../lib/libeu.a
 
98
 
 
99
nm_no_Wformat = yes
 
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
 
104
 
 
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
 
110
if NATIVE_LD
 
111
# -ldl is always needed for libebl.
 
112
ld_LDADD += libld_elf.a
 
113
endif
 
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)
 
122
 
 
123
ldlex.o: ldscript.c
 
124
ldlex_no_Werror = yes
 
125
ldscript.h: ldscript.c
 
126
 
 
127
if NATIVE_LD
 
128
# Machine-specific linker code.
 
129
libld_elf_a_SOURCES := $(base_cpu)_ld.c
 
130
else
 
131
libld_elf_i386_pic_a_SOURCES =
 
132
am_libld_elf_i386_pic_a_OBJECTS = i386_ld.os
 
133
 
 
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 \
 
137
              $(libelf) $(libeu) \
 
138
              -Wl,--version-script,$(srcdir)/libld_elf_i386.map
 
139
        $(textrel_check)
 
140
endif
 
141
 
 
142
 
 
143
%.os: %.c %.o
 
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; \
 
150
        fi
 
151
 
 
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
 
155
        -:
 
156
 
 
157
 
 
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;; \
 
162
          esac; \
 
163
          f=`echo "$$p" | \
 
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; \
 
171
          done; \
 
172
        done; rm -f c$${pid}_.???; exit $$bad
 
173
 
 
174
CLEANFILES = none_ld.os $(ld_modules:.c=.os) *.gcno *.gcda *.gconv