From e113fb1d41664add7618d6ce4abafdfff3e027fb Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Wed, 26 Sep 2012 16:00:54 -0700 Subject: [PATCH] Run clean steps in only given paths when using mm/mmm To speed up mm/mmm start time. At the same time, we should copy over the other clean steps. (cherry-pick of 6ea58cb3dc564ce112b28f1a7c6936317168d931.) Bug: 7186768 Change-Id: I158b0d7e4ecaa773ec3a336cd326e27ee8c26a88 --- core/cleanbuild.mk | 4 ++++ core/cleanspec.mk | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/core/cleanbuild.mk b/core/cleanbuild.mk index e6db5cbb3..1b662b982 100644 --- a/core/cleanbuild.mk +++ b/core/cleanbuild.mk @@ -78,6 +78,10 @@ else $(info Clean step: $(INTERNAL_CLEAN_STEP.$(step))) \ $(shell $(INTERNAL_CLEAN_STEP.$(step))) \ ) + # If we are running mm/mmm, we should copy over the other clean steps too. + ifneq ($(ONE_SHOT_MAKEFILE),) + INTERNAL_CLEAN_STEPS := $(strip $(CURRENT_CLEAN_STEPS) $(steps)) + endif steps := endif CURRENT_CLEAN_BUILD_VERSION := diff --git a/core/cleanspec.mk b/core/cleanspec.mk index d4a8eed27..a3eb7cd1a 100644 --- a/core/cleanspec.mk +++ b/core/cleanspec.mk @@ -63,7 +63,13 @@ INTERNAL_CLEAN_BUILD_VERSION := 6 # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST # ************************************************ +ifneq ($(ONE_SHOT_MAKEFILE),) +cs_subdirs := $(dir $(ONE_SHOT_MAKEFILE)) +else +cs_subdirs := . +endif subdir_cleanspecs := \ - $(shell build/tools/findleaves.py --prune=out --prune=.repo --prune=.git . CleanSpec.mk) + $(shell build/tools/findleaves.py --prune=out --prune=.repo --prune=.git $(cs_subdirs) CleanSpec.mk) include $(subdir_cleanspecs) +cs_subdirs := subdir_cleanspecs := -- 2.11.0