Normalize filepath comment for gen files in build.prop

build.prop contains a `# from $filepath` comment to log the origin of a
sysprop. This is useful to have, but causes the metadata of
vendor/build.prop to be different between make and soong built
partitions. This CL replaces the absolute filepath of generated files
with their filenames in the build.prop comment.

Bug: 382295862
Test: commented out notice files in build/make/core/Makefile
Test: lunch aosp_cf_x86_64_phone-trunk_staging-userdebug
Test: export BUILD_DATETIME=10
Test: verified that vendor.img built by make and soong have the same
sha

Change-Id: I48f28aae6f6c1d51dc37e9cd19865fe6eb7c8ea9
diff --git a/core/sysprop.mk b/core/sysprop.mk
index e5f1267..c532dd1 100644
--- a/core/sysprop.mk
+++ b/core/sysprop.mk
@@ -122,11 +122,19 @@
 ifneq ($(strip $(7)), true)
 	$(hide) $$(call generate-common-build-props,$(call to-lower,$(strip $(1))),$$@)
 endif
+        # Make and Soong use different intermediate files to build vendor/build.prop.
+        # Although the sysprop contents are same, the absolute paths of android_info.prop are different.
+        # Print the filename for the intermediate files (files in OUT_DIR).
+        # This helps with validating mk->soong migration of android partitions.
 	$(hide) $(foreach file,$(strip $(3)),\
 	    if [ -f "$(file)" ]; then\
 	        echo "" >> $$@;\
 	        echo "####################################" >> $$@;\
-	        echo "# from $(file)" >> $$@;\
+	        $(if $(filter $(OUT_DIR)/%,$(file)), \
+		echo "# from $(notdir $(file))" >> $$@;\
+		,\
+		echo "# from $(file)" >> $$@;\
+		)\
 	        echo "####################################" >> $$@;\
 	        cat $(file) >> $$@;\
 	    fi;)