summaryrefslogtreecommitdiffstats
path: root/core/executable_prefer_symlink.mk
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2015-02-26 18:47:21 -0800
committerYing Wang <wangying@google.com>2015-02-26 18:47:21 -0800
commite25b3984ff5c74aa2a49d14b7df7aa9527096c32 (patch)
treef291e33696b6dbd110b9c1eca922c8ba33b84161 /core/executable_prefer_symlink.mk
parent7a9e38840536b291688f4e3a0989acaa56af3191 (diff)
downloadbuild-e25b3984ff5c74aa2a49d14b7df7aa9527096c32.zip
build-e25b3984ff5c74aa2a49d14b7df7aa9527096c32.tar.gz
build-e25b3984ff5c74aa2a49d14b7df7aa9527096c32.tar.bz2
Improved nothing-to-do-build
- Removed unnecessary dependency of "$(my_symlink) : $(LOCAL_INSTALLED_MODULE)" We can generate symlink to nonexistent file. Actually in multilib build $(LOCAL_INSTALLED_MODULE) points to file that may not be the target file of the symlink and leads to always obsolete $(my_symlink) in the above dependnecy. - Touch by-product in the dummy rule, to make sure the by-product is newer than the main-product. Change-Id: I2f0e0cc197c49f920fa1f6794083b21cdc333c20
Diffstat (limited to 'core/executable_prefer_symlink.mk')
-rw-r--r--core/executable_prefer_symlink.mk5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/executable_prefer_symlink.mk b/core/executable_prefer_symlink.mk
index 2326e83..fc97ad3 100644
--- a/core/executable_prefer_symlink.mk
+++ b/core/executable_prefer_symlink.mk
@@ -39,7 +39,10 @@ $(my_symlink): PRIVATE_SRC_BINARY_NAME := $(LOCAL_MODULE_STEM_32)
endif
endif
-$(my_symlink): $(LOCAL_INSTALLED_MODULE) $(LOCAL_MODULE_MAKEFILE)
+# $(my_symlink) doesn't need to depend on $(PRIVATE_SRC_BINARY_NAME): we can generate symlink to nonexistent file.
+# If you add the dependency, make would compare the timestamp of a file against that of its symlink:
+# they are always equal, because make follows symlink.
+$(my_symlink): $(LOCAL_MODULE_MAKEFILE)
@echo "Symlink: $@ -> $(PRIVATE_SRC_BINARY_NAME)"
@mkdir -p $(dir $@)
@rm -rf $@