[PATCH RFC 2/8] kconfig: add KDEVOPS_MAKE_VERBOSE option for persistent verbose output

Daniel Gomez <[email protected]>
Newsgroups dev.linux.lists.kdevops
Message-ID <[email protected]>
From: Daniel Gomez <[email protected]>

Add a new kconfig option in the "Kdevops configuration" menu to enable
verbose make output (V=1) by default. This promotes make verbosity from
a command-line-only option to a first-class configuration setting.

Features:
- KDEVOPS_MAKE_VERBOSE bool option in menuconfig
- Early parsing in main Makefile before V= logic
- Command line override support with proper priority:
  1. CLI V=0/V=1 (highest priority)
  2. CONFIG_KDEVOPS_MAKE_VERBOSE=y (persistent default)
  3. Built-in quiet mode (fallback)

Usage examples:
- make target          → Uses kconfig setting
- make V=0 target      → CLI overrides to quiet
- make V=1 target      → CLI overrides to verbose

This allows users to set a persistent verbosity preference while
maintaining full command-line flexibility, following industry
standard patterns used by Rust/Cargo, Kubernetes, and other tools.

Generated-by: Claude AI
Signed-off-by: dagomez <[email protected]>
---
 Makefile                 |  7 +++++++
 kconfigs/Kconfig.kdevops | 18 ++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/Makefile b/Makefile
index 90e8091d..9ea479c9 100644
--- a/Makefile
+++ b/Makefile
@@ -64,6 +64,13 @@ define print_target
 	echo "==> [$1]"
 endef
 
+# Parse kconfig verbosity setting early, allow CLI to override
+ifneq (,$(wildcard .config))
+ifeq ($(CONFIG_KDEVOPS_MAKE_VERBOSE),y)
+V ?= 1
+endif
+endif
+
 ifeq ($(V),1)
 export Q=@$(call print_target,$@) && set -x &&
 export NQ=true
diff --git a/kconfigs/Kconfig.kdevops b/kconfigs/Kconfig.kdevops
index c2362adf..d22edd01 100644
--- a/kconfigs/Kconfig.kdevops
+++ b/kconfigs/Kconfig.kdevops
@@ -76,6 +76,24 @@ config KDEVOPS_CUSTOM_SSH_KEXALGORITHMS
 	  Some distributions, such as older distributions, may require a custom
 	  ssh configuration entry for the KexAlgorithms parameter.
 
+config KDEVOPS_MAKE_VERBOSE
+	bool "Enable verbose make output (V=1)"
+	default n
+	help
+	  Enable verbose output for all make operations. This is equivalent
+	  to running 'make V=1' and shows all executed commands for debugging.
+
+	  When enabled, you'll see:
+	  - All shell commands being executed
+	  - Full ansible-playbook command lines
+	  - Detailed build output
+
+	  This is useful for debugging build issues and understanding what
+	  kdevops is doing behind the scenes. You can still override this
+	  setting on the command line with 'make V=0' or 'make V=1'.
+
+	  If unsure, say N.
+
 config KDEVOPS_BASELINE_AND_DEV
 	bool "Enable both a baseline and development system per target test"
 	default n

-- 
2.50.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.