This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 7a04cddb78a build: clean previous compiled files after menuconfig 
updates
7a04cddb78a is described below

commit 7a04cddb78a05ca634f91af4811a471e1836dc5c
Author: Agnimitra sasaru <[email protected]>
AuthorDate: Wed Apr 29 14:47:31 2026 +0000

    build: clean previous compiled files after menuconfig updates
    
    Fixes #16151. Compares .config state before and after kconfig-mconf and 
triggers 'make clean' if the configuration was modified to prevent orphaned 
object files.
    
    Signed-off-by: Agnimitra sasaru 
<[email protected]>
---
 tools/Unix.mk | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/tools/Unix.mk b/tools/Unix.mk
index 5abdda08310..d421205c1e6 100644
--- a/tools/Unix.mk
+++ b/tools/Unix.mk
@@ -747,22 +747,34 @@ olddefconfig:
 menuconfig:
        $(Q) $(MAKE) clean_context
        $(Q) $(MAKE) apps_preconfig
+       $(Q) cp .config .config.tmp 2>/dev/null || true
        $(Q) ${KCONFIG_ENV} ${KCONFIG_MENUCONFIG}
+       $(Q) cmp -s .config .config.tmp || $(MAKE) clean
+       $(Q) rm -f .config.tmp
 
 nconfig: apps_preconfig
        $(Q) $(MAKE) clean_context
        $(Q) $(MAKE) apps_preconfig
+       $(Q) cp .config .config.tmp
        $(Q) ${KCONFIG_ENV} ${KCONFIG_NCONFIG}
+       $(Q) cmp -s .config .config.tmp || $(MAKE) clean
+       $(Q) rm -f .config.tmp
 
 qconfig: apps_preconfig
        $(Q) $(MAKE) clean_context
        $(Q) $(MAKE) apps_preconfig
+       $(Q) cp .config .config.tmp
        $(Q) ${KCONFIG_ENV} ${KCONFIG_QCONFIG}
+       $(Q) cmp -s .config .config.tmp || $(MAKE) clean
+       $(Q) rm -f .config.tmp
 
 gconfig: apps_preconfig
-       $(Q) $(MAKE) clean_context
+       $(Q) $(MAKE) clean_context1
        $(Q) $(MAKE) apps_preconfig
+       $(Q) cp .config .config.tmp
        $(Q) ${KCONFIG_ENV} ${KCONFIG_GCONFIG}
+       $(Q) cmp -s .config .config.tmp || $(MAKE) clean
+       $(Q) rm -f .config.tmp
 
 savedefconfig: apps_preconfig
        $(Q) ${KCONFIG_ENV} ${KCONFIG_SAVEDEFCONFIG}

Reply via email to