1 # Process this file with automake to generate Makefile.in
7 tooldir = $(exec_prefix)/$(target_alias)
9 ACLOCAL_AMFLAGS = -I ../bfd -I ../config
11 AM_CXXFLAGS = $(WARN_CXXFLAGS) $(LFS_CXXFLAGS)
13 INCLUDES = -D_GNU_SOURCE \
14 -I$(srcdir) -I$(srcdir)/../include -I$(srcdir)/../elfcpp \
15 -DLOCALEDIR="\"$(datadir)/locale\"" \
16 -DBINDIR="\"$(bindir)\"" -DTOOLBINDIR="\"$(tooldir)/bin\"" \
19 LIBIBERTY = ../libiberty/libiberty.a
23 noinst_PROGRAMS = ld-new
24 noinst_LIBRARIES = libgold.a
82 EXTRA_DIST = yyscript.c yyscript.h
88 i386.$(OBJEXT) x86_64.$(OBJEXT)
90 libgold_a_SOURCES = $(CCFILES) $(HFILES) $(YFILES)
93 deps_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL_DEP)
94 ldadd_var = $(TARGETOBJS) libgold.a $(LIBIBERTY) $(LIBINTL)
96 ld_new_SOURCES = $(sources_var)
97 ld_new_DEPENDENCIES = $(deps_var) $(LIBOBJS)
98 ld_new_LDADD = $(ldadd_var) $(LIBOBJS)
100 EXTRA_ld_new_SOURCES = $(TARGETSOURCES)
102 # Use an explicit dependency for the bison generated header file.
103 script.$(OBJEXT): yyscript.h
105 # We have to build libgold.a before we run the tests.
108 .PHONY: install-exec-local
110 install-exec-local: ld-new$(EXEEXT)
111 $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/bin
112 n=`echo ld | sed '$(transform)'; \
113 $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${n}$(EXEEXT); \
114 if test "$(bindir)" != "$(tooldir)/bin"; then \
115 rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
116 ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
117 || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
120 # We want install to imply install-info as per GNU standards, despite
122 install-data-local: install-info
124 POTFILES= $(CCFILES) $(HFILES) $(TARGETSOURCES)
126 po/POTFILES.in: @MAINT@ Makefile
127 for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \
128 && mv tmp $(srcdir)/po/POTFILES.in
130 # Bootstrap test support. We use ld-new to build ld1, then use ld1 to
131 # build ld2. ld1 and ld2 should be identical. ld-new need not be
132 # identical to ld1, since it was linked with the host linker.
137 gcctestdir1/ld: ld-new
138 test -d gcctestdir1 || mkdir -p gcctestdir1
140 (cd gcctestdir1 && $(LN_S) ../ld-new ld)
142 ld1_SOURCES = $(sources_var)
143 ld1_DEPENDENCIES = $(deps_var) gcctestdir1/ld
144 ld1_LDADD = $(ldadd_var)
145 ld1_LDFLAGS = -Bgcctestdir1/
148 test -d gcctestdir2 || mkdir -p gcctestdir2
150 (cd gcctestdir2 && $(LN_S) ../ld1 ld)
152 ld2_SOURCES = $(sources_var)
153 ld2_DEPENDENCIES = $(deps_var) gcctestdir2/ld
154 ld2_LDADD = $(ldadd_var)
155 ld2_LDFLAGS = -Bgcctestdir2/
157 check_PROGRAMS = ld1 ld2
161 echo "#!/bin/sh" > $@
162 echo "cmp ld1 ld2" > $@
165 TESTS = bootstrap-test