Skip to content

Commit 1ba1b22

Browse files
committed
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 <hanzhijian@zepp.com>
1 parent 4d5f600 commit 1ba1b22

5 files changed

Lines changed: 5 additions & 4 deletions

File tree

Application.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ clean::
393393
$(call CLEANAROBJS)
394394
$(call CLEAN)
395395
distclean:: clean
396+
$(call DELFILE, .kconfig)
396397
$(call DELFILE, Make.dep)
397398
$(call DELFILE, .depend)
398399

audioutils/lame/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,6 @@ ifneq ($(PREFIX),)
102102
endif
103103

104104
distclean::
105-
$(Q)cd $(DST_PATH) && make distclean
105+
$(Q)if [ -d $(DST_PATH) ]; then cd $(DST_PATH) && $(MAKE) distclean; fi
106106

107107
include $(APPDIR)/Application.mk

crypto/wolfssl/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ distclean::
168168
$(call DELDIR, $(WOLFSSL_UNPACKNAME))
169169
$(call DELDIR, $(WOLFSSL_EXAMPLESNAME))
170170
else
171-
distclean:
171+
distclean::
172172
$(call DELDIR, $(WOLFSSL_UNPACKNAME))
173173
endif
174174

netutils/libshvc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ ifeq ($(wildcard $(SHVDIR)/.git),)
8282
$(eval $(call RUN_OMK_MAKE, context, default-config include-pass))
8383

8484
distclean::
85-
make -C $(SHVDIR) distclean
85+
if [ -d $(SHVDIR) ]; then make -C $(SHVDIR) distclean; fi
8686
$(call DELDIR, $(SHVDIR))
8787
$(call DELFILE, $(SHV_LIBS4C_TARGZ))
8888
endif

netutils/libulut/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ ifeq ($(wildcard $(ULUTDIR)/.git),)
8282
$(eval $(call RUN_OMK_MAKE, context, default-config include-pass))
8383

8484
distclean::
85-
make -C $(ULUTDIR) distclean
85+
if [ -d $(ULUTDIR) ]; then make -C $(ULUTDIR) distclean; fi
8686
$(call DELDIR, $(ULUTDIR))
8787
$(call DELFILE, $(ULUT_TARGZ))
8888
endif

0 commit comments

Comments
 (0)