aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-04-23 16:42:27 +0930
committerAlan Modra <amodra@gmail.com>2019-04-23 17:02:44 +0930
commitcc9519e7d6251b84dd95c55b562a15b25d703bc0 (patch)
tree72696813973af6dd02511a3a8c32e51c0445c6af /ld
parent6f38008bb423d71e6984c8ce49b4fc83d2cdaf0d (diff)
downloadgdb-cc9519e7d6251b84dd95c55b562a15b25d703bc0.zip
gdb-cc9519e7d6251b84dd95c55b562a15b25d703bc0.tar.gz
gdb-cc9519e7d6251b84dd95c55b562a15b25d703bc0.tar.bz2
Fix automatic makefile dependencies for generated ld/e*.c
Commit c40e31a121 broke --enable-dependency-tracking=no. * Makefile.am (GENDEPDIR): New var, used.. (GENSCRIPTS): ..here. * Makefile.in: Regenerate. * genscripts.sh: Test for $DEPDIR set before every use.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/Makefile.am10
-rw-r--r--ld/Makefile.in8
-rwxr-xr-xld/genscripts.sh28
4 files changed, 36 insertions, 17 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 76b202b..4b4956e 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,10 @@
+2019-04-23 Alan Modra <amodra@gmail.com>
+
+ * Makefile.am (GENDEPDIR): New var, used..
+ (GENSCRIPTS): ..here.
+ * Makefile.in: Regenerate.
+ * genscripts.sh: Test for $DEPDIR set before every use.
+
2019-04-22 Matthew Fortune <matthew.fortune@mips.com>
* testsuite/ld-mips-elf/mips-elf-flags.exp: Fix expected ASEs
diff --git a/ld/Makefile.am b/ld/Makefile.am
index 0e9dc86..4a0bb15 100644
--- a/ld/Makefile.am
+++ b/ld/Makefile.am
@@ -152,6 +152,7 @@ AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) \
BFDLIB = ../bfd/libbfd.la
LIBIBERTY = ../libiberty/libiberty.a
+# These all start with e so 'make clean' can find them.
ALL_EMULATION_SOURCES = \
eaix5ppc.c \
eaix5rs6.c \
@@ -611,9 +612,12 @@ ldemul-list.h: Makefile
stringify.sed: ${srcdir}/emultempl/$(STRINGIFY)
cp ${srcdir}/emultempl/$(STRINGIFY) stringify.sed
-# These all start with e so 'make clean' can find them.
-
-GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @target_alias@ "${DEPDIR}" "${LIB_PATH}" "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@ @enable_initfini_array@
+if AMDEP
+ GENDEPDIR=$(DEPDIR)
+else
+ GENDEPDIR=
+endif
+GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @target_alias@ "$(GENDEPDIR)" "${LIB_PATH}" "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@ @enable_initfini_array@
GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
@TDIRS@
diff --git a/ld/Makefile.in b/ld/Makefile.in
index e71b4d4..fbccfbc 100644
--- a/ld/Makefile.in
+++ b/ld/Makefile.in
@@ -638,6 +638,8 @@ AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) \
BFDLIB = ../bfd/libbfd.la
LIBIBERTY = ../libiberty/libiberty.a
+
+# These all start with e so 'make clean' can find them.
ALL_EMULATION_SOURCES = \
eaix5ppc.c \
eaix5rs6.c \
@@ -979,9 +981,9 @@ OFILES = ldgram.@OBJEXT@ ldlex-wrapper.@OBJEXT@ lexsup.@OBJEXT@ ldlang.@OBJEXT@
STAGESTUFF = *.@OBJEXT@ ldscripts/* e*.c
SRC_POTFILES = $(CFILES) $(HFILES)
BLD_POTFILES = $(ALL_EMULATION_SOURCES) $(ALL_64_EMULATION_SOURCES)
-
-# These all start with e so 'make clean' can find them.
-GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @target_alias@ "${DEPDIR}" "${LIB_PATH}" "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@ @enable_initfini_array@
+@AMDEP_FALSE@GENDEPDIR =
+@AMDEP_TRUE@GENDEPDIR = $(DEPDIR)
+GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh "${srcdir}" "${libdir}" "${prefix}" "${exec_prefix}" @host@ @target@ @target_alias@ "$(GENDEPDIR)" "${LIB_PATH}" "@EMULATION_LIBPATH@" "@NATIVE_LIB_DIRS@" @use_sysroot@ @enable_initfini_array@
GEN_DEPENDS = $(srcdir)/genscripts.sh stringify.sed
# We need this for automake to use YLWRAP.
diff --git a/ld/genscripts.sh b/ld/genscripts.sh
index 7ee03d2..cb2b081 100755
--- a/ld/genscripts.sh
+++ b/ld/genscripts.sh
@@ -129,11 +129,15 @@ TOOL_LIB=$2
source_sh()
{
- echo $1 >> ${DEPDIR}/e${EMULATION_NAME}.Tc
+ if test -n "${DEPDIR}"; then
+ echo $1 >> ${DEPDIR}/e${EMULATION_NAME}.Tc
+ fi
. $1
}
-rm -f ${DEPDIR}/e${EMULATION_NAME}.Tc
+if test -n "${DEPDIR}"; then
+ rm -f ${DEPDIR}/e${EMULATION_NAME}.Tc
+fi
# Include the emulation-specific parameters:
CUSTOMIZER_SCRIPT="${srcdir}/emulparams/${EMULATION_NAME}.sh"
@@ -639,12 +643,14 @@ fi
> e${EMULATION_NAME}.c
source_em ${srcdir}/emultempl/${TEMPLATE_NAME-generic}.em
-ecdeps=
-for dep in `cat ${DEPDIR}/e${EMULATION_NAME}.Tc`; do
- case " $ecdeps " in
- *" $dep "*): ;;
- *) ecdeps="$ecdeps $dep" ;;
- esac
-done
-rm -f ${DEPDIR}/e${EMULATION_NAME}.Tc
-echo "e${EMULATION_NAME}.c:${ecdeps}" > ${DEPDIR}/e${EMULATION_NAME}.Pc
+if test -n "${DEPDIR}"; then
+ ecdeps=
+ for dep in `cat ${DEPDIR}/e${EMULATION_NAME}.Tc`; do
+ case " $ecdeps " in
+ *" $dep "*): ;;
+ *) ecdeps="$ecdeps $dep" ;;
+ esac
+ done
+ rm -f ${DEPDIR}/e${EMULATION_NAME}.Tc
+ echo "e${EMULATION_NAME}.c:${ecdeps}" > ${DEPDIR}/e${EMULATION_NAME}.Pc
+fi