Commit | Line | Data |
---|---|---|
5bf135a7 NC |
1 | ## Process this file with automake to generate Makefile.in |
2 | # | |
b90efa5b | 3 | # Copyright (C) 2006-2015 Free Software Foundation, Inc. |
5bf135a7 NC |
4 | # |
5 | # This file is free software; you can redistribute it and/or modify | |
6 | # it under the terms of the GNU General Public License as published by | |
7 | # the Free Software Foundation; either version 3 of the License, or | |
8 | # (at your option) any later version. | |
f2c7d7ee | 9 | # |
5bf135a7 NC |
10 | # This program is distributed in the hope that it will be useful, |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | # GNU General Public License for more details. | |
f2c7d7ee | 14 | # |
5bf135a7 NC |
15 | # You should have received a copy of the GNU General Public License |
16 | # along with this program; see the file COPYING3. If not see | |
17 | # <http://www.gnu.org/licenses/>. | |
18 | # | |
bae7f79e | 19 | |
c462b41b | 20 | AUTOMAKE_OPTIONS = foreign |
bae7f79e | 21 | |
5a6f7e2d | 22 | SUBDIRS = po testsuite |
bae7f79e ILT |
23 | |
24 | tooldir = $(exec_prefix)/$(target_alias) | |
25 | ||
26 | ACLOCAL_AMFLAGS = -I ../bfd -I ../config | |
27 | ||
1d1f116d CD |
28 | AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS) |
29 | AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS) | |
bae7f79e | 30 | |
14ec8efd | 31 | AM_CPPFLAGS = \ |
bae7f79e ILT |
32 | -I$(srcdir) -I$(srcdir)/../include -I$(srcdir)/../elfcpp \ |
33 | -DLOCALEDIR="\"$(datadir)/locale\"" \ | |
ad2d6943 | 34 | -DBINDIR="\"$(bindir)\"" -DTOOLBINDIR="\"$(tooldir)/bin\"" \ |
3f3cddf1 | 35 | -DTOOLLIBDIR="\"$(tooldir)/lib\"" @INCINTL@ |
bae7f79e | 36 | |
ad2d6943 ILT |
37 | LIBIBERTY = ../libiberty/libiberty.a |
38 | ||
89fc3421 | 39 | if PLUGINS |
0bf402d5 | 40 | LIBDL = @DLOPEN_LIBS@ |
89fc3421 CC |
41 | endif |
42 | ||
fe9a4c12 ILT |
43 | if THREADS |
44 | THREADSLIB = -lpthread | |
45 | endif | |
46 | ||
4991e922 | 47 | AM_YFLAGS = -d |
dbe717ef | 48 | |
a15af8e2 RW |
49 | # Automake 1.10+ disables lex and yacc output file regeneration if |
50 | # maintainer mode is disabled. Avoid this. | |
51 | am__skiplex = | |
52 | am__skipyacc = | |
53 | ||
77429909 CC |
54 | bin_PROGRAMS = dwp |
55 | ||
e2b8f3c4 | 56 | noinst_PROGRAMS = ld-new incremental-dump |
5a6f7e2d | 57 | noinst_LIBRARIES = libgold.a |
bae7f79e | 58 | |
14bfc3f5 | 59 | CCFILES = \ |
61ba1cf9 | 60 | archive.cc \ |
4f787271 | 61 | attributes.cc \ |
bc644c6c | 62 | binary.cc \ |
ead1e424 | 63 | common.cc \ |
9a0910c3 | 64 | compressed_output.cc \ |
12c0daef | 65 | copy-relocs.cc \ |
92de84a6 | 66 | cref.cc \ |
ead1e424 | 67 | defstd.cc \ |
2a00e4fb | 68 | descriptors.cc \ |
bae7f79e | 69 | dirsearch.cc \ |
dbe717ef | 70 | dynobj.cc \ |
5c2c6c95 | 71 | dwarf_reader.cc \ |
3151305a | 72 | ehframe.cc \ |
75f2446e | 73 | errors.cc \ |
e5756efb | 74 | expression.cc \ |
bae7f79e | 75 | fileread.cc \ |
6d03d481 | 76 | gc.cc \ |
c1027032 | 77 | gdb-index.cc \ |
bae7f79e ILT |
78 | gold.cc \ |
79 | gold-threads.cc \ | |
ef15dade | 80 | icf.cc \ |
0e879927 | 81 | incremental.cc \ |
4f787271 | 82 | int_encoding.cc \ |
a2fb1b05 | 83 | layout.cc \ |
7d9e3d98 | 84 | mapfile.cc \ |
b8e6aad9 | 85 | merge.cc \ |
2e702c99 | 86 | nacl.cc \ |
bae7f79e ILT |
87 | object.cc \ |
88 | options.cc \ | |
a2fb1b05 | 89 | output.cc \ |
7e1edb90 | 90 | parameters.cc \ |
89fc3421 | 91 | plugin.cc \ |
bae7f79e | 92 | readsyms.cc \ |
62b01cb5 | 93 | reduced_debug_output.cc \ |
61ba1cf9 | 94 | reloc.cc \ |
14bfc3f5 | 95 | resolve.cc \ |
494e05f4 | 96 | script-sections.cc \ |
dbe717ef | 97 | script.cc \ |
14bfc3f5 | 98 | stringpool.cc \ |
c92003e0 | 99 | symtab.cc \ |
bb04269c | 100 | target.cc \ |
14bfc3f5 | 101 | target-select.cc \ |
d675ff46 | 102 | timer.cc \ |
8486ee48 | 103 | version.cc \ |
c7912668 ILT |
104 | workqueue.cc \ |
105 | workqueue-threads.cc | |
bae7f79e ILT |
106 | |
107 | HFILES = \ | |
0d31c79d | 108 | arm-reloc-property.h \ |
9363c7c3 | 109 | aarch64-reloc-property.h \ |
61ba1cf9 | 110 | archive.h \ |
4f787271 | 111 | attributes.h \ |
bc644c6c | 112 | binary.h \ |
ead1e424 | 113 | common.h \ |
9a0910c3 | 114 | compressed_output.h \ |
12c0daef | 115 | copy-relocs.h \ |
92de84a6 | 116 | cref.h \ |
ead1e424 | 117 | defstd.h \ |
bae7f79e | 118 | dirsearch.h \ |
2a00e4fb | 119 | descriptors.h \ |
dbe717ef | 120 | dynobj.h \ |
5c2c6c95 | 121 | dwarf_reader.h \ |
3151305a | 122 | ehframe.h \ |
75f2446e | 123 | errors.h \ |
bae7f79e | 124 | fileread.h \ |
36959681 | 125 | freebsd.h \ |
6d03d481 | 126 | gc.h \ |
c1027032 | 127 | gdb-index.h \ |
bae7f79e ILT |
128 | gold.h \ |
129 | gold-threads.h \ | |
ef15dade | 130 | icf.h \ |
4f787271 | 131 | int_encoding.h \ |
a2fb1b05 | 132 | layout.h \ |
7d9e3d98 | 133 | mapfile.h \ |
b8e6aad9 | 134 | merge.h \ |
2e702c99 | 135 | nacl.h \ |
bae7f79e ILT |
136 | object.h \ |
137 | options.h \ | |
a2fb1b05 | 138 | output.h \ |
7e1edb90 | 139 | parameters.h \ |
89fc3421 | 140 | plugin.h \ |
bae7f79e | 141 | readsyms.h \ |
62b01cb5 | 142 | reduced_debug_output.h \ |
61ba1cf9 | 143 | reloc.h \ |
c06b7b0b | 144 | reloc-types.h \ |
c06b7b0b | 145 | script-c.h \ |
494e05f4 ILT |
146 | script-sections.h \ |
147 | script.h \ | |
14bfc3f5 | 148 | stringpool.h \ |
bae7f79e ILT |
149 | symtab.h \ |
150 | target.h \ | |
61ba1cf9 | 151 | target-reloc.h \ |
14bfc3f5 | 152 | target-select.h \ |
d675ff46 | 153 | timer.h \ |
af6359d5 | 154 | tls.h \ |
17a1d0a9 | 155 | token.h \ |
c7912668 ILT |
156 | workqueue.h \ |
157 | workqueue-internal.h | |
bae7f79e | 158 | |
dbe717ef ILT |
159 | YFILES = \ |
160 | yyscript.y | |
161 | ||
9363c7c3 | 162 | DEFFILES = arm-reloc.def aarch64-reloc.def |
0d31c79d | 163 | |
dbe717ef | 164 | EXTRA_DIST = yyscript.c yyscript.h |
bae7f79e | 165 | |
6df6da4a | 166 | TARGETSOURCES = \ |
9810d34d | 167 | i386.cc x86_64.cc sparc.cc powerpc.cc arm.cc arm-reloc-property.cc tilegx.cc \ |
9363c7c3 | 168 | mips.cc aarch64.cc aarch64-reloc-property.cc |
6df6da4a ILT |
169 | |
170 | ALL_TARGETOBJS = \ | |
4a657b0d | 171 | i386.$(OBJEXT) x86_64.$(OBJEXT) sparc.$(OBJEXT) powerpc.$(OBJEXT) \ |
053a4d68 | 172 | arm.$(OBJEXT) arm-reloc-property.$(OBJEXT) tilegx.$(OBJEXT) \ |
9363c7c3 | 173 | mips.$(OBJEXT) aarch64.$(OBJEXT) aarch64-reloc-property.$(OBJEXT) |
6df6da4a | 174 | |
0d31c79d | 175 | libgold_a_SOURCES = $(CCFILES) $(HFILES) $(YFILES) $(DEFFILES) |
3d857b98 | 176 | libgold_a_LIBADD = $(LIBOBJS) |
bae7f79e | 177 | |
6df6da4a | 178 | sources_var = main.cc |
ad2d6943 | 179 | deps_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL_DEP) |
dc87f620 | 180 | ldadd_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(GOLD_LDADD) $(LIBINTL) \ |
89fc3421 | 181 | $(THREADSLIB) $(LIBDL) |
dc87f620 | 182 | ldflags_var = $(GOLD_LDFLAGS) |
537b5f51 ILT |
183 | |
184 | ld_new_SOURCES = $(sources_var) | |
3d857b98 DK |
185 | ld_new_DEPENDENCIES = $(deps_var) |
186 | ld_new_LDADD = $(ldadd_var) | |
dc87f620 | 187 | ld_new_LDFLAGS = $(ldflags_var) |
bae7f79e | 188 | |
6df6da4a ILT |
189 | EXTRA_ld_new_SOURCES = $(TARGETSOURCES) |
190 | ||
e2b8f3c4 | 191 | incremental_dump_SOURCES = incremental-dump.cc |
d56962d3 DK |
192 | incremental_dump_DEPENDENCIES = $(TARGETOBJS) libgold.a $(LIBIBERTY) \ |
193 | $(LIBINTL_DEP) | |
194 | incremental_dump_LDADD = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL) \ | |
3b0dd6ac | 195 | $(THREADSLIB) $(LIBDL) |
e2b8f3c4 | 196 | |
77429909 CC |
197 | dwp_SOURCES = dwp.cc |
198 | dwp_DEPENDENCIES = libgold.a $(LIBIBERTY) $(LIBINTL_DEP) | |
199 | dwp_LDADD = libgold.a $(LIBIBERTY) $(GOLD_LDADD) $(LIBINTL) $(THREADSLIB) \ | |
200 | $(LIBDL) | |
201 | dwp_LDFLAGS = $(GOLD_LDFLAGS) | |
202 | ||
270c9937 JB |
203 | CONFIG_STATUS_DEPENDENCIES = $(srcdir)/../bfd/development.sh |
204 | ||
dbe717ef | 205 | # Use an explicit dependency for the bison generated header file. |
7d320313 ILT |
206 | expression.$(OBJEXT): yyscript.h |
207 | script-sections.$(OBJEXT): yyscript.h | |
dbe717ef ILT |
208 | script.$(OBJEXT): yyscript.h |
209 | ||
5a6f7e2d ILT |
210 | # We have to build libgold.a before we run the tests. |
211 | check: libgold.a | |
212 | ||
bae7f79e ILT |
213 | .PHONY: install-exec-local |
214 | ||
215 | install-exec-local: ld-new$(EXEEXT) | |
216 | $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/bin | |
4fda8867 | 217 | n=`echo $(installed_linker) | sed '$(transform)'`; \ |
f2c7d7ee RM |
218 | $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) \ |
219 | ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${n}$(EXEEXT); \ | |
bae7f79e | 220 | if test "$(bindir)" != "$(tooldir)/bin"; then \ |
4fda8867 NC |
221 | rm -f $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT); \ |
222 | ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT) >/dev/null 2>/dev/null \ | |
f2c7d7ee | 223 | || $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT); \ |
4fda8867 NC |
224 | fi; \ |
225 | if test "x$(install_as_default)" = "xyes"; then \ | |
7ad2014a L |
226 | ld=`echo ld | sed '$(transform)'`; \ |
227 | rm -f $(DESTDIR)$(bindir)/$${ld}$(EXEEXT); \ | |
228 | ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(bindir)/$${ld}$(EXEEXT) >/dev/null 2>/dev/null \ | |
f2c7d7ee | 229 | || $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${ld}$(EXEEXT); \ |
4fda8867 NC |
230 | if test "$(bindir)" != "$(tooldir)/bin"; then \ |
231 | rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ | |
232 | ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \ | |
f2c7d7ee | 233 | || $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \ |
4fda8867 | 234 | fi; \ |
bae7f79e ILT |
235 | fi |
236 | ||
237 | # We want install to imply install-info as per GNU standards, despite | |
238 | # the cygnus option. | |
239 | install-data-local: install-info | |
5a6f7e2d | 240 | |
6df6da4a | 241 | POTFILES= $(CCFILES) $(HFILES) $(TARGETSOURCES) |
5a6f7e2d ILT |
242 | |
243 | po/POTFILES.in: @MAINT@ Makefile | |
323ee3f4 | 244 | for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \ |
5a6f7e2d | 245 | && mv tmp $(srcdir)/po/POTFILES.in |
537b5f51 ILT |
246 | |
247 | # Bootstrap test support. We use ld-new to build ld1, then use ld1 to | |
248 | # build ld2. ld1 and ld2 should be identical. ld-new need not be | |
249 | # identical to ld1, since it was linked with the host linker. | |
250 | ||
251 | if GCC | |
252 | if NATIVE_LINKER | |
253 | ||
254 | gcctestdir1/ld: ld-new | |
255 | test -d gcctestdir1 || mkdir -p gcctestdir1 | |
256 | rm -f gcctestdir1/ld | |
257 | (cd gcctestdir1 && $(LN_S) ../ld-new ld) | |
258 | ||
259 | ld1_SOURCES = $(sources_var) | |
260 | ld1_DEPENDENCIES = $(deps_var) gcctestdir1/ld | |
261 | ld1_LDADD = $(ldadd_var) | |
262 | ld1_LDFLAGS = -Bgcctestdir1/ | |
263 | ||
264 | gcctestdir2/ld: ld1 | |
265 | test -d gcctestdir2 || mkdir -p gcctestdir2 | |
266 | rm -f gcctestdir2/ld | |
267 | (cd gcctestdir2 && $(LN_S) ../ld1 ld) | |
268 | ||
269 | ld2_SOURCES = $(sources_var) | |
270 | ld2_DEPENDENCIES = $(deps_var) gcctestdir2/ld | |
271 | ld2_LDADD = $(ldadd_var) | |
272 | ld2_LDFLAGS = -Bgcctestdir2/ | |
273 | ||
537b5f51 ILT |
274 | bootstrap-test: ld2 |
275 | rm -f $@ | |
276 | echo "#!/bin/sh" > $@ | |
e7c5ea40 | 277 | echo "cmp ld1 ld2" >> $@ |
537b5f51 ILT |
278 | chmod +x $@ |
279 | ||
755ab8af ILT |
280 | libgold-1-r.o: gcctestdir1/ld libgold.a |
281 | gcctestdir1/ld -o $@ -r --whole-archive libgold.a | |
282 | ||
283 | ld1_r_SOURCES = $(sources_var) | |
284 | ld1_r_DEPENDENCIES = libgold-1-r.o $(deps_var) gcctestdir1/ld | |
285 | ld1_r_LDADD = libgold-1-r.o $(ldadd_var) | |
286 | ld1_r_LDFLAGS = -Bgcctestdir1/ | |
287 | ||
288 | gcctestdir2-r/ld: ld1-r | |
289 | test -d gcctestdir2-r || mkdir -p gcctestdir2-r | |
290 | rm -f gcctestdir2-r/ld | |
291 | (cd gcctestdir2-r && $(LN_S) ../ld1-r ld) | |
292 | ||
293 | libgold-2-r.o: gcctestdir2-r/ld libgold.a | |
294 | gcctestdir2-r/ld -o $@ -r --whole-archive libgold.a | |
295 | ||
296 | ld2_r_SOURCES = $(sources_var) | |
297 | ld2_r_DEPENDENCIES = libgold-2-r.o $(deps_var) gcctestdir2-r/ld | |
298 | ld2_r_LDADD = libgold-2-r.o $(ldadd_var) | |
299 | ld2_r_LDFLAGS = -Bgcctestdir2-r/ | |
300 | ||
301 | bootstrap-test-r: ld2-r | |
302 | rm -f $@ | |
303 | echo "#!/bin/sh" > $@ | |
e7c5ea40 | 304 | echo "cmp ld1-r ld2-r" >> $@ |
755ab8af ILT |
305 | chmod +x $@ |
306 | ||
307 | check_PROGRAMS = ld1 ld2 ld1-r ld2-r | |
308 | TESTS = bootstrap-test bootstrap-test-r | |
537b5f51 | 309 | |
e7c5ea40 CC |
310 | # Verify that changing the number of threads doesn't change the |
311 | # treehash computation, by building ld1 and ld3 the same way except | |
312 | # for the number of threads. However, the build ID should change if | |
313 | # we change the chunk size for --build-id=tree, so ld4 should be | |
314 | # different. We run the latter test even if multithreading is unavailable, | |
315 | # because the treehash can still operate in that mode. | |
316 | check_PROGRAMS += ld4 | |
317 | TESTS += bootstrap-test-treehash-chunksize | |
318 | ||
319 | gcctestdir3/ld: ld-new | |
320 | test -d gcctestdir3 || mkdir -p gcctestdir3 | |
321 | rm -f gcctestdir3/ld | |
322 | (cd gcctestdir3 && $(LN_S) ../ld-new ld) | |
323 | ||
324 | ld3_SOURCES = $(sources_var) | |
325 | ld3_DEPENDENCIES = $(deps_var) gcctestdir3/ld | |
326 | ld3_LDADD = $(ldadd_var) | |
327 | ld3_LDFLAGS = -Bgcctestdir3/ | |
328 | ||
329 | gcctestdir4/ld: ld-new | |
330 | test -d gcctestdir4 || mkdir -p gcctestdir4 | |
331 | rm -f gcctestdir4/ld | |
332 | (cd gcctestdir4 && $(LN_S) ../ld-new ld) | |
333 | ||
334 | ld4_SOURCES = $(sources_var) | |
335 | ld4_DEPENDENCIES = $(deps_var) gcctestdir4/ld | |
336 | ld4_LDADD = $(ldadd_var) | |
337 | ld4_LDFLAGS = -Bgcctestdir4/ | |
338 | ||
339 | ld1_LDFLAGS += -Wl,--build-id=tree -Wl,--build-id-chunk-size-for-treehash=12345 -Wl,--build-id-min-file-size-for-treehash=0 | |
340 | ld2_LDFLAGS += -Wl,--build-id=tree -Wl,--build-id-chunk-size-for-treehash=12345 -Wl,--build-id-min-file-size-for-treehash=0 | |
341 | ld3_LDFLAGS += -Wl,--build-id=tree -Wl,--build-id-chunk-size-for-treehash=12345 -Wl,--build-id-min-file-size-for-treehash=0 | |
342 | ld4_LDFLAGS += -Wl,--build-id=tree -Wl,--build-id-chunk-size-for-treehash=12346 -Wl,--build-id-min-file-size-for-treehash=0 | |
343 | ||
344 | if THREADS | |
345 | ||
346 | ld1_LDFLAGS += -Wl,--thread-count=3 | |
347 | ld2_LDFLAGS += -Wl,--thread-count=3 | |
348 | ld3_LDFLAGS += -Wl,--thread-count=13 | |
349 | ld4_LDFLAGS += -Wl,--thread-count=3 | |
350 | check_PROGRAMS += ld3 | |
351 | TESTS += bootstrap-test-treehash-chunksize | |
352 | ||
353 | bootstrap-test-treehash: ld1 ld3 | |
354 | rm -f $@ | |
355 | echo "#!/bin/sh" > $@ | |
356 | echo "cmp ld1 ld3" >> $@ | |
357 | chmod +x $@ | |
358 | ||
359 | endif | |
360 | ||
361 | bootstrap-test-treehash-chunksize: ld1 ld4 | |
362 | rm -f $@ | |
363 | echo "#!/bin/sh" > $@ | |
364 | echo "cmp ld1 ld4 | grep ." >> $@ | |
365 | chmod +x $@ | |
366 | ||
537b5f51 ILT |
367 | endif |
368 | endif |