aboutsummaryrefslogtreecommitdiff
path: root/libbacktrace
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2019-01-28 22:21:19 +0000
committerTom de Vries <tdevries@suse.de>2019-01-28 22:21:19 +0000
commit93a22553a1295a114efe752b8d512ee766f9499c (patch)
tree1857f30aa773cb56b54368657b754eef669986a4 /libbacktrace
parent4a151110fa3e7b93099dfa2493f909ccdddc341b (diff)
[libbacktrace] Fix and simplify xcoff_%.c pattern rule
When generating xcoff_%.c, the last command is a sed command. In case of a sed failure, this will leave an incomplete file, which will appear as up to date to make, so consequently it will not be regenerated. Fix this by sedding into a temporary file instead. Also, use $< to access the prerequisite xcoff.c, instead of spelling out the file name once more. 2019-01-28 Tom de Vries <tdevries@suse.de> * Makefile.am (xcoff_%.c): Generate sed result into temporary file. Use $< to access prerequisite. * Makefile.in: Regenerate. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@268344 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libbacktrace')
-rw-r--r--libbacktrace/ChangeLog6
-rw-r--r--libbacktrace/Makefile.am5
-rw-r--r--libbacktrace/Makefile.in5
3 files changed, 12 insertions, 4 deletions
diff --git a/libbacktrace/ChangeLog b/libbacktrace/ChangeLog
index b26b78148cf..9097401014b 100644
--- a/libbacktrace/ChangeLog
+++ b/libbacktrace/ChangeLog
@@ -1,3 +1,9 @@
+2019-01-28 Tom de Vries <tdevries@suse.de>
+
+ * Makefile.am (xcoff_%.c): Generate sed result into temporary file.
+ Use $< to access prerequisite.
+ * Makefile.in: Regenerate.
+
2019-01-25 Nathan Sidwell <nathan@acm.org>
* elf.c (elf_add): Pass "" filename to recursive call with
diff --git a/libbacktrace/Makefile.am b/libbacktrace/Makefile.am
index 997a535dff4..0d5b3193e25 100644
--- a/libbacktrace/Makefile.am
+++ b/libbacktrace/Makefile.am
@@ -108,8 +108,9 @@ xcoff_%.c: xcoff.c
REPLACE='#undef BACKTRACE_XCOFF_SIZE\
#define BACKTRACE_XCOFF_SIZE'; \
$(SED) "s/^$$SEARCH\$$/$$REPLACE $*/" \
- $(srcdir)/xcoff.c \
- > $@
+ $< \
+ > $@.tmp
+ mv $@.tmp $@
test_elf_SOURCES = test_format.c testlib.c
test_elf_LDADD = libbacktrace_noformat.la elf.lo
diff --git a/libbacktrace/Makefile.in b/libbacktrace/Makefile.in
index f04577066f8..b25ac92aeda 100644
--- a/libbacktrace/Makefile.in
+++ b/libbacktrace/Makefile.in
@@ -1754,8 +1754,9 @@ uninstall-am:
@NATIVE_TRUE@ REPLACE='#undef BACKTRACE_XCOFF_SIZE\
@NATIVE_TRUE@ #define BACKTRACE_XCOFF_SIZE'; \
@NATIVE_TRUE@ $(SED) "s/^$$SEARCH\$$/$$REPLACE $*/" \
-@NATIVE_TRUE@ $(srcdir)/xcoff.c \
-@NATIVE_TRUE@ > $@
+@NATIVE_TRUE@ $< \
+@NATIVE_TRUE@ > $@.tmp
+@NATIVE_TRUE@ mv $@.tmp $@
@NATIVE_TRUE@instrumented_alloc.lo: alloc.c