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-apps.git
The following commit(s) were added to refs/heads/master by this push:
new 81accb083 apps: fix distclean for partial builds and residual .kconfig
files
81accb083 is described below
commit 81accb08324485a0cc529a3777d2c2a099fe70fd
Author: hanzhijian <[email protected]>
AuthorDate: Mon Jul 6 10:11:19 2026 +0800
apps: fix distclean for partial builds and residual .kconfig files
The current distclean implementation has two issues:
1. Application.mk does not remove .kconfig on distclean, so stale
config fragments from earlier builds can pollute subsequent ones.
2. Several external-library Makefiles (lame, libshvc, libulut) run
"make -C <subdir> distclean" without checking whether the
subdirectory exists. When the library was never downloaded (common
in CI partial-build environments), distclean fails with "No such
file or directory".
Fix:
- Application.mk: add $(call DELFILE, .kconfig) to the distclean
target so that .kconfig is cleaned along with .built, .depend, etc.
- audioutils/lame/Makefile: guard the distclean recipe with
"if [ -d $(DST_PATH) ]; then ...; fi" and use $(MAKE) instead
of bare make.
- netutils/libshvc/Makefile, netutils/libulut/Makefile: same
directory-existence guard for their distclean recipes.
- crypto/wolfssl/Makefile: change "distclean:" to "distclean::"
(double-colon) so it does not override the distclean:: rule
inherited from Application.mk.
Signed-off-by: hanzhijian <[email protected]>
---
Application.mk | 1 +
audioutils/lame/Makefile | 2 +-
crypto/wolfssl/Makefile | 2 +-
netutils/libshvc/Makefile | 2 +-
netutils/libulut/Makefile | 2 +-
5 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/Application.mk b/Application.mk
index e99300644..1b6eab63e 100644
--- a/Application.mk
+++ b/Application.mk
@@ -393,6 +393,7 @@ clean::
$(call CLEANAROBJS)
$(call CLEAN)
distclean:: clean
+ $(call DELFILE, .kconfig)
$(call DELFILE, Make.dep)
$(call DELFILE, .depend)
diff --git a/audioutils/lame/Makefile b/audioutils/lame/Makefile
index 99526d63b..ccbe4cf21 100644
--- a/audioutils/lame/Makefile
+++ b/audioutils/lame/Makefile
@@ -102,6 +102,6 @@ ifneq ($(PREFIX),)
endif
distclean::
- $(Q)cd $(DST_PATH) && make distclean
+ $(Q)if [ -d $(DST_PATH) ]; then cd $(DST_PATH) && $(MAKE) distclean; fi
include $(APPDIR)/Application.mk
diff --git a/crypto/wolfssl/Makefile b/crypto/wolfssl/Makefile
index 77bc546a5..90b0f6390 100644
--- a/crypto/wolfssl/Makefile
+++ b/crypto/wolfssl/Makefile
@@ -168,7 +168,7 @@ distclean::
$(call DELDIR, $(WOLFSSL_UNPACKNAME))
$(call DELDIR, $(WOLFSSL_EXAMPLESNAME))
else
-distclean:
+distclean::
$(call DELDIR, $(WOLFSSL_UNPACKNAME))
endif
diff --git a/netutils/libshvc/Makefile b/netutils/libshvc/Makefile
index 3db2a49cb..af2669c88 100644
--- a/netutils/libshvc/Makefile
+++ b/netutils/libshvc/Makefile
@@ -82,7 +82,7 @@ ifeq ($(wildcard $(SHVDIR)/.git),)
$(eval $(call RUN_OMK_MAKE, context, default-config include-pass))
distclean::
- make -C $(SHVDIR) distclean
+ if [ -d $(SHVDIR) ]; then make -C $(SHVDIR) distclean; fi
$(call DELDIR, $(SHVDIR))
$(call DELFILE, $(SHV_LIBS4C_TARGZ))
endif
diff --git a/netutils/libulut/Makefile b/netutils/libulut/Makefile
index d3bdb498f..6582158f2 100644
--- a/netutils/libulut/Makefile
+++ b/netutils/libulut/Makefile
@@ -82,7 +82,7 @@ ifeq ($(wildcard $(ULUTDIR)/.git),)
$(eval $(call RUN_OMK_MAKE, context, default-config include-pass))
distclean::
- make -C $(ULUTDIR) distclean
+ if [ -d $(ULUTDIR) ]; then make -C $(ULUTDIR) distclean; fi
$(call DELDIR, $(ULUTDIR))
$(call DELFILE, $(ULUT_TARGZ))
endif