[7/7] opcodes: build with mktemp

Message ID 20230119175507.25046-8-Vincent.VSmeets@GMail.com
State Not applicable
Headers
Series [1/7] bfd: build with mktemp |

Commit Message

Vincent Smeets Jan. 19, 2023, 5:55 p.m. UTC
  ---
 opcodes/Makefile.am | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
  

Patch

diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am
index 7aa4e53f..628e4ccd 100644
--- a/opcodes/Makefile.am
+++ b/opcodes/Makefile.am
@@ -333,9 +333,10 @@  libopcodes_a_SOURCES =
 stamp-lib: libopcodes.la
 	libtooldir=`$(LIBTOOL) --config | sed -n -e 's/^objdir=//p'`; \
 	if [ -f $$libtooldir/libopcodes.a ]; then \
-	  cp $$libtooldir/libopcodes.a libopcodes.tmp; \
-	  $(RANLIB) libopcodes.tmp; \
-	  $(SHELL) $(srcdir)/../move-if-change libopcodes.tmp libopcodes.a; \
+	  tmp=`mktemp --tmpdir=. libopcodes.XXXXXX.a`; \
+	  cp $$libtooldir/libopcodes.a $$tmp; \
+	  $(RANLIB) $$tmp; \
+	  $(SHELL) $(srcdir)/../move-if-change $$tmp libopcodes.a; \
 	else true; fi
 	touch stamp-lib
 
@@ -343,8 +344,9 @@  libopcodes.a: stamp-lib ; @true
 
 POTFILES = $(HFILES) $(CFILES)
 po/POTFILES.in: @MAINT@ Makefile
-	for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > tmp \
-	  && mv tmp $(srcdir)/po/POTFILES.in
+	tmp=`mktemp --tmpdir=. POTFILES.XXXXXX.in`; \
+	for f in $(POTFILES); do echo $$f; done | LC_ALL=C sort > $$tmp \
+	  && mv $$tmp $(srcdir)/po/POTFILES.in
 
 CLEANFILES = \
 	stamp-epiphany stamp-fr30 stamp-frv stamp-ip2k stamp-iq2000 stamp-lm32 \