aboutsummaryrefslogtreecommitdiff
path: root/ld/Makefile.am
diff options
context:
space:
mode:
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>2009-08-22 17:59:33 +0000
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>2009-08-22 17:59:33 +0000
commit64ac50ac862c415edda9c3532fb081c6a8b66262 (patch)
treeda2ebdf6d184948e821c248b918611bd185c4384 /ld/Makefile.am
parentaf542c2e31e7ea8c5db851fe194841e39384a318 (diff)
downloadgdb-64ac50ac862c415edda9c3532fb081c6a8b66262.zip
gdb-64ac50ac862c415edda9c3532fb081c6a8b66262.tar.gz
gdb-64ac50ac862c415edda9c3532fb081c6a8b66262.tar.bz2
dependency tracking in ld
ld/: * Makefile.am (AUTOMAKE_OPTIONS): Remove cygnus. Add no-texinfo.tex, no-dist, foreign. (TEXINFO_TEX): New variable. (install-data-local): Removed, not needed any more. (all): Dependencies upon info and ld.1 not needed any more. (MKDEP, DEP, DEP1, dep.sed, dep, dep-in, dep-am): Removed. (mkdep generated section): Removed. (ldgram.o, ldlex.o, deffilep.o, ldmain.o, ldfile.o): Rewrite to use automake dependency tracking mechanism. (EXTRA_ld_new_SOURCES): Add pep-dll.c, pe-dll.c, and $(ALL_EMULATIONS:.o=.c) $(ALL_64_EMULATIONS:.o=.c) so their dependencies are tracked too. (BUILT_SOURCES): New, list $(GENERATED_HFILES) to ensure they are built early. * configure.in: Use AM_MAINTAINER_MODE. * configure, Makefile.in: Regenerate.
Diffstat (limited to 'ld/Makefile.am')
-rw-r--r--ld/Makefile.am480
1 files changed, 71 insertions, 409 deletions
diff --git a/ld/Makefile.am b/ld/Makefile.am
index fc4a47e..9cd9b54 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -1,7 +1,8 @@
## Process this file with automake to generate Makefile.in
-AUTOMAKE_OPTIONS = cygnus dejagnu
+AUTOMAKE_OPTIONS = dejagnu no-texinfo.tex no-dist foreign
ACLOCAL_AMFLAGS = -I .. -I ../config -I ../bfd
+TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex
SUBDIRS = po
@@ -36,7 +37,6 @@ LIB_PATH = @LIB_PATH@
BASEDIR = $(srcdir)/..
BFDDIR = $(BASEDIR)/bfd
INCDIR = $(BASEDIR)/include
-MKDEP = gcc -MM
# What version of the manual to build
DOCVER = gen
@@ -449,6 +449,10 @@ HFILES = ld.h ldctor.h ldemul.h ldexp.h ldfile.h \
GENERATED_CFILES = ldgram.c ldlex.c deffilep.c
GENERATED_HFILES = ldgram.h ldemul-list.h deffilep.h
+# Require an early dependency on the generated headers, as the dependency
+# tracking will not cause them to be built beforehand.
+BUILT_SOURCES = $(GENERATED_HFILES)
+
OFILES = ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o \
ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o \
ldfile.o ldcref.o ${EMULATION_OFILES} ${EMUL_EXTRA_OFILES}
@@ -457,12 +461,41 @@ STAGESTUFF = *.o ldscripts/* e*.c
# Disable -Werror, if it has been enabled, since old versions of bison/
# yacc will produce working code which contain compile time warnings.
-ldgram.o:
- $(COMPILE) -c $< $(NO_WERROR)
-ldlex.o:
- $(COMPILE) -c $< $(NO_WERROR)
-deffilep.o:
- $(COMPILE) -c $< $(NO_WERROR)
+ldgram.o: ldgram.c
+if am__fastdepCC
+ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ ldgram.c $(NO_WERROR)
+ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+else
+if AMDEP
+ source='ldgram.c' object='$@' libtool=no @AMDEPBACKSLASH@
+ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+endif
+ $(COMPILE) -c ldgram.c $(NO_WERROR)
+endif
+
+ldlex.o: ldlex.c
+if am__fastdepCC
+ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ ldlex.c $(NO_WERROR)
+ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+else
+if AMDEP
+ source='ldlex.c' object='$@' libtool=no @AMDEPBACKSLASH@
+ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+endif
+ $(COMPILE) -c ldlex.c $(NO_WERROR)
+endif
+
+deffilep.o: deffilep.c
+if am__fastdepCC
+ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ deffilep.c $(NO_WERROR)
+ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+else
+if AMDEP
+ source='deffilep.c' object='$@' libtool=no @AMDEPBACKSLASH@
+ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+endif
+ $(COMPILE) -c deffilep.c $(NO_WERROR)
+endif
# At the moment this is just a list of those emulation template files
# that contain internationalised strings.
@@ -475,15 +508,39 @@ po/POTFILES.in: @MAINT@ Makefile
&& mv tmp $(srcdir)/po/POTFILES.in
ldmain.o: ldmain.c config.status
+if am__fastdepCC
+ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ \
+ -DDEFAULT_EMULATION='"$(EMUL)"' \
+ -DBINDIR='"$(bindir)"' -DTOOLBINDIR='"$(tooldir)/bin"' \
+ -DTARGET='"@target@"' @TARGET_SYSTEM_ROOT_DEFINE@ \
+ $(srcdir)/ldmain.c
+ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+else
+if AMDEP
+ source='deffilep.c' object='$@' libtool=no @AMDEPBACKSLASH@
+ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+endif
$(COMPILE) -c -DDEFAULT_EMULATION='"$(EMUL)"' \
-DBINDIR='"$(bindir)"' -DTOOLBINDIR='"$(tooldir)/bin"' \
-DTARGET='"@target@"' @TARGET_SYSTEM_ROOT_DEFINE@ \
$(srcdir)/ldmain.c
+endif
ldfile.o: ldfile.c config.status
- $(COMPILE) -c -DSCRIPTDIR='"$(scriptdir)"' \
- -DBINDIR='"$(bindir)"' -DTOOLBINDIR='"$(tooldir)/bin"' \
+if am__fastdepCC
+ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ \
+ -DSCRIPTDIR='"$(scriptdir)"' -DBINDIR='"$(bindir)"' -DTOOLBINDIR='"$(tooldir)/bin"' \
+ $(srcdir)/ldfile.c
+ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+else
+if AMDEP
+ source='deffilep.c' object='$@' libtool=no @AMDEPBACKSLASH@
+ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+endif
+ $(COMPILE) -c -DSCRIPTDIR='"$(scriptdir)"' -DBINDIR='"$(bindir)"' \
+ -DTOOLBINDIR='"$(tooldir)/bin"' \
$(srcdir)/ldfile.c
+endif
eelf32_spu.o: eelf32_spu.c
$(COMPILE) -c -DEMBEDSPU="\"`echo embedspu | sed '$(transform)'`\"" \
@@ -1761,16 +1818,16 @@ ez8002.c: $(srcdir)/emulparams/z8002.sh \
# We need this for automake to use YLWRAP.
EXTRA_ld_new_SOURCES = deffilep.y
+# Allow dependency tracking to work for these files, too.
+EXTRA_ld_new_SOURCES += pep-dll.c pe-dll.c
ld_new_SOURCES = ldgram.y ldlex.l lexsup.c ldlang.c mri.c ldctor.c ldmain.c \
ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c
ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL_DEP)
ld_new_LDADD = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(LIBINTL)
-# The generated emulation files mostly have the same dependencies.
-$(EMULATION_OFILES): ../bfd/bfd.h sysdep.h config.h $(INCDIR)/bfdlink.h \
- ld.h ldmain.h ldemul.h ldfile.h ldmisc.h ldexp.h ldlang.h \
- ldctor.h ldexp.h ldlang.h ldgram.h
+# Dependency tracking for the generated emulation files.
+EXTRA_ld_new_SOURCES += $(ALL_EMULATIONS:.o=.c) $(ALL_64_EMULATIONS:.o=.c)
# This is the real libbfd.a created by libtool.
TESTBFDLIB = @TESTBFDLIB@
@@ -1903,16 +1960,11 @@ install-data-local:
$(INSTALL_DATA) $$f $(DESTDIR)$(scriptdir)/$$f ; \
done
-# We want install to imply install-info as per GNU standards, despite the
-# cygnus option.
-install-data-local: install-info
-
# Stuff that should be included in a distribution. The diststuff
# target is run by the taz target in ../Makefile.in.
EXTRA_DIST = ldgram.c ldgram.h ldlex.c emultempl/spu_ovl.o_c \
emultempl/spu_icache.o_c deffilep.c deffilep.h $(man_MANS)
diststuff: info $(EXTRA_DIST)
-all: info ld.1
# Both info (ld.info) and ld.1 depend on configdoc.texi.
# But info isn't a direct target. Make info-recursive to depend on
@@ -1931,393 +1983,3 @@ MAINTAINERCLEANFILES += ld.info
if GENINSRC_NEVER
DISTCLEANFILES += ld.info
endif
-
-# Targets to rebuild dependencies in this Makefile.
-# Have to get rid of DEP1 here so that "$?" later includes all of $(CFILES).
-DEP: dep.sed $(CFILES) $(HFILES) $(GENERATED_CFILES) $(GENERATED_HFILES) config.h
- rm -f DEP1
- $(MAKE) MKDEP="$(MKDEP)" DEP1
- echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> DEP1
- if grep ' /' DEP1 > /dev/null 2> /dev/null; then \
- echo 'make DEP failed!'; exit 1; \
- else \
- mv -f DEP1 $@; \
- fi
-
-DEP1: $(CFILES) $(GENERATED_CFILES)
- echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > DEP2
- echo '# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.' >> DEP2
- for f in $?; do \
- $(MKDEP) $(INCLUDES) $(CFLAGS) $$f > DEPA; \
- sed -n -e '1s/: .*/: \\/p' -e q < DEPA >> DEP2; \
- sed -e '1s/.*: //' -f dep.sed < DEPA | \
- LC_ALL=C sort | LC_ALL=C uniq | \
- sed -e 's/^[AB]/ /' -e '$$s/ \\$$//' >> DEP2; \
- done
- rm -f DEPA
- mv -f DEP2 $@
-
-dep.sed: dep-in.sed config.status
- sed <$(srcdir)/dep-in.sed >dep.sed \
- -e 's!@INCDIR@!$(INCDIR)!' \
- -e 's!@BFDDIR@!$(BFDDIR)!' \
- -e 's!@SRCDIR@!$(srcdir)!' \
- -e 's!@TOPDIR@!'`echo $(srcdir) | sed -e s,/ld$$,,`'!'
-
-dep: DEP
- sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
- cat DEP >> tmp-Makefile
- $(srcdir)/../move-if-change tmp-Makefile Makefile
-
-dep-in: DEP
- sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.in > tmp-Makefile.in
- cat DEP >> tmp-Makefile.in
- $(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in
-
-dep-am: DEP
- sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.am > tmp-Makefile.am
- cat DEP >> tmp-Makefile.am
- $(srcdir)/../move-if-change tmp-Makefile.am $(srcdir)/Makefile.am
-
-.PHONY: dep dep-in dep-am
-
-# What appears below is generated by a hacked mkdep using gcc -MM.
-
-# DO NOT DELETE THIS LINE -- mkdep uses it.
-# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
-ldctor.o: \
- ldctor.c \
- $(INCDIR)/ansidecl.h \
- $(INCDIR)/bfdlink.h \
- $(INCDIR)/fopen-same.h \
- $(INCDIR)/safe-ctype.h \
- $(INCDIR)/symcat.h \
- ../bfd/bfd.h \
- config.h \
- ld.h \
- ldctor.h \
- ldexp.h \
- ldgram.h \
- ldlang.h \
- ldmain.h \
- ldmisc.h \
- sysdep.h
-ldemul.o: \
- ldemul.c \
- $(INCDIR)/ansidecl.h \
- $(INCDIR)/bfdlink.h \
- $(INCDIR)/fopen-same.h \
- $(INCDIR)/symcat.h \
- ../bfd/bfd.h \
- config.h \
- ld.h \
- ldemul-list.h \
- ldemul.h \
- ldexp.h \
- ldfile.h \
- ldlang.h \
- ldmain.h \
- ldmisc.h \
- sysdep.h
-ldexp.o: \
- ldexp.c \
- $(INCDIR)/ansidecl.h \
- $(INCDIR)/bfdlink.h \
- $(INCDIR)/fopen-same.h \
- $(INCDIR)/libiberty.h \
- $(INCDIR)/safe-ctype.h \
- $(INCDIR)/symcat.h \
- ../bfd/bfd.h \
- config.h \
- ld.h \
- ldexp.h \
- ldgram.h \
- ldlang.h \
- ldlex.h \
- ldmain.h \
- ldmisc.h \
- sysdep.h
-ldfile.o: \
- ldfile.c \
- $(INCDIR)/ansidecl.h \
- $(INCDIR)/bfdlink.h \
- $(INCDIR)/filenames.h \
- $(INCDIR)/fopen-same.h \
- $(INCDIR)/libiberty.h \
- $(INCDIR)/safe-ctype.h \
- $(INCDIR)/symcat.h \
- ../bfd/bfd.h \
- config.h \
- ld.h \
- ldemul.h \
- ldexp.h \
- ldfile.h \
- ldgram.h \
- ldlang.h \
- ldlex.h \
- ldmain.h \
- ldmisc.h \
- sysdep.h
-ldlang.o: \
- ldlang.c \
- $(INCDIR)/ansidecl.h \
- $(INCDIR)/bfdlink.h \
- $(INCDIR)/demangle.h \
- $(INCDIR)/fnmatch.h \
- $(INCDIR)/fopen-same.h \
- $(INCDIR)/hashtab.h \
- $(INCDIR)/libiberty.h \
- $(INCDIR)/obstack.h \
- $(INCDIR)/safe-ctype.h \
- $(INCDIR)/symcat.h \
- ../bfd/bfd.h \
- config.h \
- ld.h \
- ldctor.h \
- ldemul.h \
- ldexp.h \
- ldfile.h \
- ldgram.h \
- ldlang.h \
- ldlex.h \
- ldmain.h \
- ldmisc.h \
- sysdep.h
-ldmain.o: \
- ldmain.c \
- $(INCDIR)/ansidecl.h \
- $(INCDIR)/bfdlink.h \
- $(INCDIR)/filenames.h \
- $(INCDIR)/fopen-same.h \
- $(INCDIR)/libiberty.h \
- $(INCDIR)/progress.h \
- $(INCDIR)/safe-ctype.h \
- $(INCDIR)/symcat.h \
- ../bfd/bfd.h \
- config.h \
- ld.h \
- ldctor.h \
- ldemul.h \
- ldexp.h \
- ldfile.h \
- ldgram.h \
- ldlang.h \
- ldlex.h \
- ldmain.h \
- ldmisc.h \
- ldwrite.h \
- sysdep.h
-ldmisc.o: \
- ldmisc.c \
- $(BFDDIR)/elf-bfd.h \
- $(INCDIR)/ansidecl.h \
- $(INCDIR)/bfdlink.h \
- $(INCDIR)/demangle.h \
- $(INCDIR)/elf/common.h \
- $(INCDIR)/elf/external.h \
- $(INCDIR)/elf/internal.h \
- $(INCDIR)/fopen-same.h \
- $(INCDIR)/libiberty.h \
- $(INCDIR)/symcat.h \
- ../bfd/bfd.h \
- config.h \
- ld.h \
- ldexp.h \
- ldfile.h \
- ldgram.h \
- ldlang.h \
- ldlex.h \
- ldmain.h \
- ldmisc.h \
- sysdep.h
-ldver.o: \
- ldver.c \
- $(INCDIR)/ansidecl.h \
- $(INCDIR)/fopen-same.h \
- $(INCDIR)/symcat.h \
- ../bfd/bfd.h \
- ../bfd/bfdver.h \
- config.h \
- ld.h \
- ldemul.h \
- ldexp.h \
- ldfile.h \
- ldlang.h \
- ldmain.h \
- ldver.h \
- sysdep.h
-ldwrite.o: \
- ldwrite.c \
- $(INCDIR)/ansidecl.h \
- $(INCDIR)/bfdlink.h \
- $(INCDIR)/fopen-same.h \
- $(INCDIR)/libiberty.h \
- $(INCDIR)/safe-ctype.h \
- $(INCDIR)/symcat.h \
- ../bfd/bfd.h \
- config.h \
- ld.h \
- ldexp.h \
- ldgram.h \
- ldlang.h \
- ldmain.h \
- ldmisc.h \
- ldwrite.h \
- sysdep.h
-lexsup.o: \
- lexsup.c \
- $(INCDIR)/ansidecl.h \
- $(INCDIR)/bfdlink.h \
- $(INCDIR)/demangle.h \
- $(INCDIR)/fopen-same.h \
- $(INCDIR)/libiberty.h \
- $(INCDIR)/safe-ctype.h \
- $(INCDIR)/symcat.h \
- ../bfd/bfd.h \
- ../bfd/bfdver.h \
- config.h \
- ld.h \
- ldemul.h \
- ldexp.h \
- ldfile.h \
- ldgram.h \
- ldlang.h \
- ldlex.h \
- ldmain.h \
- ldmisc.h \
- ldver.h \
- sysdep.h
-mri.o: \
- mri.c \
- $(INCDIR)/ansidecl.h \
- $(INCDIR)/fopen-same.h \
- $(INCDIR)/libiberty.h \
- $(INCDIR)/symcat.h \
- ../bfd/bfd.h \
- config.h \
- ld.h \
- ldexp.h \
- ldgram.h \
- ldlang.h \
- ldmisc.h \
- mri.h \
- sysdep.h
-ldcref.o: \
- ldcref.c \
- $(INCDIR)/ansidecl.h \
- $(INCDIR)/bfdlink.h \
- $(INCDIR)/demangle.h \
- $(INCDIR)/fopen-same.h \
- $(INCDIR)/libiberty.h \
- $(INCDIR)/objalloc.h \
- $(INCDIR)/symcat.h \
- ../bfd/bfd.h \
- config.h \
- ld.h \
- ldexp.h \
- ldlang.h \
- ldmain.h \
- ldmisc.h \
- sysdep.h
-pe-dll.o: \
- pe-dll.c \
- $(BFDDIR)/libcoff.h \
- $(INCDIR)/ansidecl.h \
- $(INCDIR)/bfdlink.h \
- $(INCDIR)/coff/internal.h \
- $(INCDIR)/fopen-same.h \
- $(INCDIR)/libiberty.h \
- $(INCDIR)/safe-ctype.h \
- $(INCDIR)/symcat.h \
- ../bfd/bfd.h \
- config.h \
- deffile.h \
- ld.h \
- ldemul.h \
- ldexp.h \
- ldfile.h \
- ldgram.h \
- ldlang.h \
- ldmain.h \
- ldmisc.h \
- ldwrite.h \
- pe-dll.h \
- sysdep.h
-pep-dll.o: \
- pep-dll.c \
- $(BFDDIR)/libcoff.h \
- $(INCDIR)/ansidecl.h \
- $(INCDIR)/bfdlink.h \
- $(INCDIR)/coff/internal.h \
- $(INCDIR)/fopen-same.h \
- $(INCDIR)/libiberty.h \
- $(INCDIR)/safe-ctype.h \
- $(INCDIR)/symcat.h \
- ../bfd/bfd.h \
- config.h \
- deffile.h \
- ld.h \
- ldemul.h \
- ldexp.h \
- ldfile.h \
- ldgram.h \
- ldlang.h \
- ldmain.h \
- ldmisc.h \
- ldwrite.h \
- pe-dll.c \
- pep-dll.h \
- sysdep.h
-ldgram.o: \
- ldgram.c \
- $(INCDIR)/ansidecl.h \
- $(INCDIR)/bfdlink.h \
- $(INCDIR)/fopen-same.h \
- $(INCDIR)/symcat.h \
- ../bfd/bfd.h \
- config.h \
- ld.h \
- ldctor.h \
- ldemul.h \
- ldexp.h \
- ldfile.h \
- ldlang.h \
- ldlex.h \
- ldmain.h \
- ldmisc.h \
- ldver.h \
- mri.h \
- sysdep.h
-ldlex.o: \
- ldlex.c \
- $(INCDIR)/ansidecl.h \
- $(INCDIR)/bfdlink.h \
- $(INCDIR)/fopen-same.h \
- $(INCDIR)/libiberty.h \
- $(INCDIR)/safe-ctype.h \
- $(INCDIR)/symcat.h \
- ../bfd/bfd.h \
- config.h \
- ld.h \
- ldexp.h \
- ldfile.h \
- ldgram.h \
- ldlang.h \
- ldlex.h \
- ldmain.h \
- ldmisc.h \
- sysdep.h
-deffilep.o: \
- deffilep.c \
- $(INCDIR)/ansidecl.h \
- $(INCDIR)/fopen-same.h \
- $(INCDIR)/libiberty.h \
- $(INCDIR)/safe-ctype.h \
- $(INCDIR)/symcat.h \
- ../bfd/bfd.h \
- config.h \
- deffile.h \
- ld.h \
- ldmisc.h \
- sysdep.h
-# IF YOU PUT ANYTHING HERE IT WILL GO AWAY