From: Ying Wang Date: Tue, 4 Aug 2015 19:11:54 +0000 (-0700) Subject: Fix writing clean_steps.mk in the first build. X-Git-Tag: android-x86-7.1-r1~608^2~19^2~147^2~106^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=eadaa954ceadcf44fa7cc2b1327f786defa29c35;p=android-x86%2Fbuild.git Fix writing clean_steps.mk in the first build. Change-Id: Ieddc799f38e5d1522e329e8300bd9f49c26c70ae --- diff --git a/core/cleanbuild.mk b/core/cleanbuild.mk index c2386a423..788564471 100644 --- a/core/cleanbuild.mk +++ b/core/cleanbuild.mk @@ -54,6 +54,7 @@ endef # can have permission to touch it. include $(BUILD_SYSTEM)/cleanspec.mk INTERNAL_CLEAN_BUILD_VERSION := $(strip $(INTERNAL_CLEAN_BUILD_VERSION)) +INTERNAL_CLEAN_STEPS := $(strip $(INTERNAL_CLEAN_STEPS)) # If the clean_steps.mk file is missing (usually after a clean build) # then we won't do anything. @@ -108,7 +109,15 @@ endif # Write the new state to the file. # +rewrite_clean_steps_file := ifneq ($(CURRENT_CLEAN_BUILD_VERSION)-$(CURRENT_CLEAN_STEPS),$(INTERNAL_CLEAN_BUILD_VERSION)-$(INTERNAL_CLEAN_STEPS)) +rewrite_clean_steps_file := true +endif +ifeq ($(wildcard $(clean_steps_file)),) +# This is the first build. +rewrite_clean_steps_file := true +endif +ifeq ($(rewrite_clean_steps_file),true) $(shell \ mkdir -p $(dir $(clean_steps_file)) && \ echo "CURRENT_CLEAN_BUILD_VERSION := $(INTERNAL_CLEAN_BUILD_VERSION)" > \ @@ -121,6 +130,7 @@ endif CURRENT_CLEAN_BUILD_VERSION := CURRENT_CLEAN_STEPS := clean_steps_file := +rewrite_clean_steps_file := INTERNAL_CLEAN_STEPS := INTERNAL_CLEAN_BUILD_VERSION :=