1 # Process this file with automake to generate Makefile.in
3 AUTOMAKE_OPTIONS = foreign
7 tooldir = $(exec_prefix)/$(target_alias)
9 ACLOCAL_AMFLAGS = -I ../bfd -I ../config
11 AM_CFLAGS = $(WARN_CFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS)
12 AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CFLAGS) $(RANDOM_SEED_CFLAGS)
15 -I$(srcdir) -I$(srcdir)/../include -I$(srcdir)/../elfcpp \
16 -DLOCALEDIR="\"$(datadir)/locale\"" \
17 -DBINDIR="\"$(bindir)\"" -DTOOLBINDIR="\"$(tooldir)/bin\"" \
18 -DTOOLLIBDIR="\"$(tooldir)/lib\"" @INCINTL@
20 LIBIBERTY = ../libiberty/libiberty.a
27 THREADSLIB = -lpthread
32 # Automake 1.10+ disables lex and yacc output file regeneration if
33 # maintainer mode is disabled. Avoid this.
39 noinst_PROGRAMS = ld-new incremental-dump
40 noinst_LIBRARIES = libgold.a
47 compressed_output.cc \
76 reduced_debug_output.cc \
91 arm-reloc-property.h \
124 reduced_debug_output.h \
144 DEFFILES = arm-reloc.def
146 EXTRA_DIST = yyscript.c yyscript.h
149 i386.cc x86_64.cc sparc.cc powerpc.cc arm.cc arm-reloc-property.cc tilegx.cc
152 i386.$(OBJEXT) x86_64.$(OBJEXT) sparc.$(OBJEXT) powerpc.$(OBJEXT) \
153 arm.$(OBJEXT) arm-reloc-property.$(OBJEXT) tilegx.$(OBJEXT)
155 libgold_a_SOURCES = $(CCFILES) $(HFILES) $(YFILES) $(DEFFILES)
156 libgold_a_LIBADD = $(LIBOBJS)
158 sources_var = main.cc
159 deps_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL_DEP)
160 ldadd_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(GOLD_LDADD) $(LIBINTL) \
161 $(THREADSLIB) $(LIBDL)
162 ldflags_var = $(GOLD_LDFLAGS)
164 ld_new_SOURCES = $(sources_var)
165 ld_new_DEPENDENCIES = $(deps_var)
166 ld_new_LDADD = $(ldadd_var)
167 ld_new_LDFLAGS = $(ldflags_var)
169 EXTRA_ld_new_SOURCES = $(TARGETSOURCES)
171 incremental_dump_SOURCES = incremental-dump.cc
172 incremental_dump_DEPENDENCIES = $(TARGETOBJS) libgold.a $(LIBIBERTY) \
174 incremental_dump_LDADD = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL) \
175 $(THREADSLIB) $(LIBDL)
178 dwp_DEPENDENCIES = libgold.a $(LIBIBERTY) $(LIBINTL_DEP)
179 dwp_LDADD = libgold.a $(LIBIBERTY) $(GOLD_LDADD) $(LIBINTL) $(THREADSLIB) \
181 dwp_LDFLAGS = $(GOLD_LDFLAGS)
183 # Use an explicit dependency for the bison generated header file.
184 expression.$(OBJEXT): yyscript.h
185 script-sections.$(OBJEXT): yyscript.h
186 script.$(OBJEXT): yyscript.h
188 # We have to build libgold.a before we run the tests.
191 .PHONY: install-exec-local
193 install-exec-local: ld-new$(EXEEXT)
194 $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/bin
195 n=`echo $(installed_linker) | sed '$(transform)'`; \
196 $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${n}$(EXEEXT); \
197 if test "$(bindir)" != "$(tooldir)/bin"; then \
198 rm -f $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT); \
199 ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT) >/dev/null 2>/dev/null \
200 || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$(installed_linker)$(EXEEXT); \
202 if test "x$(install_as_default)" = "xyes"; then \
203 ld=`echo ld | sed '$(transform)'`; \
204 rm -f $(DESTDIR)$(bindir)/$${ld}$(EXEEXT); \
205 ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(bindir)/$${ld}$(EXEEXT) >/dev/null 2>/dev/null \
206 || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${ld}$(EXEEXT); \
207 if test "$(bindir)" != "$(tooldir)/bin"; then \
208 rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
209 ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
210 || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
214 # We want install to imply install-info as per GNU standards, despite
216 install-data-local: install-info
218 POTFILES= $(CCFILES) $(HFILES) $(TARGETSOURCES)
220 po/POTFILES.in: @MAINT@ Makefile
221 for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
222 && mv tmp $(srcdir)/po/POTFILES.in
224 # Bootstrap test support. We use ld-new to build ld1, then use ld1 to
225 # build ld2. ld1 and ld2 should be identical. ld-new need not be
226 # identical to ld1, since it was linked with the host linker.
231 gcctestdir1/ld: ld-new
232 test -d gcctestdir1 || mkdir -p gcctestdir1
234 (cd gcctestdir1 && $(LN_S) ../ld-new ld)
236 ld1_SOURCES = $(sources_var)
237 ld1_DEPENDENCIES = $(deps_var) gcctestdir1/ld
238 ld1_LDADD = $(ldadd_var)
239 ld1_LDFLAGS = -Bgcctestdir1/
242 test -d gcctestdir2 || mkdir -p gcctestdir2
244 (cd gcctestdir2 && $(LN_S) ../ld1 ld)
246 ld2_SOURCES = $(sources_var)
247 ld2_DEPENDENCIES = $(deps_var) gcctestdir2/ld
248 ld2_LDADD = $(ldadd_var)
249 ld2_LDFLAGS = -Bgcctestdir2/
253 echo "#!/bin/sh" > $@
254 echo "cmp ld1 ld2" > $@
257 libgold-1-r.o: gcctestdir1/ld libgold.a
258 gcctestdir1/ld -o $@ -r --whole-archive libgold.a
260 ld1_r_SOURCES = $(sources_var)
261 ld1_r_DEPENDENCIES = libgold-1-r.o $(deps_var) gcctestdir1/ld
262 ld1_r_LDADD = libgold-1-r.o $(ldadd_var)
263 ld1_r_LDFLAGS = -Bgcctestdir1/
265 gcctestdir2-r/ld: ld1-r
266 test -d gcctestdir2-r || mkdir -p gcctestdir2-r
267 rm -f gcctestdir2-r/ld
268 (cd gcctestdir2-r && $(LN_S) ../ld1-r ld)
270 libgold-2-r.o: gcctestdir2-r/ld libgold.a
271 gcctestdir2-r/ld -o $@ -r --whole-archive libgold.a
273 ld2_r_SOURCES = $(sources_var)
274 ld2_r_DEPENDENCIES = libgold-2-r.o $(deps_var) gcctestdir2-r/ld
275 ld2_r_LDADD = libgold-2-r.o $(ldadd_var)
276 ld2_r_LDFLAGS = -Bgcctestdir2-r/
278 bootstrap-test-r: ld2-r
280 echo "#!/bin/sh" > $@
281 echo "cmp ld1-r ld2-r" > $@
284 check_PROGRAMS = ld1 ld2 ld1-r ld2-r
285 TESTS = bootstrap-test bootstrap-test-r