diff mbox series

[v2,14/15] libtracefs: Add clean descend

Message ID 20211217055041.19559-15-rostedt@goodmis.org (mailing list archive)
State Accepted
Commit 22bfdafb2aa5dcf9f401b8737cbb27e9066fef74
Headers show
Series libtracefs: Updates to the Makefile | expand

Commit Message

Steven Rostedt Dec. 17, 2021, 5:50 a.m. UTC
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

Have the output of cleaning a directory be a bit cleaner.
This actually breaks the clean, but because of the way samples works, to
fix that first will delete the Makefile of samples.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 Makefile         | 6 +++---
 scripts/utils.mk | 2 ++
 2 files changed, 5 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 6e18e0a015f5..cd7cf28a2acd 100644
--- a/Makefile
+++ b/Makefile
@@ -375,9 +375,9 @@  samples: libtracefs.a force
 	$(Q)$(call descend,$(src)/samples,all)
 
 clean:
-	$(Q)$(MAKE) -C $(src)/utest clean
-	$(Q)$(MAKE) -C $(src)/src clean
-	$(Q)$(MAKE) -C $(src)/samples clean
+	$(Q)$(call descend_clean,utest)
+	$(Q)$(call descend_clean,src)
+	$(Q)$(call descend_clean,samples)
 	$(Q)$(call do_clean, \
 	  $(TARGETS) $(bdir)/*.a $(bdir)/*.so $(bdir)/*.so.* $(bdir)/*.o $(bdir)/.*.d \
 	  $(PKG_CONFIG_FILE) \
diff --git a/scripts/utils.mk b/scripts/utils.mk
index 3bf59c550b1d..5f43de1385cd 100644
--- a/scripts/utils.mk
+++ b/scripts/utils.mk
@@ -123,6 +123,8 @@  descend = \
 	mkdir -p $(obj)/$(BASE1); \
 	$(MAKE) $(PRINT_DIR) bdir=$(obj)/$(BASE1) -C $(1) $(2))
 
+descend_clean = \
+	$(MAKE) $(PRINT_DIR) bdir=$(obj)/$(BASE1) -C $(1) clean
 
 define make_version.h
 	(echo '/* This file is automatically generated. Do not modify. */';		\