From b225f6cd54aceac80463b3d1f1e021c624166bfc Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 27 Mar 2021 21:18:38 +0100 Subject: [PATCH] - add Q and KBUILD_VERBOSE --- Makefile | 21 ++++++++++++++++++++- make/buildsystem-helpers.mk | 9 +++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c8108921..8fa91905 100755 --- a/Makefile +++ b/Makefile @@ -31,10 +31,29 @@ export CDPATH := # determinism and reproducibility with top-level parallel build. .NOTPARALLEL: +# To put more focus on warnings, be less verbose as default +# Use 'make V=1' to see the full commands +ifeq ("$(origin V)", "command line") + KBUILD_VERBOSE = $(V) +endif +ifndef KBUILD_VERBOSE + KBUILD_VERBOSE = 0 +endif + +ifeq ($(KBUILD_VERBOSE),1) + Q = +ifndef VERBOSE + VERBOSE = 1 +endif +export VERBOSE +else + Q = @ +endif + # kconfig uses CONFIG_SHELL CONFIG_SHELL := $(SHELL) -export SHELL CONFIG_SHELL +export SHELL CONFIG_SHELL Q KBUILD_VERBOSE # ----------------------------------------------------------------------------- diff --git a/make/buildsystem-helpers.mk b/make/buildsystem-helpers.mk index e1307d6f..b2f12d32 100644 --- a/make/buildsystem-helpers.mk +++ b/make/buildsystem-helpers.mk @@ -180,13 +180,16 @@ REWRITE_LIBTOOL_RULES = "s,^libdir=.*,libdir='$(1)',; \ REWRITE_LIBTOOL_TAG = rewritten=1 define rewrite_libtool # (libdir) + @#$(call MESSAGE,"Fixing libtool files in $(subst $(TARGET_DIR)/,,$(1))") + $(Q)( \ for la in $$(find $(1) -name "*.la" -type f); do \ if ! grep -q "$(REWRITE_LIBTOOL_TAG)" $${la}; then \ $(call MESSAGE,"Rewriting $${la#$(TARGET_DIR)/}"); \ $(SED) $(REWRITE_LIBTOOL_RULES) $${la}; \ echo -e "\n# Adapted to buildsystem\n$(REWRITE_LIBTOOL_TAG)" >> $${la}; \ fi; \ - done + done; \ + ) endef # rewrite libtool libraries automatically @@ -202,9 +205,11 @@ REWRITE_CONFIG_RULES = "s,^prefix=.*,prefix='$(TARGET_prefix)',; \ s,^includedir=.*,includedir='$(TARGET_includedir)'," define rewrite_config_script # (config-script) + $(Q)( \ mv $(TARGET_bindir)/$(1) $(HOST_DIR)/bin; \ $(call MESSAGE,"Rewriting $(1)"); \ - $(SED) $(REWRITE_CONFIG_RULES) $(HOST_DIR)/bin/$(1) + $(SED) $(REWRITE_CONFIG_RULES) $(HOST_DIR)/bin/$(1); \ + ) endef # rewrite config scripts automatically