From 45c0c2c9ac5402b629c17fb0e3495b4ce994158a Mon Sep 17 00:00:00 2001 From: Jeongik Cha Date: Thu, 27 Apr 2023 11:04:30 +0900 Subject: [PATCH] Introduce dist-for-goals-with-filenametag this function append FILE_NAME_TAG_PLACEHOLDER at the end of file name, and call dist-for-goals Bug: 278060169 Test: m dist Change-Id: I35a48ad722cc266cadb4ed0910820589927fcef1 --- core/distdir.mk | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/core/distdir.mk b/core/distdir.mk index bce8e7fd3c..032d1b7ca9 100644 --- a/core/distdir.mk +++ b/core/distdir.mk @@ -45,6 +45,18 @@ $(foreach file,$(2), \ $(eval _all_dist_goal_output_pairs += $$(goal):$$(dst)))) endef +define add_file_name_tag_suffix +$(basename $(notdir $1))-FILE_NAME_TAG_PLACEHOLDER$(suffix $1) +endef + +# This function appends suffix FILE_NAME_TAG_PLACEHOLDER from the input file +# $(1): a list of goals (e.g. droid, sdk, ndk). These must be PHONY +# $(2): the dist files to add to those goals. +define dist-for-goals-with-filenametag +$(if $(strip $(2)), \ + $(foreach file,$(2), \ + $(call dist-for-goals,$(1),$(file):$(call add_file_name_tag_suffix,$(file))))) +endef .PHONY: shareprojects define __share-projects-rule @@ -209,4 +221,4 @@ $(strip \ fi)) endef -.KATI_READONLY := dist-for-goals dist-write-file +.KATI_READONLY := dist-for-goals dist-write-file dist-for-goals-with-filenametag