~ubuntu-branches/ubuntu/utopic/binutils-arm64-cross/utopic

« back to all changes in this revision

Viewing changes to binutils-2.23.52.20130611/gold/Makefile.am

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-06-20 17:38:09 UTC
  • Revision ID: package-import@ubuntu.com-20130620173809-app8lzgvymy5fg6c
Tags: 0.7
Build-depend on binutils-source (>= 2.23.52.20130620-1~).

Show diffs side-by-side

added added

removed removed

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