Create symlink as a side effect
Symlinks aren't supported directly in the build graph and thus they must
be side effects of some other action. The symlinks in the symbols
directory is now created as a side effect of building
out/target/product/<product>/obj/FAKE/com.android.runtime_intermediates/symlink.timestamp
file.
For more details, please refer to
https://android-review.googlesource.com/c/platform/art/+/930848/5/Android.mk#392
Bug: 120846816
Test: m dist with marlin (flattened) and blueline (non-flattened)
examine symbols.zip file and check that unstripped shared libraries are
found under /apex/com.android.runtime directory
Change-Id: I408eea6b91d4daf5e873c479fe5f0a2faf8a859e
diff --git a/Android.mk b/Android.mk
index 2d9604a..3d47b1b 100644
--- a/Android.mk
+++ b/Android.mk
@@ -391,9 +391,13 @@
runtime_apex_manifest_file := $(PRODUCT_OUT)/apex/$(TARGET_RUNTIME_APEX)/apex_manifest.json
endif
-$(runtime_apex_manifest_file): $(TARGET_OUT_UNSTRIPPED)/apex/com.android.runtime
-$(TARGET_OUT_UNSTRIPPED)/apex/com.android.runtime :
- $(hide) ln -sf $(TARGET_RUNTIME_APEX) $@
+runtime_apex_symlink_timestamp := $(call intermediates-dir-for,FAKE,com.android.runtime)/symlink.timestamp
+$(runtime_apex_manifest_file): $(runtime_apex_symlink_timestamp)
+$(runtime_apex_manifest_file): PRIVATE_LINK_NAME := $(TARGET_OUT_UNSTRIPPED)/apex/com.android.runtime
+$(runtime_apex_symlink_timestamp):
+ $(hide) mkdir -p $(dir $(PRIVATE_LINK_NAME))
+ $(hide) ln -sf $(TARGET_RUNTIME_APEX) $(PRIVATE_LINK_NAME)
+ $(hide) touch $@
runtime_apex_manifest_file :=