Browse Source

Bugfix: Correctly replace generated headers and fail cleanly

Also removes generation of headers for *.raw files in test_bitcoin (none exist anymore)
0.14
Luke Dashjr 8 years ago
parent
commit
b74ff5cf0c
  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
%.raw.h: %.raw %.raw.h: %.raw
@$(MKDIR_P) $(@D) @$(MKDIR_P) $(@D)
@echo "static unsigned const char $(*F)[] = {" >> $@ @{ \
@$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' >> $@ echo "static unsigned const char $(*F)[] = {" && \
@echo "};" >> $@ $(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' && \
echo "};"; \
} > "$@.new" && mv -f "$@.new" "$@"
@echo "Generated $@" @echo "Generated $@"

18
src/Makefile.test.include

@ -149,16 +149,10 @@ endif
%.json.h: %.json %.json.h: %.json
@$(MKDIR_P) $(@D) @$(MKDIR_P) $(@D)
@echo "namespace json_tests{" > $@ @{ \
@echo "static unsigned const char $(*F)[] = {" >> $@ echo "namespace json_tests{" && \
@$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' >> $@ echo "static unsigned const char $(*F)[] = {" && \
@echo "};};" >> $@ $(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' && \
@echo "Generated $@" echo "};};"; \
} > "$@.new" && mv -f "$@.new" "$@"
%.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 "Generated $@" @echo "Generated $@"

Loading…
Cancel
Save