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.
This commit is contained in:
TheCharlatan 2023-02-03 21:42:57 +01:00
parent e2ae5c349c
commit 541012e621
No known key found for this signature in database
GPG key ID: 9B79B45691DB4173
2 changed files with 3 additions and 5 deletions

View file

@ -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

View file

@ -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 $@"