692 # Helper macro for SetupCopyFiles |
692 # Helper macro for SetupCopyFiles |
693 # 1 : Source file |
693 # 1 : Source file |
694 # 2 : Dest file |
694 # 2 : Dest file |
695 # 3 : Variable to add targets to |
695 # 3 : Variable to add targets to |
696 # 4 : Macro to call for copy operation |
696 # 4 : Macro to call for copy operation |
|
697 # 5 : Action text to log |
697 $2: $1 |
698 $2: $1 |
698 $$(call LogInfo, Copying $$(patsubst $(OUTPUT_ROOT)/%,%,$$@)) |
699 $$(call LogInfo, $(strip $5) $$(patsubst $(OUTPUT_ROOT)/%,%,$$@)) |
699 $$($$(strip $4)) |
700 $$($$(strip $4)) |
700 |
701 |
701 $3 += $2 |
702 $3 += $2 |
702 endef |
703 endef |
703 |
704 |
719 # FLATTEN : Set to flatten the directory structure in the DEST dir. |
720 # FLATTEN : Set to flatten the directory structure in the DEST dir. |
720 # MACRO : Optionally override the default macro used for making the copy. |
721 # MACRO : Optionally override the default macro used for making the copy. |
721 # Default is 'install-file' |
722 # Default is 'install-file' |
722 # NAME_MACRO : Optionally supply a macro that rewrites the target file name |
723 # NAME_MACRO : Optionally supply a macro that rewrites the target file name |
723 # based on the source file name |
724 # based on the source file name |
|
725 # LOG_ACTION : Optionally specify a different action text for log messages |
724 SetupCopyFiles = $(NamedParamsMacroTemplate) |
726 SetupCopyFiles = $(NamedParamsMacroTemplate) |
725 define SetupCopyFilesBody |
727 define SetupCopyFilesBody |
726 |
728 |
727 ifeq ($$($1_MACRO), ) |
729 ifeq ($$($1_MACRO), ) |
728 $1_MACRO := install-file |
730 $1_MACRO := install-file |
735 |
737 |
736 ifeq ($$($1_NAME_MACRO), ) |
738 ifeq ($$($1_NAME_MACRO), ) |
737 $1_NAME_MACRO := identity |
739 $1_NAME_MACRO := identity |
738 endif |
740 endif |
739 |
741 |
|
742 ifeq ($$($1_LOG_ACTION), ) |
|
743 $1_LOG_ACTION := Copying |
|
744 endif |
|
745 |
740 # Remove any trailing slash from SRC and DEST |
746 # Remove any trailing slash from SRC and DEST |
741 $1_SRC := $$(patsubst %/,%,$$($1_SRC)) |
747 $1_SRC := $$(patsubst %/,%,$$($1_SRC)) |
742 $1_DEST := $$(patsubst %/,%,$$($1_DEST)) |
748 $1_DEST := $$(patsubst %/,%,$$($1_DEST)) |
743 |
749 |
744 $$(foreach f, $$(patsubst $$($1_SRC)/%,%,$$($1_FILES)), \ |
750 $$(foreach f, $$(patsubst $$($1_SRC)/%,%,$$($1_FILES)), \ |
745 $$(eval $$(call AddFileToCopy, $$($1_SRC)/$$f, \ |
751 $$(eval $$(call AddFileToCopy, $$($1_SRC)/$$f, \ |
746 $$($1_DEST)/$$(call $$(strip $$($1_NAME_MACRO)),$$(if $$($1_FLATTEN),$$(notdir $$f),$$f)), \ |
752 $$($1_DEST)/$$(call $$(strip $$($1_NAME_MACRO)),$$(if $$($1_FLATTEN),$$(notdir $$f),$$f)), \ |
747 $1, $$($1_MACRO)))) |
753 $1, $$($1_MACRO), $$($1_LOG_ACTION)))) |
748 |
754 |
749 endef |
755 endef |
750 |
756 |
751 ################################################################################ |
757 ################################################################################ |
752 # ShellQuote |
758 # ShellQuote |