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
82 EXTRA_DIST = yyscript.c yyscript.h
84 libgold_a_SOURCES = $(CCFILES) $(HFILES) $(YFILES)
86 sources_var = main.cc $(TARGETFILES)
87 deps_var = libgold.a $(LIBINTL_DEP)
88 ldadd_var = libgold.a $(LIBINTL)
90 ld_new_SOURCES = $(sources_var)
91 ld_new_DEPENDENCIES = $(deps_var) $(LIBOBJS)
92 ld_new_LDADD = $(ldadd_var) $(LIBOBJS)
94 # Use an explicit dependency for the bison generated header file.
95 script.$(OBJEXT): yyscript.h
97 # We have to build libgold.a before we run the tests.
100 .PHONY: install-exec-local
102 install-exec-local: ld-new$(EXEEXT)
103 $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(tooldir)/bin
104 n=`echo ld | sed '$(transform)'; \
105 $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(bindir)/$${n}$(EXEEXT); \
106 if test "$(bindir)" != "$(tooldir)/bin"; then \
107 rm -f $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
108 ln $(DESTDIR)$(bindir)/$${n}$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
109 || $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/ld$(EXEEXT); \
112 # We want install to imply install-info as per GNU standards, despite
114 install-data-local: install-info
116 POTFILES= $(CCFILES) $(HFILES) $(TARGETFILES)
118 po/POTFILES.in: @MAINT@ Makefile
119 for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \
120 && mv tmp $(srcdir)/po/POTFILES.in
122 # Bootstrap test support. We use ld-new to build ld1, then use ld1 to
123 # build ld2. ld1 and ld2 should be identical. ld-new need not be
124 # identical to ld1, since it was linked with the host linker.
129 gcctestdir1/ld: ld-new
130 test -d gcctestdir1 || mkdir -p gcctestdir1
132 (cd gcctestdir1 && $(LN_S) ../ld-new ld)
134 ld1_SOURCES = $(sources_var)
135 ld1_DEPENDENCIES = $(deps_var) gcctestdir1/ld
136 ld1_LDADD = $(ldadd_var)
137 ld1_LDFLAGS = -Bgcctestdir1/
140 test -d gcctestdir2 || mkdir -p gcctestdir2
142 (cd gcctestdir2 && $(LN_S) ../ld1 ld)
144 ld2_SOURCES = $(sources_var)
145 ld2_DEPENDENCIES = $(deps_var) gcctestdir2/ld
146 ld2_LDADD = $(ldadd_var)
147 ld2_LDFLAGS = -Bgcctestdir2/
149 check_PROGRAMS = ld1 ld2
153 echo "#!/bin/sh" > $@
154 echo "cmp ld1 ld2" > $@
157 TESTS = bootstrap-test