defs.mk: Define Q and use it in *.mk

Define Q ?= @, and replace @<command> in recipes by $(Q)<command>.
Meant to be overridden from the environment for debugging as in

  Q= make

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-01-25 17:34:53 +01:00
commit f869b5aaca
15 changed files with 47 additions and 45 deletions

View file

@ -163,7 +163,7 @@ install:
@echo " Target install is not supported by this Makefile."
@echo " Target pkg-rebuild-reinstall might be what you are looking for."
@echo
@exit 1
$(Q)exit 1
# --- build targets
@ -185,15 +185,15 @@ build-order-%: $(filter-out $(UNAVAILABLE_TARGETS),pull.done)
build-order: build-order-all
echo-build-deps:
@$(PROJECTS_PY) required-os-pkg --skip-excluded --flavours "build" $(TARGET_PROJECTS)
$(Q)$(PROJECTS_PY) required-os-pkg --skip-excluded --flavours "build" $(TARGET_PROJECTS)
echo-install-deps:
@$(PROJECTS_PY) required-os-pkg --skip-excluded --flavours "build run" $(TARGET_PROJECTS)
$(Q)$(PROJECTS_PY) required-os-pkg --skip-excluded --flavours "build run" $(TARGET_PROJECTS)
echo-release-deps:
@$(PROJECTS_PY) required-os-pkg --skip-excluded --flavours "build run release" $(TARGET_PROJECTS)
$(Q)$(PROJECTS_PY) required-os-pkg --skip-excluded --flavours "build run release" $(TARGET_PROJECTS)
echo-os:
@$(GET_OS_SH)
$(Q)$(GET_OS_SH)
echo-projects:
@echo $(PROJECTS)
@ -211,22 +211,22 @@ distclean: clean.text-files-cache
clean.text-files-cache:
rm -f $(TEXT_FILES_CACHE)
list-files:
@realpath PROJECTS_MAKEFILE_NAME
@for p in $(BUILD_PROJECTS); do \
$(Q)realpath PROJECTS_MAKEFILE_NAME
$(Q)for p in $(BUILD_PROJECTS); do \
$(LIST_VCS_FILES_SH) -znf $$p | sed -z "s/^/$$p\//" | \
xargs -0 realpath -q ;\
done
$(TEXT_FILES_CACHE):
@make -s text-files-update
$(Q)make -s text-files-update
text-files-update:
make -s --no-print-directory list-files | tr '\n' '\0' | xargs -0 file -N | sed "/:.*text/I !d; s/:.*//" > $(TEXT_FILES_CACHE).tmp
mv $(TEXT_FILES_CACHE).tmp $(TEXT_FILES_CACHE)
text-files-update-all:
@PROJECTS_TXT= make text-files-update
$(Q)PROJECTS_TXT= make text-files-update
text-files-list list-text-files: | $(TEXT_FILES_CACHE)
@cat $(TEXT_FILES_CACHE)
$(Q)cat $(TEXT_FILES_CACHE)
text-files-list-0 list-text-files-0: | $(TEXT_FILES_CACHE)
@cat $(TEXT_FILES_CACHE) | tr '\n' '\0'
$(Q)cat $(TEXT_FILES_CACHE) | tr '\n' '\0'
cloc:
for p in $(GIT_PROJECTS); do \
@ -334,7 +334,7 @@ git-clone-%: $(SSH_WRAPPER_SH)
$(PGIT_SH_CLONE_DEFAULT)
git-show-non-master-branches:
@$(PGIT_SH) branch 2>&1 | \
$(Q)$(PGIT_SH) branch 2>&1 | \
sed '/^#\|^*/!d; s/.*git -C //; s/ *branch *//; s/ *\* *//' | \
while read p; do \
read b ;\
@ -344,7 +344,7 @@ git-show-non-master-branches:
done
git-show-pushable-master-branches:
@for p in $(BUILD_PROJECTS); do \
$(Q)for p in $(BUILD_PROJECTS); do \
if git -C $$p log --oneline origin/master.. | grep . >/dev/null; then \
echo ======================= $$p ;\
git -C $$p log --oneline origin/master.. ;\