OSDN Git Service

Merge change I6d9c9295
[android-x86/build.git] / core / cleanbuild.mk
index 0b292bf..a753554 100644 (file)
@@ -104,8 +104,14 @@ else
   # Don't bother with this extra part when explicitly building the sdk product.
   building_sdk :=
 endif
-current_build_config := $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT)$(building_sdk)
+
+# A change in the list of locales warrants an installclean, too.
+locale_list := $(subst $(space),$(comma),$(strip $(PRODUCT_LOCALES)))
+
+current_build_config := \
+    $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT)$(building_sdk)-{$(locale_list)}
 building_sdk :=
+locale_list :=
 force_installclean := false
 
 # Read the current state from the file, if present.
@@ -117,7 +123,11 @@ PREVIOUS_BUILD_CONFIG := $(strip $(PREVIOUS_BUILD_CONFIG))
 ifdef PREVIOUS_BUILD_CONFIG
   ifneq "$(current_build_config)" "$(PREVIOUS_BUILD_CONFIG)"
     $(info *** Build configuration changed: "$(PREVIOUS_BUILD_CONFIG)" -> "$(current_build_config)")
-    force_installclean := true
+    ifneq ($(DISABLE_AUTO_INSTALLCLEAN),true)
+      force_installclean := true
+    else
+      $(info DISABLE_AUTO_INSTALLCLEAN is set; skipping auto-clean. Your tree may be in an inconsistent state.)
+    endif
   endif
 endif  # else, this is the first build, so no need to clean.
 PREVIOUS_BUILD_CONFIG :=
@@ -159,11 +169,13 @@ installclean_files := \
        ./$(PRODUCT_OUT)/*.xlb \
        ./$(PRODUCT_OUT)/*.zip \
        ./$(PRODUCT_OUT)/data \
+       ./$(PRODUCT_OUT)/obj/lib \
        ./$(PRODUCT_OUT)/obj/APPS \
        ./$(PRODUCT_OUT)/obj/NOTICE_FILES \
        ./$(PRODUCT_OUT)/obj/PACKAGING \
        ./$(PRODUCT_OUT)/recovery \
        ./$(PRODUCT_OUT)/root \
+       ./$(PRODUCT_OUT)/symbols/system/lib \
        ./$(PRODUCT_OUT)/system
 
 # The files/dirs to delete during a dataclean, which removes any files