Rewrite the clean steps for TARGET_2ND_ARCH.

Convert clean rules from TARGET_ARCH to TARGET_2ND_ARCH and vice versa.

Change-Id: I5711b38cd834272d26d78e5cf847e97f27139c5b
This commit is contained in:
Ying Wang 2014-06-18 12:07:48 -07:00
parent c426298280
commit f6268b8ed9
1 changed files with 22 additions and 0 deletions

View File

@ -81,6 +81,28 @@ else
$(info Clean step: $(INTERNAL_CLEAN_STEP.$(step))) \
$(shell $(INTERNAL_CLEAN_STEP.$(step))) \
)
# Rewrite the clean step for the second arch.
ifdef TARGET_2ND_ARCH
# $(1): the clean step cmd
# $(2): the prefix to search for
# $(3): the prefix to replace with
define -cs-rewrite-cleanstep
$(if $(filter $(2)/%,$(1)),\
$(eval _crs_new_cmd := $(patsubst $(2)/%,$(3)/%,$(1)))\
$(info Clean step: $(_crs_new_cmd))\
$(shell $(_crs_new_cmd)))
endef
$(foreach step,$(steps), \
$(call -cs-rewrite-cleanstep,$(INTERNAL_CLEAN_STEP.$(step)),$(TARGET_OUT_INTERMEDIATES),$($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_INTERMEDIATES))\
$(call -cs-rewrite-cleanstep,$(INTERNAL_CLEAN_STEP.$(step)),$(TARGET_OUT_SHARED_LIBRARIES),$($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_SHARED_LIBRARIES))\
$(call -cs-rewrite-cleanstep,$(INTERNAL_CLEAN_STEP.$(step)),$(TARGET_OUT_VENDOR_SHARED_LIBRARIES),$($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_SHARED_LIBRARIES))\
$(call -cs-rewrite-cleanstep,$(INTERNAL_CLEAN_STEP.$(step)),$($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_INTERMEDIATES),$(TARGET_OUT_INTERMEDIATES))\
$(call -cs-rewrite-cleanstep,$(INTERNAL_CLEAN_STEP.$(step)),$($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_SHARED_LIBRARIES),$(TARGET_OUT_SHARED_LIBRARIES))\
$(call -cs-rewrite-cleanstep,$(INTERNAL_CLEAN_STEP.$(step)),$($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_VENDOR_SHARED_LIBRARIES),$(TARGET_OUT_VENDOR_SHARED_LIBRARIES))\
)
endif
_crs_new_cmd :=
steps :=
endif
CURRENT_CLEAN_BUILD_VERSION :=