gdb/
[deliverable/binutils-gdb.git] / gold / Makefile.am
CommitLineData
bae7f79e
ILT
1# Process this file with automake to generate Makefile.in
2
c462b41b 3AUTOMAKE_OPTIONS = foreign
bae7f79e 4
5a6f7e2d 5SUBDIRS = po testsuite
bae7f79e
ILT
6
7tooldir = $(exec_prefix)/$(target_alias)
8
9ACLOCAL_AMFLAGS = -I ../bfd -I ../config
10
1d1f116d
CD
11AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS)
12AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS)
bae7f79e 13
14ec8efd 14AM_CPPFLAGS = \
bae7f79e
ILT
15 -I$(srcdir) -I$(srcdir)/../include -I$(srcdir)/../elfcpp \
16 -DLOCALEDIR="\"$(datadir)/locale\"" \
ad2d6943 17 -DBINDIR="\"$(bindir)\"" -DTOOLBINDIR="\"$(tooldir)/bin\"" \
bae7f79e
ILT
18 @INCINTL@
19
ad2d6943
ILT
20LIBIBERTY = ../libiberty/libiberty.a
21
89fc3421
CC
22if PLUGINS
23LIBDL = -ldl
24endif
25
fe9a4c12
ILT
26if THREADS
27THREADSLIB = -lpthread
28endif
29
4991e922 30AM_YFLAGS = -d
dbe717ef 31
a15af8e2
RW
32# Automake 1.10+ disables lex and yacc output file regeneration if
33# maintainer mode is disabled. Avoid this.
34am__skiplex =
35am__skipyacc =
36
e2b8f3c4 37noinst_PROGRAMS = ld-new incremental-dump
5a6f7e2d 38noinst_LIBRARIES = libgold.a
bae7f79e 39
14bfc3f5 40CCFILES = \
61ba1cf9 41 archive.cc \
4f787271 42 attributes.cc \
bc644c6c 43 binary.cc \
ead1e424 44 common.cc \
9a0910c3 45 compressed_output.cc \
12c0daef 46 copy-relocs.cc \
92de84a6 47 cref.cc \
ead1e424 48 defstd.cc \
2a00e4fb 49 descriptors.cc \
bae7f79e 50 dirsearch.cc \
dbe717ef 51 dynobj.cc \
5c2c6c95 52 dwarf_reader.cc \
3151305a 53 ehframe.cc \
75f2446e 54 errors.cc \
e5756efb 55 expression.cc \
bae7f79e 56 fileread.cc \
6d03d481 57 gc.cc \
bae7f79e
ILT
58 gold.cc \
59 gold-threads.cc \
ef15dade 60 icf.cc \
0e879927 61 incremental.cc \
4f787271 62 int_encoding.cc \
a2fb1b05 63 layout.cc \
7d9e3d98 64 mapfile.cc \
b8e6aad9 65 merge.cc \
bae7f79e
ILT
66 object.cc \
67 options.cc \
a2fb1b05 68 output.cc \
7e1edb90 69 parameters.cc \
89fc3421 70 plugin.cc \
bae7f79e 71 readsyms.cc \
62b01cb5 72 reduced_debug_output.cc \
61ba1cf9 73 reloc.cc \
14bfc3f5 74 resolve.cc \
494e05f4 75 script-sections.cc \
dbe717ef 76 script.cc \
14bfc3f5 77 stringpool.cc \
c92003e0 78 symtab.cc \
bb04269c 79 target.cc \
14bfc3f5 80 target-select.cc \
d675ff46 81 timer.cc \
8486ee48 82 version.cc \
c7912668
ILT
83 workqueue.cc \
84 workqueue-threads.cc
bae7f79e
ILT
85
86HFILES = \
0d31c79d 87 arm-reloc-property.h \
61ba1cf9 88 archive.h \
4f787271 89 attributes.h \
bc644c6c 90 binary.h \
ead1e424 91 common.h \
9a0910c3 92 compressed_output.h \
12c0daef 93 copy-relocs.h \
92de84a6 94 cref.h \
ead1e424 95 defstd.h \
bae7f79e 96 dirsearch.h \
2a00e4fb 97 descriptors.h \
dbe717ef 98 dynobj.h \
5c2c6c95 99 dwarf_reader.h \
3151305a 100 ehframe.h \
75f2446e 101 errors.h \
bae7f79e 102 fileread.h \
36959681 103 freebsd.h \
6d03d481 104 gc.h \
bae7f79e
ILT
105 gold.h \
106 gold-threads.h \
ef15dade 107 icf.h \
4f787271 108 int_encoding.h \
a2fb1b05 109 layout.h \
7d9e3d98 110 mapfile.h \
b8e6aad9 111 merge.h \
bae7f79e
ILT
112 object.h \
113 options.h \
a2fb1b05 114 output.h \
7e1edb90 115 parameters.h \
89fc3421 116 plugin.h \
bae7f79e 117 readsyms.h \
62b01cb5 118 reduced_debug_output.h \
61ba1cf9 119 reloc.h \
c06b7b0b 120 reloc-types.h \
c06b7b0b 121 script-c.h \
494e05f4
ILT
122 script-sections.h \
123 script.h \
14bfc3f5 124 stringpool.h \
bae7f79e
ILT
125 symtab.h \
126 target.h \
61ba1cf9 127 target-reloc.h \
14bfc3f5 128 target-select.h \
d675ff46 129 timer.h \
af6359d5 130 tls.h \
17a1d0a9 131 token.h \
c7912668
ILT
132 workqueue.h \
133 workqueue-internal.h
bae7f79e 134
dbe717ef
ILT
135YFILES = \
136 yyscript.y
137
0d31c79d
DK
138DEFFILES = arm-reloc.def
139
dbe717ef 140EXTRA_DIST = yyscript.c yyscript.h
bae7f79e 141
6df6da4a 142TARGETSOURCES = \
0d31c79d 143 i386.cc x86_64.cc sparc.cc powerpc.cc arm.cc arm-reloc-property.cc
6df6da4a
ILT
144
145ALL_TARGETOBJS = \
4a657b0d 146 i386.$(OBJEXT) x86_64.$(OBJEXT) sparc.$(OBJEXT) powerpc.$(OBJEXT) \
0d31c79d 147 arm.$(OBJEXT) arm-reloc-property.$(OBJEXT)
6df6da4a 148
0d31c79d 149libgold_a_SOURCES = $(CCFILES) $(HFILES) $(YFILES) $(DEFFILES)
3d857b98 150libgold_a_LIBADD = $(LIBOBJS)
bae7f79e 151
6df6da4a 152sources_var = main.cc
ad2d6943 153deps_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL_DEP)
89fc3421
CC
154ldadd_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL) \
155 $(THREADSLIB) $(LIBDL)
537b5f51
ILT
156
157ld_new_SOURCES = $(sources_var)
3d857b98
DK
158ld_new_DEPENDENCIES = $(deps_var)
159ld_new_LDADD = $(ldadd_var)
bae7f79e 160
6df6da4a
ILT
161EXTRA_ld_new_SOURCES = $(TARGETSOURCES)
162
e2b8f3c4 163incremental_dump_SOURCES = incremental-dump.cc
d56962d3
DK
164incremental_dump_DEPENDENCIES = $(TARGETOBJS) libgold.a $(LIBIBERTY) \
165 $(LIBINTL_DEP)
166incremental_dump_LDADD = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL) \
3b0dd6ac 167 $(THREADSLIB) $(LIBDL)
e2b8f3c4 168
dbe717ef 169# Use an explicit dependency for the bison generated header file.
7d320313
ILT
170expression.$(OBJEXT): yyscript.h
171script-sections.$(OBJEXT): yyscript.h
dbe717ef
ILT
172script.$(OBJEXT): yyscript.h
173
5a6f7e2d
ILT
174# We have to build libgold.a before we run the tests.
175check: libgold.a
176
bae7f79e
ILT
177.PHONY: install-exec-local
178
179install-exec-local: ld-new$(EXEEXT)
180 $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/bin
4fda8867 181 n=`echo $(installed_linker) | sed '$(transform)'`; \
bae7f79e
ILT
182 $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${n}$(EXEEXT); \
183 if test "$(bindir)" != "$(tooldir)/bin"; then \
4fda8867
NC
184 rm -f $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT); \
185 ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT) >/dev/null 2>/dev/null \
186 || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT); \
187 fi; \
188 if test "x$(install_as_default)" = "xyes"; then \
7ad2014a
L
189 ld=`echo ld | sed '$(transform)'`; \
190 rm -f $(DESTDIR)$(bindir)/$${ld}$(EXEEXT); \
191 ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(bindir)/$${ld}$(EXEEXT) >/dev/null 2>/dev/null \
192 || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${ld}$(EXEEXT); \
4fda8867
NC
193 if test "$(bindir)" != "$(tooldir)/bin"; then \
194 rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
195 ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
bae7f79e 196 || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
4fda8867 197 fi; \
bae7f79e
ILT
198 fi
199
200# We want install to imply install-info as per GNU standards, despite
201# the cygnus option.
202install-data-local: install-info
5a6f7e2d 203
6df6da4a 204POTFILES= $(CCFILES) $(HFILES) $(TARGETSOURCES)
5a6f7e2d
ILT
205
206po/POTFILES.in: @MAINT@ Makefile
323ee3f4 207 for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
5a6f7e2d 208 && mv tmp $(srcdir)/po/POTFILES.in
537b5f51
ILT
209
210# Bootstrap test support. We use ld-new to build ld1, then use ld1 to
211# build ld2. ld1 and ld2 should be identical. ld-new need not be
212# identical to ld1, since it was linked with the host linker.
213
214if GCC
215if NATIVE_LINKER
216
217gcctestdir1/ld: ld-new
218 test -d gcctestdir1 || mkdir -p gcctestdir1
219 rm -f gcctestdir1/ld
220 (cd gcctestdir1 && $(LN_S) ../ld-new ld)
221
222ld1_SOURCES = $(sources_var)
223ld1_DEPENDENCIES = $(deps_var) gcctestdir1/ld
224ld1_LDADD = $(ldadd_var)
225ld1_LDFLAGS = -Bgcctestdir1/
226
227gcctestdir2/ld: ld1
228 test -d gcctestdir2 || mkdir -p gcctestdir2
229 rm -f gcctestdir2/ld
230 (cd gcctestdir2 && $(LN_S) ../ld1 ld)
231
232ld2_SOURCES = $(sources_var)
233ld2_DEPENDENCIES = $(deps_var) gcctestdir2/ld
234ld2_LDADD = $(ldadd_var)
235ld2_LDFLAGS = -Bgcctestdir2/
236
537b5f51
ILT
237bootstrap-test: ld2
238 rm -f $@
239 echo "#!/bin/sh" > $@
240 echo "cmp ld1 ld2" > $@
241 chmod +x $@
242
755ab8af
ILT
243libgold-1-r.o: gcctestdir1/ld libgold.a
244 gcctestdir1/ld -o $@ -r --whole-archive libgold.a
245
246ld1_r_SOURCES = $(sources_var)
247ld1_r_DEPENDENCIES = libgold-1-r.o $(deps_var) gcctestdir1/ld
248ld1_r_LDADD = libgold-1-r.o $(ldadd_var)
249ld1_r_LDFLAGS = -Bgcctestdir1/
250
251gcctestdir2-r/ld: ld1-r
252 test -d gcctestdir2-r || mkdir -p gcctestdir2-r
253 rm -f gcctestdir2-r/ld
254 (cd gcctestdir2-r && $(LN_S) ../ld1-r ld)
255
256libgold-2-r.o: gcctestdir2-r/ld libgold.a
257 gcctestdir2-r/ld -o $@ -r --whole-archive libgold.a
258
259ld2_r_SOURCES = $(sources_var)
260ld2_r_DEPENDENCIES = libgold-2-r.o $(deps_var) gcctestdir2-r/ld
261ld2_r_LDADD = libgold-2-r.o $(ldadd_var)
262ld2_r_LDFLAGS = -Bgcctestdir2-r/
263
264bootstrap-test-r: ld2-r
265 rm -f $@
266 echo "#!/bin/sh" > $@
267 echo "cmp ld1-r ld2-r" > $@
268 chmod +x $@
269
270check_PROGRAMS = ld1 ld2 ld1-r ld2-r
271TESTS = bootstrap-test bootstrap-test-r
537b5f51
ILT
272
273endif
274endif
This page took 0.179297 seconds and 4 git commands to generate.