From da7d25f2d1f21875e64fd2096199f00f20856351 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Thu, 15 Sep 2016 22:03:04 -0700 Subject: [PATCH] Remove objclean We don't need to manually remove objects when switching SANITIZE_TARGET -- that will be handled by Ninja noticing that the command lines are different. Bug: 30947985 Test: None Change-Id: I83c15981cf6ea258bb7fa85490b0b1ede1058aa6 --- core/cleanbuild.mk | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/core/cleanbuild.mk b/core/cleanbuild.mk index de6a5ebfd..e3e039e56 100644 --- a/core/cleanbuild.mk +++ b/core/cleanbuild.mk @@ -154,21 +154,14 @@ previous_build_config_file := $(PRODUCT_OUT)/previous_build_config.mk current_build_config := \ $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT) -current_sanitize_target := $(strip $(SANITIZE_TARGET)) -ifeq (,$(current_sanitize_target)) - current_sanitize_target := false -endif force_installclean := false -force_objclean := false # Read the current state from the file, if present. # Will set PREVIOUS_BUILD_CONFIG. # PREVIOUS_BUILD_CONFIG := -PREVIOUS_SANITIZE_TARGET := -include $(previous_build_config_file) PREVIOUS_BUILD_CONFIG := $(strip $(PREVIOUS_BUILD_CONFIG)) -PREVIOUS_SANITIZE_TARGET := $(strip $(PREVIOUS_SANITIZE_TARGET)) ifdef PREVIOUS_BUILD_CONFIG ifneq "$(current_build_config)" "$(PREVIOUS_BUILD_CONFIG)" @@ -181,26 +174,16 @@ ifdef PREVIOUS_BUILD_CONFIG endif endif # else, this is the first build, so no need to clean. -ifdef PREVIOUS_SANITIZE_TARGET - ifneq "$(current_sanitize_target)" "$(PREVIOUS_SANITIZE_TARGET)" - $(info *** SANITIZE_TARGET changed: "$(PREVIOUS_SANITIZE_TARGET)" -> "$(current_sanitize_target)") - force_objclean := true - endif -endif # else, this is the first build, so no need to clean. - # Write the new state to the file. # ifneq ($(PREVIOUS_BUILD_CONFIG)-$(PREVIOUS_SANITIZE_TARGET),$(current_build_config)-$(current_sanitize_target)) $(shell \ mkdir -p $(dir $(previous_build_config_file)) && \ echo "PREVIOUS_BUILD_CONFIG := $(current_build_config)" > \ - $(previous_build_config_file) && \ - echo "PREVIOUS_SANITIZE_TARGET := $(current_sanitize_target)" >> \ $(previous_build_config_file) \ ) endif PREVIOUS_BUILD_CONFIG := -PREVIOUS_SANITIZE_TARGET := previous_build_config_file := current_build_config := @@ -248,12 +231,6 @@ dataclean_files := \ $(PRODUCT_OUT)/data-qemu/* \ $(PRODUCT_OUT)/userdata-qemu.img -# The files/dirs to delete during an objclean, which removes any files -# in the staging and emulator data partitions. -objclean_files := \ - $(TARGET_OUT_INTERMEDIATES) \ - $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_INTERMEDIATES) - # make sure *_OUT is set so that we won't result in deleting random parts # of the filesystem. ifneq (2,$(words $(HOST_OUT) $(PRODUCT_OUT))) @@ -273,12 +250,6 @@ installclean: dataclean $(hide) rm -rf $(FILES) @echo "Deleted images and staging directories." -.PHONY: objclean -objclean: FILES := $(objclean_files) -objclean: - $(hide) rm -rf $(FILES) - @echo "Deleted images and staging directories." - ifeq "$(force_installclean)" "true" $(info *** Forcing "make installclean"...) $(info *** rm -rf $(dataclean_files) $(installclean_files)) @@ -287,14 +258,6 @@ ifeq "$(force_installclean)" "true" endif force_installclean := -ifeq "$(force_objclean)" "true" - $(info *** Forcing cleanup of intermediate files...) - $(info *** rm -rf $(objclean_files)) - $(shell rm -rf $(objclean_files)) - $(info *** Done with the cleaning, now starting the real build.) -endif -force_objclean := - ########################################################### .PHONY: clean-jack-files