Use symlinks in the build graph for jni libs
Now that ninja uses lstat and can support installing arbitrary symlinks,
switch jni lib symlinks from LOCAL_POST_INSTALL_CMDS to real rules.
Bug: 128577186
Test: List of files under PRODUCT_OUT is the same before/after this change
Test: out/target/product/generic/.installable_files now includes the symlinks
Test: m installclean; m NfcNci -> symlinks installed with correct dest
Test: m NfcNci; m NfcNci -> ninja: no work to do
Change-Id: I078dca53ab3d93f74c36fa66d5577e6e3e0640d6
diff --git a/core/definitions.mk b/core/definitions.mk
index 20b8cf6..ff435e2 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -2628,17 +2628,15 @@
endef
# Define a rule to create a symlink to a file.
-# $(1): full path to source
+# $(1): any dependencies
# $(2): source (may be relative)
# $(3): full path to destination
define symlink-file
$(eval $(_symlink-file))
endef
-# Order-only dependency because make/ninja will follow the link when checking
-# the timestamp, so the file must exist
define _symlink-file
-$(3): | $(1)
+$(3): $(1)
@echo "Symlink: $$@ -> $(2)"
@mkdir -p $(dir $$@)
@rm -rf $$@