public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Vincent Smeets <Vincent.VSmeets@GMail.com>
To: gdb-patches@sourceware.org
Cc: Vincent Smeets <Vincent.VSmeets@GMail.com>
Subject: [PATCH 1/7] bfd: build with mktemp
Date: Thu, 19 Jan 2023 18:55:01 +0100	[thread overview]
Message-ID: <20230119175507.25046-2-Vincent.VSmeets@GMail.com> (raw)
In-Reply-To: <20230119175507.25046-1-Vincent.VSmeets@GMail.com>

---
 bfd/Makefile.am | 39 ++++++++++++++++++++++-----------------
 1 file changed, 22 insertions(+), 17 deletions(-)

diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index c0a48dcf..b71be3f7 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -742,14 +742,16 @@ SRC_POTFILES = $(SOURCE_CFILES) $(SOURCE_HFILES)
 BLD_POTFILES = $(BUILD_CFILES) $(BUILD_HFILES)
 
 po/SRC-POTFILES.in: @MAINT@ Makefile
+	tmp=`mktemp --tmpdir=. SRC-POTFILES.XXXXXX.in`; \
 	for file in $(SRC_POTFILES); do echo $$file; done \
-	  | LC_ALL=C sort > tmp.src \
-	  && mv tmp.src $(srcdir)/po/SRC-POTFILES.in
+	  | LC_ALL=C sort > $$tmp \
+	  && mv $$tmp $(srcdir)/po/SRC-POTFILES.in
 
 po/BLD-POTFILES.in: @MAINT@ Makefile
+	tmp=`mktemp --tmpdir=. BLD-POTFILES.XXXXXX.in`; \
 	for file in $(BLD_POTFILES); do echo $$file; done \
-	  | LC_ALL=C sort > tmp.bld \
-	  && mv tmp.bld $(srcdir)/po/BLD-POTFILES.in
+	  | LC_ALL=C sort > $$tmp \
+	  && mv $$tmp $(srcdir)/po/BLD-POTFILES.in
 
 all diststuff: info
 
@@ -796,9 +798,10 @@ libbfd_a_SOURCES =
 stamp-lib: libbfd.la
 	libtooldir=`$(LIBTOOL) --config | $(SED) -n -e 's/^objdir=//p'`; \
 	if [ -f $$libtooldir/libbfd.a ]; then \
-	  cp $$libtooldir/libbfd.a libbfd.tmp; \
-	  $(RANLIB) libbfd.tmp; \
-	  $(SHELL) $(srcdir)/../move-if-change libbfd.tmp libbfd.a; \
+	  tmp=`mktemp --tmpdir=. libbfd.XXXXXX.a`; \
+	  cp $$libtooldir/libbfd.a $$tmp; \
+	  $(RANLIB) $$tmp; \
+	  $(SHELL) $(srcdir)/../move-if-change $$tmp libbfd.a; \
 	else true; fi
 	touch stamp-lib
 
@@ -921,10 +924,9 @@ gen-aout: $(srcdir)/gen-aout.c Makefile
 $(BFD_H): stmp-bfd-h ; @true
 
 stmp-bfd-h: bfd-in3.h
-	rm -f bfd-tmp.h
-	cp bfd-in3.h bfd-tmp.h
-	$(SHELL) $(srcdir)/../move-if-change bfd-tmp.h $(BFD_H)
-	rm -f bfd-tmp.h
+	tmp=`mktemp --tmpdir=. bfd.XXXXXX.h`; \
+	cp bfd-in3.h $$tmp; \
+	$(SHELL) $(srcdir)/../move-if-change $$tmp $(BFD_H)
 	touch stmp-bfd-h
 
 BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c \
@@ -962,20 +964,23 @@ REGEN_HEADER = \
 
 $(srcdir)/bfd-in2.h: @MAINT@ stmp-bin2-h ; @true
 stmp-bin2-h: $(BFD_H_FILES) $(BFD64_H_FILES) $(MKDOC)
-	$(AM_V_GEN)H_FILES="$(BFD_H_FILES)" CHEW_FLAGS= ; $(REGEN_HEADER) > bfd-in2.h-new
-	$(AM_V_at)$(SHELL) $(srcdir)/../move-if-change bfd-in2.h-new $(srcdir)/bfd-in2.h
+	$(AM_V_GEN) tmp=`mktemp --tmpdir=. bfd-in2.XXXXXX.h`; \
+	H_FILES="$(BFD_H_FILES)" CHEW_FLAGS= ; $(REGEN_HEADER) > $$tmp; \
+	$(SHELL) $(srcdir)/../move-if-change $$tmp $(srcdir)/bfd-in2.h
 	$(AM_V_at)touch stmp-bin2-h
 
 $(srcdir)/libbfd.h: @MAINT@ stmp-lbfd-h ; @true
 stmp-lbfd-h: $(LIBBFD_H_FILES) $(MKDOC)
-	$(AM_V_GEN)H_FILES="$(LIBBFD_H_FILES)" CHEW_FLAGS=-i ; $(REGEN_HEADER) > libbfd.h-new
-	$(AM_V_at)$(SHELL) $(srcdir)/../move-if-change libbfd.h-new $(srcdir)/libbfd.h
+	$(AM_V_GEN) tmp=`mktemp --tmpdir=. libbfd.XXXXXX.h`; \
+	H_FILES="$(LIBBFD_H_FILES)" CHEW_FLAGS=-i ; $(REGEN_HEADER) > $$tmp; \
+	$(SHELL) $(srcdir)/../move-if-change $$tmp $(srcdir)/libbfd.h
 	$(AM_V_at)touch stmp-lbfd-h
 
 $(srcdir)/libcoff.h: @MAINT@ stmp-lcoff-h ; @true
 stmp-lcoff-h: $(LIBCOFF_H_FILES) $(MKDOC)
-	$(AM_V_GEN)H_FILES="$(LIBCOFF_H_FILES)" CHEW_FLAGS=-i ; $(REGEN_HEADER) > libcoff.h-new
-	$(AM_V_at)$(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h
+	$(AM_V_GEN) tmp=`mktemp --tmpdir=. lobcoff.XXXXXX.h`; \
+	H_FILES="$(LIBCOFF_H_FILES)" CHEW_FLAGS=-i ; $(REGEN_HEADER) > $$tmp; \
+	$(SHELL) $(srcdir)/../move-if-change $$tmp $(srcdir)/libcoff.h
 	$(AM_V_at)touch stmp-lcoff-h
 
 MOSTLYCLEANFILES += ofiles stamp-ofiles
-- 
2.39.0


  reply	other threads:[~2023-01-19 17:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-19 17:55 [Bug binutils/30022] concurrent builds can fail Vincent Smeets
2023-01-19 17:55 ` Vincent Smeets [this message]
2023-01-19 17:55 ` [PATCH 2/7] binutils: build with mktemp Vincent Smeets
2023-01-19 17:55 ` [PATCH 3/7] gas: " Vincent Smeets
2023-01-19 17:55 ` [PATCH 4/7] gold: " Vincent Smeets
2023-01-19 17:55 ` [PATCH 5/7] gprof: " Vincent Smeets
2023-01-19 17:55 ` [PATCH 6/7] ld: " Vincent Smeets
2023-01-19 17:55 ` [PATCH 7/7] opcodes: " Vincent Smeets
2023-01-19 20:32 ` [Bug binutils/30022] concurrent builds can fail Tom Tromey

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=20230119175507.25046-2-Vincent.VSmeets@GMail.com \
    --to=vincent.vsmeets@gmail.com \
    --cc=gdb-patches@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).