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