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\"" \
20 noinst_PROGRAMS = ld-new
21 noinst_LIBRARIES = libgold.a
79 EXTRA_DIST = yyscript.c yyscript.h
85 i386.$(OBJEXT) x86_64.$(OBJEXT)
87 libgold_a_SOURCES = $(CCFILES) $(HFILES) $(YFILES)
90 deps_var = $(TARGETOBJS) libgold.a $(LIBINTL_DEP)
91 ldadd_var = $(TARGETOBJS) libgold.a $(LIBINTL)
93 ld_new_SOURCES = $(sources_var)
94 ld_new_DEPENDENCIES = $(deps_var) $(LIBOBJS)
95 ld_new_LDADD = $(ldadd_var) $(LIBOBJS)
97 EXTRA_ld_new_SOURCES = $(TARGETSOURCES)
99 # Use an explicit dependency for the bison generated header file.
100 script.$(OBJEXT): yyscript.h
102 # We have to build libgold.a before we run the tests.
105 .PHONY: install-exec-local
107 install-exec-local: ld-new$(EXEEXT)
108 $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/bin
109 n=`echo ld | sed '$(transform)'; \
110 $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${n}$(EXEEXT); \
111 if test "$(bindir)" != "$(tooldir)/bin"; then \
112 rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
113 ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
114 || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
117 # We want install to imply install-info as per GNU standards, despite
119 install-data-local: install-info
121 POTFILES= $(CCFILES) $(HFILES) $(TARGETSOURCES)
123 po/POTFILES.in: @MAINT@ Makefile
124 for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \
125 && mv tmp $(srcdir)/po/POTFILES.in
127 # Bootstrap test support. We use ld-new to build ld1, then use ld1 to
128 # build ld2. ld1 and ld2 should be identical. ld-new need not be
129 # identical to ld1, since it was linked with the host linker.
134 gcctestdir1/ld: ld-new
135 test -d gcctestdir1 || mkdir -p gcctestdir1
137 (cd gcctestdir1 && $(LN_S) ../ld-new ld)
139 ld1_SOURCES = $(sources_var)
140 ld1_DEPENDENCIES = $(deps_var) gcctestdir1/ld
141 ld1_LDADD = $(ldadd_var)
142 ld1_LDFLAGS = -Bgcctestdir1/
145 test -d gcctestdir2 || mkdir -p gcctestdir2
147 (cd gcctestdir2 && $(LN_S) ../ld1 ld)
149 ld2_SOURCES = $(sources_var)
150 ld2_DEPENDENCIES = $(deps_var) gcctestdir2/ld
151 ld2_LDADD = $(ldadd_var)
152 ld2_LDFLAGS = -Bgcctestdir2/
154 check_PROGRAMS = ld1 ld2
158 echo "#!/bin/sh" > $@
159 echo "cmp ld1 ld2" > $@
162 TESTS = bootstrap-test