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