diff options
| author | 2016-09-17 02:29:06 +0000 | |
|---|---|---|
| committer | 2016-09-17 02:29:06 +0000 | |
| commit | 2fcacb5a226b17cd26f61a3ee3becebe3f4eacab (patch) | |
| tree | b5dd6f34649de1f60f95ac4d8f37a3bbfef7ff64 | |
| parent | 1d4b79dde2f97bb5b0e6b1156295fa9cbbc166e1 (diff) | |
| parent | 2cfbdf460d90b781bb9ceff84bc8e9567c22836e (diff) | |
Merge "Only update previous product config when changed"
| -rw-r--r-- | core/cleanbuild.mk | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/core/cleanbuild.mk b/core/cleanbuild.mk index e3e039e565..6a295852e4 100644 --- a/core/cleanbuild.mk +++ b/core/cleanbuild.mk @@ -151,6 +151,7 @@ endif # if not ONE_SHOT_MAKEFILE dont_bother # necessary to keep things consistent. previous_build_config_file := $(PRODUCT_OUT)/previous_build_config.mk +current_build_config_file := $(PRODUCT_OUT)/current_build_config.mk current_build_config := \ $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT) @@ -176,15 +177,17 @@ 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)) && \ + mkdir -p $(dir $(current_build_config_file)) && \ echo "PREVIOUS_BUILD_CONFIG := $(current_build_config)" > \ - $(previous_build_config_file) \ + $(current_build_config_file) \ ) -endif +$(shell cmp $(current_build_config_file) $(previous_build_config_file) > /dev/null 2>&1 || \ + mv -f $(current_build_config_file) $(previous_build_config_file)) + PREVIOUS_BUILD_CONFIG := previous_build_config_file := +current_build_config_file := current_build_config := # |