core/Makefile: Fix filenames with commas
Prior to this, any filenames with commas, for example device specific
nvrams or hcds compatible with the mainline kernel, would cause a build
failure because GNU make can't handle passing an argument with a comma
because comma is the delimiter.
To work around this pass the arguments via variables local to the rule.
Change-Id: I852b36d7194394389a63683fc8c68474f8323d9b
diff --git a/core/Makefile b/core/Makefile
index 81ae6f7..372eb05 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -3488,12 +3488,14 @@
# $(2): The partition's staging directory
# $(3): Files to include in the partition
define write-partition-file-list
+$(1): PRIVATE_FILES := $(subst $(2)/,,$(filter $(2)/%,$(3)))
+$(1): PRIVATE_EXTRA_INSTALL_ZIPS := $(call relevant-extra-install-zips,$(filter $(2)/%,$(3)))
$(1): $$(HOST_OUT_EXECUTABLES)/extra_install_zips_file_list $(foreach p,$(call relevant-extra-install-zips,$(filter $(2)/%,$(3))),$(call word-colon,3,$(p)))
@echo Writing $$@
rm -f $$@
echo -n > $$@
- $$(foreach f,$(subst $(2)/,,$(filter $(2)/%,$(3))),echo "$$(f)" >> $$@$$(newline))
- $$(HOST_OUT_EXECUTABLES)/extra_install_zips_file_list $(2) $(call relevant-extra-install-zips,$(filter $(2)/%,$(3))) >> $$@
+ $$(foreach f,$$(PRIVATE_FILES),echo "$$(f)" >> $$@$$(newline))
+ $$(HOST_OUT_EXECUTABLES)/extra_install_zips_file_list $(2) $$(PRIVATE_EXTRA_INSTALL_ZIPS) >> $$@
endef
# -----------------------------------------------------------------