aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2023-05-16 10:55:15 +0100
committerfanquake <fanquake@gmail.com>2023-05-16 11:13:11 +0100
commitd819840f38db3269e524d5ca7197e7bc9a05240a (patch)
tree233f760bf5b7f565b1d9a8ca0dbe8ea9b6ca5e37
parentf7036a47459a66a46e86ca38338ee45ab15eed76 (diff)
parent1b1ffbd014b931afb9435ec10911b9a7c130d3e5 (diff)
downloadbitcoin-d819840f38db3269e524d5ca7197e7bc9a05240a.tar.xz
Merge bitcoin/bitcoin#27041: Build: Improve handling of suppressed logging in Makefiles
1b1ffbd014b931afb9435ec10911b9a7c130d3e5 Build: Log when test -f fails in Makefile (TheCharlatan) 541012e621386cd824eed81295206a34ba3ba497 Build: Use AM_V_GEN in Makefiles where appropriate (TheCharlatan) Pull request description: This PR triages some behavior around Makefile recipe echoing suppression. 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. Sometimes the error emitted by `test -f` is currently thrown without any logging. This makes it a bit harder to debug. Instead, print a helpful log message to point the developer in the right direction. Alternatively this could have been implemented by just removing the recipe echo suppression (@), but the subsequent make output became too noisy. ACKs for top commit: fanquake: ACK 1b1ffbd014b931afb9435ec10911b9a7c130d3e5 Tree-SHA512: e31869fab25e72802b692ce6735f9561912caea903c1577101b64c9cb115c98de01a59300e8ffe7b05b998345c1b64a79226231d7d1453236ac338c62dc9fbb3
-rw-r--r--src/Makefile.am7
-rw-r--r--src/Makefile.qt.include8
-rw-r--r--src/Makefile.test.include3
3 files changed, 8 insertions, 10 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 9e1fab869d..6d55602a0d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -357,7 +357,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
@@ -1049,7 +1049,7 @@ clean-local:
-rm -rf test/__pycache__
.rc.o:
- @test -f $(WINDRES)
+ @test -f $(WINDRES) || (echo "windres $(WINDRES) not found, but is required to compile windows resource files"; exit 1)
## FIXME: How to get the appropriate modulename_CPPFLAGS in here?
$(AM_V_GEN) $(WINDRES) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -DWINDRES_PREPROC -i $< -o $@
@@ -1104,12 +1104,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.qt.include b/src/Makefile.qt.include
index 602a118259..7852d1a2fa 100644
--- a/src/Makefile.qt.include
+++ b/src/Makefile.qt.include
@@ -371,13 +371,13 @@ translate: $(srcdir)/qt/bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCO
@rm -f $(srcdir)/qt/locale/bitcoin_en.xlf.old
$(QT_QRC_LOCALE_CPP): $(QT_QRC_LOCALE) $(QT_QM)
- @test -f $(RCC)
+ @test -f $(RCC) || (echo "rcc $(RCC) not found, but is required for generating qrc cpp files"; exit 1)
@cp -f $< $(@D)/temp_$(<F)
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin_locale --format-version 1 $(@D)/temp_$(<F) > $@
@rm $(@D)/temp_$(<F)
$(QT_QRC_CPP): $(QT_QRC) $(QT_FORMS_H) $(QT_RES_FONTS) $(QT_RES_ICONS) $(QT_RES_ANIMATION)
- @test -f $(RCC)
+ @test -f $(RCC) || (echo "rcc $(RCC) not found, but is required for generating qrc cpp files"; exit 1)
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin --format-version 1 $< > $@
CLEAN_QT = $(nodist_qt_libbitcoinqt_a_SOURCES) $(QT_QM) $(QT_FORMS_H) qt/*.gcda qt/*.gcno qt/temp_bitcoin_locale.qrc
@@ -404,7 +404,7 @@ bitcoin_qt_apk: FORCE
cd qt/android && ./gradlew build
ui_%.h: %.ui
- @test -f $(UIC)
+ @test -f $(UIC) || (echo "uic $(UIC) not found, but is required for generating ui headers"; exit 1)
@$(MKDIR_P) $(@D)
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(UIC) -o $@ $< || (echo "Error creating $@"; false)
@@ -415,6 +415,6 @@ moc_%.cpp: %.h
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(MOC) $(DEFAULT_INCLUDES) $(QT_INCLUDES_UNSUPPRESSED) $(MOC_DEFS) $< > $@
%.qm: %.ts
- @test -f $(LRELEASE)
+ @test -f $(LRELEASE) || (echo "lrelease $(LRELEASE) not found, but is required for generating translations"; exit 1)
@$(MKDIR_P) $(@D)
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(LRELEASE) -silent $< -qm $@
diff --git a/src/Makefile.test.include b/src/Makefile.test.include
index 461022bbfc..aaa5e3158e 100644
--- a/src/Makefile.test.include
+++ b/src/Makefile.test.include
@@ -422,10 +422,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 $@"