public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: binutils@sourceware.org
Subject: bfd targmatch.h makefile rule
Date: Fri, 6 May 2022 13:20:59 +0930	[thread overview]
Message-ID: <YnSbI2kvZqTED0gg@squeak.grove.modra.org> (raw)

I hit this just now with a make -j build after touching config.bfd.
mv: cannot stat 'targmatch.new': No such file or directory
make[2]: *** [Makefile:2336: targmatch.h] Error 1
make[2]: *** Waiting for unfinished jobs....

Fix that by not removing the target of the rule, a practice that seems
likely to cause parallel running of the rule recipe.  The bug goes
back to 1997, the initial c0734708814c commit.

	* Makefile.am (targmatch.h): rm the temp file, not targmatch.h.
	* Makefile.in: Regenerate.

diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index f2f70590e88..92ff15b36ee 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -801,7 +801,7 @@ libbfd.a: stamp-lib ; @true
 # vector names.  It is built from config.bfd.  It is not compiled by
 # itself, but is included by targets.c.
 targmatch.h: config.bfd targmatch.sed
-	$(AM_V_at)rm -f targmatch.h
+	$(AM_V_at)rm -f targmatch.new
 	$(AM_V_GEN)$(SED) -f $(srcdir)/targmatch.sed < $(srcdir)/config.bfd > targmatch.new
 	$(AM_V_at)mv -f targmatch.new targmatch.h
 
diff --git a/bfd/Makefile.in b/bfd/Makefile.in
index 3068560c48b..b5f0c0a5c89 100644
--- a/bfd/Makefile.in
+++ b/bfd/Makefile.in
@@ -2331,7 +2331,7 @@ libbfd.a: stamp-lib ; @true
 # vector names.  It is built from config.bfd.  It is not compiled by
 # itself, but is included by targets.c.
 targmatch.h: config.bfd targmatch.sed
-	$(AM_V_at)rm -f targmatch.h
+	$(AM_V_at)rm -f targmatch.new
 	$(AM_V_GEN)$(SED) -f $(srcdir)/targmatch.sed < $(srcdir)/config.bfd > targmatch.new
 	$(AM_V_at)mv -f targmatch.new targmatch.h
 

-- 
Alan Modra
Australia Development Lab, IBM

                 reply	other threads:[~2022-05-06  3:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YnSbI2kvZqTED0gg@squeak.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).