[PATCH v3 07/12] selftests/nolibc: add menuconfig and mrproper for development

From: Zhangjin Wu
Date: Thu Jul 27 2023 - 16:29:39 EST


menuconfig and mrproper are frequently used operations during a new
architecture porting, testing or debugging.

menuconfig is required to tune and test extra kernel config options for
tinyconfig.

mrproper is required to get a clean srctree while want to start a new
building with O= option, the old generated files in srctree must be
mrproper-ed.

differ from local nolibc targets, the menuconfig and mrproper targets
from top-level Makefile accept different ARCH variable and require extra
'-C /path/to/srctree', which make development not consistent and
therefore very painful, let's add local menuconfig and mrproper targets
too.

To reduce duplicated entries, menuconfig and mrproper are added
together.

Signed-off-by: Zhangjin Wu <falcon@xxxxxxxxxxx>
---
tools/testing/selftests/nolibc/Makefile | 3 +++
1 file changed, 3 insertions(+)

diff --git a/tools/testing/selftests/nolibc/Makefile b/tools/testing/selftests/nolibc/Makefile
index 6385915d16c9..a214745e0f3e 100644
--- a/tools/testing/selftests/nolibc/Makefile
+++ b/tools/testing/selftests/nolibc/Makefile
@@ -215,6 +215,9 @@ defconfig:
$(Q)$(srctree)/scripts/kconfig/merge_config.sh -O "$(objtree)" -m "$(KERNEL_CONFIG)" $(foreach c,$(EXTCONFIG),$(wildcard $(CURDIR)/configs/$c))
$(Q)$(MAKE_KERNEL) KCONFIG_ALLCONFIG="$(KERNEL_CONFIG)" allnoconfig

+menuconfig mrproper:
+ $(Q)$(MAKE_KERNEL) $@
+
PHONY += $(KERNEL_CONFIG)
$(KERNEL_CONFIG):
$(Q)if [ ! -f "$(KERNEL_CONFIG)" ]; then $(MAKE) --no-print-directory defconfig; fi
--
2.25.1