diff mbox series

[1/2] trace-cmd: refactor print_update

Message ID 20191025063957.21558-1-gthelen@google.com (mailing list archive)
State Accepted
Commit 39e5b068a69d267a34386e03a1470f1fbb0514cd
Headers show
Series [1/2] trace-cmd: refactor print_update | expand

Commit Message

Greg Thelen Oct. 25, 2019, 6:39 a.m. UTC
Match utils.mk convention and use a conditional macro for printing
'UPDATE' messages.

Signed-off-by: Greg Thelen <gthelen@google.com>
---
 scripts/utils.mk | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Steven Rostedt Oct. 26, 2019, 3:46 p.m. UTC | #1
On Thu, 24 Oct 2019 23:39:56 -0700
Greg Thelen <gthelen@google.com> wrote:

> Match utils.mk convention and use a conditional macro for printing
> 'UPDATE' messages.
> 
> Signed-off-by: Greg Thelen <gthelen@google.com>
> ---
>  scripts/utils.mk | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>

Thanks Greg! I applied both patches.

-- Steve
diff mbox series

Patch

diff --git a/scripts/utils.mk b/scripts/utils.mk
index 98d7b3c726d8..8e4e4b5f3a4a 100644
--- a/scripts/utils.mk
+++ b/scripts/utils.mk
@@ -22,6 +22,7 @@  ifeq ($(VERBOSE),1)
   print_plugin_obj_compile =
   print_plugin_build =
   print_install =
+  print_update =
 else
   Q = @
   S = -s
@@ -33,6 +34,7 @@  else
   print_plugin_build =		echo '  $(GUI)BUILD PLUGIN       '$(GOBJ);
   print_static_lib_build =	echo '  $(GUI)BUILD STATIC LIB   '$(GOBJ);
   print_install =		echo '  $(GUI)INSTALL     '$(GSPACE)$1'	to	$(DESTDIR_SQ)$2';
+  print_update =		echo '  $(GUI)UPDATE             '$(GOBJ);
 endif
 
 do_fpic_compile =					\
@@ -96,7 +98,7 @@  define update_version.h
 	if [ -r $@ ] && cmp -s $@ $@.tmp; then				\
 		rm -f $@.tmp;						\
 	else								\
-		echo '  UPDATE                 '$(notdir $(strip $@));	\
+		$(print_update)						\
 		mv -f $@.tmp $@;					\
 	fi);
 endef
@@ -106,7 +108,7 @@  define update_dir
 	if [ -r $@ ] && cmp -s $@ $@.tmp; then				\
 		rm -f $@.tmp;						\
 	else								\
-		echo '  UPDATE                 '$(notdir $(strip $@));	\
+		$(print_update)						\
 		mv -f $@.tmp $@;					\
 	fi);
 endef