From 541012e621386cd824eed81295206a34ba3ba497 Mon Sep 17 00:00:00 2001 From: TheCharlatan Date: Fri, 3 Feb 2023 21:42:57 +0100 Subject: [PATCH] Build: Use AM_V_GEN in Makefiles where appropriate When generating new files as part of the Makefile the recipe is sometimes suppressed with $(AM_V_GEN) and sometimes with `@`. We should prefer $(AM_V_GEN), since this also prints the lines in silent mode. This is arguably more in style with the current recipe echoing. Before: Generated test/data/script_tests.json.h Now: GEN test/data/script_tests.json.h A side effect of this change is that the recipe for generating build.h is now echoed on each make run. Arguably this makes its generation more transparent. --- src/Makefile.am | 5 ++--- src/Makefile.test.include | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 5830090ada0..39f5a29aa6c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -346,7 +346,7 @@ BITCOIN_CORE_H = \ obj/build.h: FORCE @$(MKDIR_P) $(builddir)/obj - @$(top_srcdir)/share/genbuild.sh "$(abs_top_builddir)/src/obj/build.h" \ + $(AM_V_GEN) $(top_srcdir)/share/genbuild.sh "$(abs_top_builddir)/src/obj/build.h" \ "$(abs_top_srcdir)" libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h @@ -1085,12 +1085,11 @@ endif %.raw.h: %.raw @$(MKDIR_P) $(@D) - @{ \ + $(AM_V_GEN) { \ echo "static unsigned const char $(*F)_raw[] = {" && \ $(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' && \ echo "};"; \ } > "$@.new" && mv -f "$@.new" "$@" - @echo "Generated $@" include Makefile.minisketch.include diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 4d867fdc2f1..1c03c6892bb 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -414,10 +414,9 @@ endif %.json.h: %.json @$(MKDIR_P) $(@D) - @{ \ + $(AM_V_GEN) { \ 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 $@"