Skip to content

Commit 1b1ffbd

Browse files
committed
Build: Log when test -f fails in Makefile
Silently emitting an error 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.
1 parent 541012e commit 1b1ffbd

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ clean-local:
10301030
-rm -rf test/__pycache__
10311031

10321032
.rc.o:
1033-
@test -f $(WINDRES)
1033+
@test -f $(WINDRES) || (echo "windres $(WINDRES) not found, but is required to compile windows resource files"; exit 1)
10341034
## FIXME: How to get the appropriate modulename_CPPFLAGS in here?
10351035
$(AM_V_GEN) $(WINDRES) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -DWINDRES_PREPROC -i $< -o $@
10361036

src/Makefile.qt.include

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,13 +371,13 @@ translate: $(srcdir)/qt/bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCO
371371
@rm -f $(srcdir)/qt/locale/bitcoin_en.xlf.old
372372

373373
$(QT_QRC_LOCALE_CPP): $(QT_QRC_LOCALE) $(QT_QM)
374-
@test -f $(RCC)
374+
@test -f $(RCC) || (echo "rcc $(RCC) not found, but is required for generating qrc cpp files"; exit 1)
375375
@cp -f $< $(@D)/temp_$(<F)
376376
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin_locale --format-version 1 $(@D)/temp_$(<F) > $@
377377
@rm $(@D)/temp_$(<F)
378378

379379
$(QT_QRC_CPP): $(QT_QRC) $(QT_FORMS_H) $(QT_RES_FONTS) $(QT_RES_ICONS) $(QT_RES_ANIMATION)
380-
@test -f $(RCC)
380+
@test -f $(RCC) || (echo "rcc $(RCC) not found, but is required for generating qrc cpp files"; exit 1)
381381
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin --format-version 1 $< > $@
382382

383383
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
404404
cd qt/android && ./gradlew build
405405

406406
ui_%.h: %.ui
407-
@test -f $(UIC)
407+
@test -f $(UIC) || (echo "uic $(UIC) not found, but is required for generating ui headers"; exit 1)
408408
@$(MKDIR_P) $(@D)
409409
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(UIC) -o $@ $< || (echo "Error creating $@"; false)
410410

@@ -415,6 +415,6 @@ moc_%.cpp: %.h
415415
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(MOC) $(DEFAULT_INCLUDES) $(QT_INCLUDES_UNSUPPRESSED) $(MOC_DEFS) $< > $@
416416

417417
%.qm: %.ts
418-
@test -f $(LRELEASE)
418+
@test -f $(LRELEASE) || (echo "lrelease $(LRELEASE) not found, but is required for generating translations"; exit 1)
419419
@$(MKDIR_P) $(@D)
420420
$(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(LRELEASE) -silent $< -qm $@

0 commit comments

Comments
 (0)