Skip to content

Commit d8b26ab

Browse files
committed
build: move raw rule into Makefile.am
The same rule is used by the tests and benchmarks to generate headers, and currently causes #25501. Just deduplicate the code into Makefile.am.
1 parent ac59112 commit d8b26ab

File tree

3 files changed

+9
-18
lines changed

3 files changed

+9
-18
lines changed

src/Makefile.am

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,15 @@ nodist_libbitcoin_ipc_a_SOURCES = $(libbitcoin_ipc_mpgen_output)
10651065
CLEANFILES += $(libbitcoin_ipc_mpgen_output)
10661066
endif
10671067

1068+
%.raw.h: %.raw
1069+
@$(MKDIR_P) $(@D)
1070+
@{ \
1071+
echo "static unsigned const char $(*F)_raw[] = {" && \
1072+
$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' && \
1073+
echo "};"; \
1074+
} > "$@.new" && mv -f "$@.new" "$@"
1075+
@echo "Generated $@"
1076+
10681077
include Makefile.minisketch.include
10691078

10701079
include Makefile.crc32c.include

src/Makefile.bench.include

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,3 @@ bench: $(BENCH_BINARY) FORCE
9393

9494
bitcoin_bench_clean : FORCE
9595
rm -f $(CLEAN_BITCOIN_BENCH) $(bench_bench_bitcoin_OBJECTS) $(BENCH_BINARY)
96-
97-
%.raw.h: %.raw
98-
@$(MKDIR_P) $(@D)
99-
@{ \
100-
echo "static unsigned const char $(*F)_raw[] = {" && \
101-
$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' && \
102-
echo "};"; \
103-
} > "[email protected]" && mv -f "[email protected]" "$@"
104-
@echo "Generated $@"

src/Makefile.test.include

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -415,12 +415,3 @@ endif
415415
echo "};};"; \
416416
} > "[email protected]" && mv -f "[email protected]" "$@"
417417
@echo "Generated $@"
418-
419-
%.raw.h: %.raw
420-
@$(MKDIR_P) $(@D)
421-
@{ \
422-
echo "static unsigned const char $(*F)_raw[] = {" && \
423-
$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' && \
424-
echo "};"; \
425-
} > "[email protected]" && mv -f "[email protected]" "$@"
426-
@echo "Generated $@"

0 commit comments

Comments
 (0)