]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gold/Makefile.am
2009-12-17 Rafael Avila de Espindola <espindola@google.com>
[thirdparty/binutils-gdb.git] / gold / Makefile.am
1 # Process this file with automake to generate Makefile.in
2
3 AUTOMAKE_OPTIONS = foreign
4
5 SUBDIRS = po testsuite
6
7 tooldir = $(exec_prefix)/$(target_alias)
8
9 ACLOCAL_AMFLAGS = -I ../bfd -I ../config
10
11 AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS)
12 AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS)
13
14 AM_CPPFLAGS = \
15 -I$(srcdir) -I$(srcdir)/../include -I$(srcdir)/../elfcpp \
16 -DLOCALEDIR="\"$(datadir)/locale\"" \
17 -DBINDIR="\"$(bindir)\"" -DTOOLBINDIR="\"$(tooldir)/bin\"" \
18 @INCINTL@
19
20 LIBIBERTY = ../libiberty/libiberty.a
21
22 if PLUGINS
23 LIBDL = -ldl
24 endif
25
26 if THREADS
27 THREADSLIB = -lpthread
28 endif
29
30 AM_YFLAGS = -d
31
32 # Automake 1.10+ disables lex and yacc output file regeneration if
33 # maintainer mode is disabled. Avoid this.
34 am__skiplex =
35 am__skipyacc =
36
37 noinst_PROGRAMS = ld-new incremental-dump
38 noinst_LIBRARIES = libgold.a
39
40 CCFILES = \
41 archive.cc \
42 attributes.cc \
43 binary.cc \
44 common.cc \
45 compressed_output.cc \
46 copy-relocs.cc \
47 cref.cc \
48 defstd.cc \
49 descriptors.cc \
50 dirsearch.cc \
51 dynobj.cc \
52 dwarf_reader.cc \
53 ehframe.cc \
54 errors.cc \
55 expression.cc \
56 fileread.cc \
57 gc.cc \
58 gold.cc \
59 gold-threads.cc \
60 icf.cc \
61 incremental.cc \
62 int_encoding.cc \
63 layout.cc \
64 mapfile.cc \
65 merge.cc \
66 object.cc \
67 options.cc \
68 output.cc \
69 parameters.cc \
70 plugin.cc \
71 readsyms.cc \
72 reduced_debug_output.cc \
73 reloc.cc \
74 resolve.cc \
75 script-sections.cc \
76 script.cc \
77 stringpool.cc \
78 symtab.cc \
79 target.cc \
80 target-select.cc \
81 timer.cc \
82 version.cc \
83 workqueue.cc \
84 workqueue-threads.cc
85
86 HFILES = \
87 archive.h \
88 attributes.h \
89 binary.h \
90 common.h \
91 compressed_output.h \
92 copy-relocs.h \
93 cref.h \
94 defstd.h \
95 dirsearch.h \
96 descriptors.h \
97 dynobj.h \
98 dwarf_reader.h \
99 ehframe.h \
100 errors.h \
101 fileread.h \
102 freebsd.h \
103 gc.h \
104 gold.h \
105 gold-threads.h \
106 icf.h \
107 int_encoding.h \
108 layout.h \
109 mapfile.h \
110 merge.h \
111 object.h \
112 options.h \
113 output.h \
114 parameters.h \
115 plugin.h \
116 readsyms.h \
117 reduced_debug_output.h \
118 reloc.h \
119 reloc-types.h \
120 script-c.h \
121 script-sections.h \
122 script.h \
123 stringpool.h \
124 symtab.h \
125 target.h \
126 target-reloc.h \
127 target-select.h \
128 timer.h \
129 tls.h \
130 token.h \
131 workqueue.h \
132 workqueue-internal.h
133
134 YFILES = \
135 yyscript.y
136
137 EXTRA_DIST = yyscript.c yyscript.h
138
139 TARGETSOURCES = \
140 i386.cc x86_64.cc sparc.cc powerpc.cc arm.cc
141
142 ALL_TARGETOBJS = \
143 i386.$(OBJEXT) x86_64.$(OBJEXT) sparc.$(OBJEXT) powerpc.$(OBJEXT) \
144 arm.$(OBJEXT)
145
146 libgold_a_SOURCES = $(CCFILES) $(HFILES) $(YFILES)
147 libgold_a_LIBADD = $(LIBOBJS)
148
149 sources_var = main.cc
150 deps_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL_DEP)
151 ldadd_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL) \
152 $(THREADSLIB) $(LIBDL)
153
154 ld_new_SOURCES = $(sources_var)
155 ld_new_DEPENDENCIES = $(deps_var)
156 ld_new_LDADD = $(ldadd_var)
157
158 EXTRA_ld_new_SOURCES = $(TARGETSOURCES)
159
160 incremental_dump_SOURCES = incremental-dump.cc
161 incremental_dump_DEPENDENCIES = $(TARGETOBJS) libgold.a $(LIBIBERTY) \
162 $(THREADSLIB) $(LIBDL)
163 incremental_dump_LDADD = $(TARGETOBJS) libgold.a $(LIBIBERTY) \
164 $(THREADSLIB) $(LIBDL)
165
166 # Use an explicit dependency for the bison generated header file.
167 expression.$(OBJEXT): yyscript.h
168 script-sections.$(OBJEXT): yyscript.h
169 script.$(OBJEXT): yyscript.h
170
171 # We have to build libgold.a before we run the tests.
172 check: libgold.a
173
174 .PHONY: install-exec-local
175
176 install-exec-local: ld-new$(EXEEXT)
177 $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/bin
178 n=`echo ld | sed '$(transform)'`; \
179 $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${n}$(EXEEXT); \
180 if test "$(bindir)" != "$(tooldir)/bin"; then \
181 rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
182 ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
183 || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
184 fi
185
186 # We want install to imply install-info as per GNU standards, despite
187 # the cygnus option.
188 install-data-local: install-info
189
190 POTFILES= $(CCFILES) $(HFILES) $(TARGETSOURCES)
191
192 po/POTFILES.in: @MAINT@ Makefile
193 for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
194 && mv tmp $(srcdir)/po/POTFILES.in
195
196 # Bootstrap test support. We use ld-new to build ld1, then use ld1 to
197 # build ld2. ld1 and ld2 should be identical. ld-new need not be
198 # identical to ld1, since it was linked with the host linker.
199
200 if GCC
201 if NATIVE_LINKER
202
203 gcctestdir1/ld: ld-new
204 test -d gcctestdir1 || mkdir -p gcctestdir1
205 rm -f gcctestdir1/ld
206 (cd gcctestdir1 && $(LN_S) ../ld-new ld)
207
208 ld1_SOURCES = $(sources_var)
209 ld1_DEPENDENCIES = $(deps_var) gcctestdir1/ld
210 ld1_LDADD = $(ldadd_var)
211 ld1_LDFLAGS = -Bgcctestdir1/
212
213 gcctestdir2/ld: ld1
214 test -d gcctestdir2 || mkdir -p gcctestdir2
215 rm -f gcctestdir2/ld
216 (cd gcctestdir2 && $(LN_S) ../ld1 ld)
217
218 ld2_SOURCES = $(sources_var)
219 ld2_DEPENDENCIES = $(deps_var) gcctestdir2/ld
220 ld2_LDADD = $(ldadd_var)
221 ld2_LDFLAGS = -Bgcctestdir2/
222
223 bootstrap-test: ld2
224 rm -f $@
225 echo "#!/bin/sh" > $@
226 echo "cmp ld1 ld2" > $@
227 chmod +x $@
228
229 libgold-1-r.o: gcctestdir1/ld libgold.a
230 gcctestdir1/ld -o $@ -r --whole-archive libgold.a
231
232 ld1_r_SOURCES = $(sources_var)
233 ld1_r_DEPENDENCIES = libgold-1-r.o $(deps_var) gcctestdir1/ld
234 ld1_r_LDADD = libgold-1-r.o $(ldadd_var)
235 ld1_r_LDFLAGS = -Bgcctestdir1/
236
237 gcctestdir2-r/ld: ld1-r
238 test -d gcctestdir2-r || mkdir -p gcctestdir2-r
239 rm -f gcctestdir2-r/ld
240 (cd gcctestdir2-r && $(LN_S) ../ld1-r ld)
241
242 libgold-2-r.o: gcctestdir2-r/ld libgold.a
243 gcctestdir2-r/ld -o $@ -r --whole-archive libgold.a
244
245 ld2_r_SOURCES = $(sources_var)
246 ld2_r_DEPENDENCIES = libgold-2-r.o $(deps_var) gcctestdir2-r/ld
247 ld2_r_LDADD = libgold-2-r.o $(ldadd_var)
248 ld2_r_LDFLAGS = -Bgcctestdir2-r/
249
250 bootstrap-test-r: ld2-r
251 rm -f $@
252 echo "#!/bin/sh" > $@
253 echo "cmp ld1-r ld2-r" > $@
254 chmod +x $@
255
256 check_PROGRAMS = ld1 ld2 ld1-r ld2-r
257 TESTS = bootstrap-test bootstrap-test-r
258
259 endif
260 endif