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