Tidy bfd.pot

Message ID 20200131003030.GF30118@bubble.grove.modra.org
State New
Headers show
Series
  • Tidy bfd.pot
Related show

Commit Message

Alan Modra Jan. 31, 2020, 12:30 a.m.
This patch removes the leak of Nick's source directory into bfd.pot,
and emits #line for some generated files so that those files aren't
referenced by comments in the .pot file.  You can see both of these
effects in the following diff.  I've also removed use of an
unnecessary temp file in the make rules.

@@ -92,10 +92,8 @@ msgstr ""
 #: elf64-nfp.c:238 elf64-ppc.c:1014 elf64-ppc.c:1349 elf64-ppc.c:1358
 #: elf64-s390.c:328 elf64-s390.c:378 elf64-x86-64.c:285 elfn32-mips.c:3786
 #: elfxx-ia64.c:324 elfxx-riscv.c:955 elfxx-sparc.c:589 elfxx-sparc.c:639
-#: elfxx-tilegx.c:912 elfxx-tilegx.c:952
-#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:2215
-#: /work/sources/binutils/current/bfd/elfnn-aarch64.c:2313 elf32-ia64.c:214
-#: elf32-ia64.c:3862 elf64-ia64.c:214 elf64-ia64.c:3862
+#: elfxx-tilegx.c:912 elfxx-tilegx.c:952 elfnn-aarch64.c:2215
+#: elfnn-aarch64.c:2313 elfnn-ia64.c:214 elfnn-ia64.c:3862
 #, c-format
 msgid "%pB: unsupported relocation type %#x"
 msgstr ""

	* Makefile.am (elf32-target.h, elf64-target.h): Don't use a temp
	file.  Use $< and $@ in rules.
	(elf32-aarch64.c, elf64-aarch64.c): Likewise.
	(elf32-ia64.c, elf64-ia64.c): Likewise.
	(elf32-riscv.c, elf64-riscv.c): Likewise.
	(peigen.c, pepigen.c, pex64igen.c): Likewise.
	(elf32-aarch64.c, elf64-aarch64.c): Don't emit $srcdir on #line.
	(elf32-riscv.c, elf64-riscv.c): Likewise, and use $(SED).
	(elf32-ia64.c, elf64-ia64.c): Do emit #line.
	(peigen.c, pepigen.c, pex64igen.c): Likewise.
	* Makefile.in: Regenerate.


-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/bfd/Makefile.am b/bfd/Makefile.am
index 7053a678a7..b6088a3c4a 100644
--- a/bfd/Makefile.am
+++ b/bfd/Makefile.am
@@ -827,63 +827,46 @@  endif
 endif
 
 elf32-target.h : elfxx-target.h
-	rm -f elf32-target.h
-	$(SED) -e s/NN/32/g < $(srcdir)/elfxx-target.h > elf32-target.new
-	mv -f elf32-target.new elf32-target.h
+	$(SED) -e s/NN/32/g < $< > $@
 
 elf64-target.h : elfxx-target.h
-	rm -f elf64-target.h
-	$(SED) -e s/NN/64/g < $(srcdir)/elfxx-target.h > elf64-target.new
-	mv -f elf64-target.new elf64-target.h
+	$(SED) -e s/NN/64/g < $< > $@
 
 elf32-aarch64.c : elfnn-aarch64.c
-	rm -f elf32-aarch64.c
-	echo "#line 1 \"$(srcdir)/elfnn-aarch64.c\"" > elf32-aarch64.new
-	$(SED) -e s/NN/32/g < $(srcdir)/elfnn-aarch64.c >> elf32-aarch64.new
-	mv -f elf32-aarch64.new elf32-aarch64.c
+	echo "#line 1 \"elfnn-aarch64.c\"" > $@
+	$(SED) -e s/NN/32/g < $< >> $@
 
 elf64-aarch64.c : elfnn-aarch64.c
-	rm -f elf64-aarch64.c
-	echo "#line 1 \"$(srcdir)/elfnn-aarch64.c\"" > elf64-aarch64.new
-	$(SED) -e s/NN/64/g < $(srcdir)/elfnn-aarch64.c >> elf64-aarch64.new
-	mv -f elf64-aarch64.new elf64-aarch64.c
+	echo "#line 1 \"elfnn-aarch64.c\"" > $@
+	$(SED) -e s/NN/64/g < $< >> $@
 
 elf32-ia64.c : elfnn-ia64.c
-	rm -f elf32-ia64.c
-	$(SED) -e s/NN/32/g < $(srcdir)/elfnn-ia64.c > elf32-ia64.new
-	mv -f elf32-ia64.new elf32-ia64.c
+	echo "#line 1 \"elfnn-ia64.c\"" > $@
+	$(SED) -e s/NN/32/g < $< >> $@
 
 elf64-ia64.c : elfnn-ia64.c
-	rm -f elf64-ia64.c
-	$(SED) -e s/NN/64/g < $(srcdir)/elfnn-ia64.c > elf64-ia64.new
-	mv -f elf64-ia64.new elf64-ia64.c
+	echo "#line 1 \"elfnn-ia64.c\"" > $@
+	$(SED) -e s/NN/64/g < $< >> $@
 
 elf32-riscv.c : elfnn-riscv.c
-	rm -f elf32-riscv.c
-	echo "#line 1 \"$(srcdir)/elfnn-riscv.c\"" > elf32-riscv.new
-	sed -e s/NN/32/g < $(srcdir)/elfnn-riscv.c >> elf32-riscv.new
-	mv -f elf32-riscv.new elf32-riscv.c
+	echo "#line 1 \"elfnn-riscv.c\"" > $@
+	$(SED) -e s/NN/32/g < $< >> $@
 
 elf64-riscv.c : elfnn-riscv.c
-	rm -f elf64-riscv.c
-	echo "#line 1 \"$(srcdir)/elfnn-riscv.c\"" > elf64-riscv.new
-	sed -e s/NN/64/g < $(srcdir)/elfnn-riscv.c >> elf64-riscv.new
-	mv -f elf64-riscv.new elf64-riscv.c
+	echo "#line 1 \"elfnn-riscv.c\"" > $@
+	$(SED) -e s/NN/64/g < $< >> $@
 
 peigen.c : peXXigen.c
-	rm -f peigen.c
-	$(SED) -e s/XX/pe/g < $(srcdir)/peXXigen.c > peigen.new
-	mv -f peigen.new peigen.c
+	echo "#line 1 \"peXXigen.c\"" > $@
+	$(SED) -e s/XX/pe/g < $< >> $@
 
 pepigen.c : peXXigen.c
-	rm -f pepigen.c
-	$(SED) -e s/XX/pep/g < $(srcdir)/peXXigen.c > pepigen.new
-	mv -f pepigen.new pepigen.c
+	echo "#line 1 \"peXXigen.c\"" > $@
+	$(SED) -e s/XX/pep/g < $< >> $@
 
 pex64igen.c: peXXigen.c
-	rm -f pex64igen.c
-	$(SED) -e s/XX/pex64/g < $(srcdir)/peXXigen.c > pex64igen.new
-	mv -f pex64igen.new pex64igen.c
+	echo "#line 1 \"peXXigen.c\"" > $@
+	$(SED) -e s/XX/pex64/g < $< >> $@
 
 BFD_H_DEPS= $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h $(INCDIR)/diagnostics.h
 LOCAL_H_DEPS= libbfd.h sysdep.h config.h bfd_stdint.h