All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-trace-devel@vger.kernel.org
Cc: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Subject: [PATCH 5/9] libtracefs: Have make clean output cleaner
Date: Thu, 16 Dec 2021 19:42:10 -0500	[thread overview]
Message-ID: <20211217004214.16074-6-rostedt@goodmis.org> (raw)
In-Reply-To: <20211217004214.16074-1-rostedt@goodmis.org>

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

Instead of showing the files being removed by make clean, just output a
command stating what directory the clean is happening in.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 Makefile         | 13 +++++++------
 samples/Makefile |  2 +-
 scripts/utils.mk |  8 ++++++++
 src/Makefile     |  2 +-
 utest/Makefile   |  2 +-
 5 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index 7ef85288abf1..58b4219e7b62 100644
--- a/Makefile
+++ b/Makefile
@@ -365,11 +365,12 @@ samples: $(LIBTRACEFS_STATIC) force
 	$(Q)$(call descend,$(src)/samples,all)
 
 clean:
-	$(MAKE) -C $(src)/utest clean
-	$(MAKE) -C $(src)/src clean
-	$(MAKE) -C $(src)/samples clean
-	$(RM) $(TARGETS) $(bdir)/*.a $(bdir)/*.so $(bdir)/*.so.* $(bdir)/*.o $(bdir)/.*.d
-	$(RM) $(PKG_CONFIG_FILE)
-	$(RM) $(VERSION_FILE)
+	$(Q)$(MAKE) -C $(src)/utest clean
+	$(Q)$(MAKE) -C $(src)/src clean
+	$(Q)$(MAKE) -C $(src)/samples clean
+	$(Q)$(call do_clean, \
+	  $(TARGETS) $(bdir)/*.a $(bdir)/*.so $(bdir)/*.so.* $(bdir)/*.o $(bdir)/.*.d \
+	  $(PKG_CONFIG_FILE) \
+	  $(VERSION_FILE))
 
 .PHONY: clean
diff --git a/samples/Makefile b/samples/Makefile
index 2d0d2397c5b4..8e2b53bbdfae 100644
--- a/samples/Makefile
+++ b/samples/Makefile
@@ -66,4 +66,4 @@ $(EXAMPLES): $(patsubst %,$(bdir)/%,$(TARGETS))
 	$(CC) -g -Wall $(CFLAGS) -c -o $@ $^ -I../include/ $(LIBTRACEEVENT_INCLUDES)
 
 clean:
-	$(RM) $(bdir)/*
+	$(Q)$(call do_clean,$(bdir)/*)
diff --git a/scripts/utils.mk b/scripts/utils.mk
index 404b929a2b5f..c9b908f1c5d9 100644
--- a/scripts/utils.mk
+++ b/scripts/utils.mk
@@ -2,9 +2,11 @@
 
 # Utils
 
+ PWD		:= $(shell /bin/pwd)
  GOBJ		= $(notdir $(strip $@))
  BASE1		= $(notdir $(strip $1))
  BASE2		= $(notdir $(strip $2))
+ BASEPWD	= $(notdir $(strip $(PWD)))
 
 
 ifeq ($(VERBOSE),1)
@@ -27,6 +29,7 @@ ifeq ($(findstring 1,$(SILENT)$(VERBOSE)),1)
   print_uninstall =
   print_update =
   print_descend =
+  print_clean =
 else
   print_compile =		echo '  COMPILE            '$(GOBJ);
   print_app_build =		echo '  BUILD              '$(GOBJ);
@@ -39,6 +42,7 @@ else
   print_uninstall =		echo '  UNINSTALL     $(DESTDIR_SQ)$1';
   print_update =		echo '  UPDATE             '$(GOBJ);
   print_descend =		echo '  DESCEND            '$(BASE1) $(BASE2);
+  print_clean =			echo '  CLEAN              '$(BASEPWD);
 endif
 
 do_fpic_compile =					\
@@ -78,6 +82,10 @@ do_python_plugin_build =			\
 	($(print_plugin_build)			\
 	$(CC) $< -shared $(LDFLAGS) $(PYTHON_LDFLAGS) -o $@)
 
+do_clean =					\
+	($(print_clean)				\
+	$(RM) $1)
+
 ifneq ($(findstring $(MAKEFLAGS), w),w)
 PRINT_DIR = --no-print-directory
 else
diff --git a/src/Makefile b/src/Makefile
index cda0a0cda6e3..8f258a218f97 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -61,7 +61,7 @@ $(OBJS): | $(bdir)
 $(DEPS): | $(bdir)
 
 clean:
-	$(RM) $(OBJS)
+	$(Q)$(call do_clean,$(OBJS))
 
 dep_includes := $(wildcard $(DEPS))
 
diff --git a/utest/Makefile b/utest/Makefile
index 48993650660c..d168b01a328c 100644
--- a/utest/Makefile
+++ b/utest/Makefile
@@ -40,4 +40,4 @@ dep_includes := $(wildcard $(DEPS))
 test: $(TARGETS)
 
 clean:
-	$(RM) $(TARGETS) $(bdir)/*.o $(bdir)/.*.d
+	$(Q)$(call do_clean,$(TARGETS) $(bdir)/*.o $(bdir)/.*.d)
-- 
2.33.0


  parent reply	other threads:[~2021-12-17  0:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17  0:42 [PATCH 0/9] libtracefs: Updates to the Makefile Steven Rostedt
2021-12-17  0:42 ` [PATCH 1/9] libtracefs: Remove unused "bindir" from Makefile Steven Rostedt
2021-12-17  0:42 ` [PATCH 2/9] libtracefs: Remove unneeded blkflags " Steven Rostedt
2021-12-17  0:42 ` [PATCH 3/9] libtracefs: Fix sample intermediate build targets Steven Rostedt
2021-12-17  0:42 ` [PATCH 4/9] libtracefs: Add "DESCEND" output when descending into directories during build Steven Rostedt
2021-12-17  0:42 ` Steven Rostedt [this message]
2021-12-17  0:42 ` [PATCH 6/9] libtracefs: Quiet mv: cannot stat message for libtracefs.a Steven Rostedt
2021-12-17  0:42 ` [PATCH 7/9] libtracefs: Quiet "Nothing to be done for" messages Steven Rostedt
2021-12-17  0:42 ` [PATCH 8/9] libtracefs: Have sample build look cleaner Steven Rostedt
2021-12-17  0:42 ` [PATCH 9/9] libtracefs: Have make tags and TAGS honor O= build directory Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211217004214.16074-6-rostedt@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.