summaryrefslogtreecommitdiff
path: root/rootdir/Android.mk
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2014-06-14 09:11:02 -0700
committerYing Wang <wangying@google.com>2014-06-14 09:11:58 -0700
commit7011a85606bfdeefbd5f8db668c69b61e8d612a5 (patch)
tree31ab179562734cb49c84cf5a47208ae79f846d47 /rootdir/Android.mk
parente5fdfcdcb462195b1a91d5408c0ac738a0a55888 (diff)
Regenerate init.environ.rc if PRODUCT_BOOTCLASSPATH changed.
Change-Id: I4686c1239aa5ed361c918ce4e7a5abf9a1552ab4
Diffstat (limited to 'rootdir/Android.mk')
-rw-r--r--rootdir/Android.mk10
1 files changed, 9 insertions, 1 deletions
diff --git a/rootdir/Android.mk b/rootdir/Android.mk
index 2c1608442..aca08bfdf 100644
--- a/rootdir/Android.mk
+++ b/rootdir/Android.mk
@@ -30,9 +30,17 @@ LOCAL_POST_INSTALL_CMD := mkdir -p $(addprefix $(TARGET_ROOT_OUT)/, \
include $(BUILD_SYSTEM)/base_rules.mk
-$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/init.environ.rc.in
+# Regenerate init.environ.rc if PRODUCT_BOOTCLASSPATH has changed.
+bcp_md5 := $(word 1, $(shell echo $(PRODUCT_BOOTCLASSPATH) | $(MD5SUM)))
+bcp_dep := $(intermediates)/$(bcp_md5).bcp.dep
+$(bcp_dep) :
+ $(hide) mkdir -p $(dir $@) && rm -rf $(dir $@)*.bcp.dep && touch $@
+
+$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/init.environ.rc.in $(bcp_dep)
@echo "Generate: $< -> $@"
@mkdir -p $(dir $@)
$(hide) sed -e 's?%BOOTCLASSPATH%?$(PRODUCT_BOOTCLASSPATH)?g' $< >$@
+bcp_md5 :=
+bcp_dep :=
#######################################