aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-11-15 10:34:46 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2016-11-15 10:34:56 +0100
commit018a4eb120dcdab73f07ca02d18a5c8843509d67 (patch)
treee49b83f39f5064eba79c1c4380a0c43085ba0d72
parentf54e4605fc31bd0a5bc8a3f6ba165be2df5f31d5 (diff)
parentb74ff5cf0c902b993a759f9ac92d95e186397662 (diff)
Merge #9140: Bugfix: Correctly replace generated headers and fail cleanly
b74ff5c Bugfix: Correctly replace generated headers and fail cleanly (Luke Dashjr)
-rw-r--r--src/Makefile.bench.include8
-rw-r--r--src/Makefile.test.include18
2 files changed, 11 insertions, 15 deletions
diff --git a/src/Makefile.bench.include b/src/Makefile.bench.include
index 840d33c1b5..246797a1b2 100644
--- a/src/Makefile.bench.include
+++ b/src/Makefile.bench.include
@@ -67,7 +67,9 @@ bitcoin_bench_clean : FORCE
%.raw.h: %.raw
@$(MKDIR_P) $(@D)
- @echo "static unsigned const char $(*F)[] = {" >> $@
- @$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' >> $@
- @echo "};" >> $@
+ @{ \
+ echo "static unsigned const char $(*F)[] = {" && \
+ $(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' && \
+ echo "};"; \
+ } > "$@.new" && mv -f "$@.new" "$@"
@echo "Generated $@"
diff --git a/src/Makefile.test.include b/src/Makefile.test.include
index fa610e300c..a14adc7876 100644
--- a/src/Makefile.test.include
+++ b/src/Makefile.test.include
@@ -149,16 +149,10 @@ endif
%.json.h: %.json
@$(MKDIR_P) $(@D)
- @echo "namespace json_tests{" > $@
- @echo "static unsigned const char $(*F)[] = {" >> $@
- @$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' >> $@
- @echo "};};" >> $@
- @echo "Generated $@"
-
-%.raw.h: %.raw
- @$(MKDIR_P) $(@D)
- @echo "namespace alert_tests{" > $@
- @echo "static unsigned const char $(*F)[] = {" >> $@
- @$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' >> $@
- @echo "};};" >> $@
+ @{ \
+ echo "namespace json_tests{" && \
+ echo "static unsigned const char $(*F)[] = {" && \
+ $(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' && \
+ echo "};};"; \
+ } > "$@.new" && mv -f "$@.new" "$@"
@echo "Generated $@"