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