Browse Source

Merge #9140: Bugfix: Correctly replace generated headers and fail cleanly

b74ff5c Bugfix: Correctly replace generated headers and fail cleanly (Luke Dashjr)
0.14
Wladimir J. van der Laan 8 years ago
parent
commit
018a4eb120
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 8
      src/Makefile.bench.include
  2. 18
      src/Makefile.test.include

8
src/Makefile.bench.include

@ -67,7 +67,9 @@ bitcoin_bench_clean : FORCE @@ -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 $@"

18
src/Makefile.test.include

@ -149,16 +149,10 @@ endif @@ -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 $@"

Loading…
Cancel
Save