From 24b658f023567e3ebdb9345ddeac18216057b2ff Mon Sep 17 00:00:00 2001 From: zhuyanlin Date: Wed, 1 Sep 2021 10:11:39 +0800 Subject: [PATCH] makefile: let `clean_context` in `distclean` command In multi-jobs build, `distclean` may be faster than `clean_context`, Fix the case `distclean` use the dirctorys that have been removed by `clean_context` in board/xtensa with xt-xcc --- tools/Makefile.unix | 3 ++- tools/Makefile.win | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/Makefile.unix b/tools/Makefile.unix index 0ca2b32c191..2700cb4d7fb 100644 --- a/tools/Makefile.unix +++ b/tools/Makefile.unix @@ -561,10 +561,11 @@ $(foreach SDIR, $(CLEANDIRS), $(eval $(call SDIR_template,$(SDIR),distclean))) subdir_distclean: $(foreach SDIR, $(CLEANDIRS), $(SDIR)_distclean) -distclean: clean subdir_distclean clean_context +distclean: clean subdir_distclean ifeq ($(CONFIG_BUILD_2PASS),y) $(Q) $(MAKE) -C $(CONFIG_PASS1_BUILDIR) distclean endif + $(Q) $(MAKE) clean_context $(call DELFILE, Make.defs) $(call DELFILE, defconfig) $(call DELFILE, .config) diff --git a/tools/Makefile.win b/tools/Makefile.win index f112634654a..396f5c5d420 100644 --- a/tools/Makefile.win +++ b/tools/Makefile.win @@ -510,10 +510,11 @@ $(foreach SDIR, $(CLEANDIRS), $(eval $(call SDIR_template,$(SDIR),distclean))) subdir_distclean: $(foreach SDIR, $(CLEANDIRS), $(SDIR)_distclean) -distclean: clean subdir_distclean clean_context +distclean: clean subdir_distclean ifeq ($(CONFIG_BUILD_2PASS),y) $(Q) $(MAKE) -C $(CONFIG_PASS1_BUILDIR) distclean endif + $(Q) $(MAKE) clean_context $(call DELFILE, Make.defs) $(call DELFILE, defconfig) $(call DELFILE, .config)