Allow disabling of CleanSpec functionality
This is only intended for testing purposes -- so that we can run build
system tests and verify that kati only gets run once for each
configuration. CleanSpecs necessarily write state that require us to
re-run kati twice.
Test: export NO_ANDROID_CLEANSPEC=true; rm -rf out; m -j; m -j
Change-Id: I635a8d8b6754dff82fbc7f20c500d06d7cf6c4f2
diff --git a/core/cleanbuild.mk b/core/cleanbuild.mk
index fa89758..3a90933 100644
--- a/core/cleanbuild.mk
+++ b/core/cleanbuild.mk
@@ -14,7 +14,7 @@
#
# Don't bother with the cleanspecs if you are running mm/mmm
-ifeq ($(ONE_SHOT_MAKEFILE)$(dont_bother),)
+ifeq ($(ONE_SHOT_MAKEFILE)$(dont_bother)$(NO_ANDROID_CLEANSPEC),)
INTERNAL_CLEAN_STEPS :=
@@ -142,7 +142,7 @@
INTERNAL_CLEAN_STEPS :=
INTERNAL_CLEAN_BUILD_VERSION :=
-endif # if not ONE_SHOT_MAKEFILE dont_bother
+endif # if not ONE_SHOT_MAKEFILE dont_bother NO_ANDROID_CLEANSPEC
# Since products and build variants (unfortunately) share the same
# PRODUCT_OUT staging directory, things can get out of sync if different