pkg/pkg.mk: improve clean and distclean for in-source builds

This commit is contained in:
Alexandre Abadie 2020-07-10 11:16:29 +02:00
parent b05b2fddb9
commit 06b152fac0
No known key found for this signature in database
GPG Key ID: 1C919A403CAE1405

View File

@ -126,17 +126,14 @@ ifeq ($(PKG_SOURCE_DIR),$(PKG_BUILD_DIR))
# This is the case for packages that are built within their source directory # This is the case for packages that are built within their source directory
# e.g. micropython and openthread # e.g. micropython and openthread
clean:: clean::
@-test -d $(PKG_SOURCE_DIR) && $(GIT_IN_PKG) clean $(GIT_QUIET) -xdff @-test -d $(PKG_SOURCE_DIR) && $(GIT_IN_PKG) clean -xdff '**' -e $(PKG_STATE:$(PKG_SOURCE_DIR)/%='%*')
distclean::
rm -rf $(PKG_SOURCE_DIR)
else else
clean:: clean::
rm -rf $(PKG_BUILD_DIR) rm -rf $(PKG_BUILD_DIR)
endif
distclean:: clean distclean:: clean
rm -rf $(PKG_SOURCE_DIR) rm -rf $(PKG_SOURCE_DIR)
endif
# Dependencies to 'patches' # Dependencies to 'patches'
-include $(PKG_PATCHED).d -include $(PKG_PATCHED).d