8172037: Change log message of SetupCopyFiles
authorerikj
Mon, 09 Jan 2017 11:55:37 +0100
changeset 42983 7bf4468cdbc4
parent 42982 6b8e24d9bb32
child 42986 96b41be400b1
8172037: Change log message of SetupCopyFiles Reviewed-by: tbell
make/CopyImportModules.gmk
make/ModuleWrapper.gmk
make/common/MakeBase.gmk
--- a/make/CopyImportModules.gmk	Thu Jan 05 19:46:24 2017 +0000
+++ b/make/CopyImportModules.gmk	Mon Jan 09 11:55:37 2017 +0100
@@ -67,14 +67,17 @@
     # or risk invalidating the build output from external changes.
     ifeq ($(filter $(OUTPUT_ROOT)/%, $(LIBS_DIR)), )
       LINK_MACRO := install-file
+      LOG_ACTION := Copying
     else
       LINK_MACRO := link-file-relative
+      LOG_ACTION := Creating symlink
     endif
     $(eval $(call SetupCopyFiles, LINK_LIBS, \
         SRC := $(LIBS_DIR), \
         DEST := $(JDK_OUTPUTDIR)/lib, \
         FILES := $(filter-out %$(SHARED_LIBRARY_SUFFIX), $(call CacheFind, $(LIBS_DIR))), \
         MACRO := $(LINK_MACRO), \
+        LOG_ACTION := $(LOG_ACTION), \
     ))
     TARGETS += $(COPY_LIBS) $(LINK_LIBS)
   endif
--- a/make/ModuleWrapper.gmk	Thu Jan 05 19:46:24 2017 +0000
+++ b/make/ModuleWrapper.gmk	Mon Jan 09 11:55:37 2017 +0100
@@ -76,6 +76,7 @@
           $(filter $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)/%, \
           $(TARGETS))), \
       MACRO := link-file-relative, \
+      LOG_ACTION := Creating symlink, \
   ))
 endif
 
--- a/make/common/MakeBase.gmk	Thu Jan 05 19:46:24 2017 +0000
+++ b/make/common/MakeBase.gmk	Mon Jan 09 11:55:37 2017 +0100
@@ -694,8 +694,9 @@
   # 2 : Dest file
   # 3 : Variable to add targets to
   # 4 : Macro to call for copy operation
+  # 5 : Action text to log
   $2: $1
-	$$(call LogInfo, Copying $$(patsubst $(OUTPUT_ROOT)/%,%,$$@))
+	$$(call LogInfo, $(strip $5) $$(patsubst $(OUTPUT_ROOT)/%,%,$$@))
 	$$($$(strip $4))
 
   $3 += $2
@@ -721,6 +722,7 @@
 #             Default is 'install-file'
 #   NAME_MACRO : Optionally supply a macro that rewrites the target file name
 #                based on the source file name
+#   LOG_ACTION : Optionally specify a different action text for log messages
 SetupCopyFiles = $(NamedParamsMacroTemplate)
 define SetupCopyFilesBody
 
@@ -737,6 +739,10 @@
     $1_NAME_MACRO := identity
   endif
 
+  ifeq ($$($1_LOG_ACTION), )
+    $1_LOG_ACTION := Copying
+  endif
+
   # Remove any trailing slash from SRC and DEST
   $1_SRC := $$(patsubst %/,%,$$($1_SRC))
   $1_DEST := $$(patsubst %/,%,$$($1_DEST))
@@ -744,7 +750,7 @@
   $$(foreach f, $$(patsubst $$($1_SRC)/%,%,$$($1_FILES)), \
       $$(eval $$(call AddFileToCopy, $$($1_SRC)/$$f, \
       $$($1_DEST)/$$(call $$(strip $$($1_NAME_MACRO)),$$(if $$($1_FLATTEN),$$(notdir $$f),$$f)), \
-      $1, $$($1_MACRO))))
+      $1, $$($1_MACRO), $$($1_LOG_ACTION))))
 
 endef