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
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 @@
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 $@