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 4/9] libtracefs: Add "DESCEND" output when descending into directories during build
Date: Thu, 16 Dec 2021 19:42:09 -0500	[thread overview]
Message-ID: <20211217004214.16074-5-rostedt@goodmis.org> (raw)
In-Reply-To: <20211217004214.16074-1-rostedt@goodmis.org>

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

Copy from the Linux kernel a "DESCEND" output when descending into a
directory during the build. This makes the output of the build a little
more informative knowing what directory the build is currently in.

Also add the target and not just the directory, as the build will descend
into the src directory twice with different targets, and just showing that
it goes into the src directory twice looks weird.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 Makefile         | 16 ++++++++--------
 scripts/utils.mk | 20 ++++++++++++++++++++
 2 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index 096f35d2c4a1..7ef85288abf1 100644
--- a/Makefile
+++ b/Makefile
@@ -182,7 +182,7 @@ test: force $(LIBTRACEFS_STATIC)
 ifneq ($(CUNIT_INSTALLED),1)
 	$(error CUnit framework not installed, cannot build unit tests))
 endif
-	$(Q)$(MAKE) -C $(src)/$(UTEST_DIR) $@
+	$(Q)$(call descend,$(src)/$(UTEST_DIR),$@)
 
 test_mem: test
 ifeq (, $(VALGRIND))
@@ -271,13 +271,13 @@ install_pkgconfig: $(PKG_CONFIG_FILE)
 		$(call do_install_pkgconfig_file,$(prefix))
 
 doc:
-	$(MAKE) -C $(src)/Documentation all
+	$(Q)$(call descend,$(src)/Documentation,all)
 
 doc_clean:
-	$(MAKE) -C $(src)/Documentation clean
+	$(Q)$(call descend,$(src)/Documentation,clean)
 
 install_doc:
-	$(MAKE) -C $(src)/Documentation install
+	$(Q)$(call descend,$(src)/Documentation,install)
 
 define build_uninstall_script
 	$(Q)mkdir $(BUILD_OUTPUT)/tmp_build
@@ -350,19 +350,19 @@ $(VERSION_FILE): force
 
 $(LIBTRACEFS_STATIC): force
 	$(Q)mkdir -p $(bdir)
-	$(Q)$(MAKE) -C $(src)/src $@
+	$(Q)$(call descend,$(src)/src,$@)
 
 $(bdir)/libtracefs.so.$(TRACEFS_VERSION): force
 	$(Q)mkdir -p $(bdir)
-	$(Q)$(MAKE) -C $(src)/src libtracefs.so
+	$(Q)$(call descend,$(src)/src,libtracefs.so)
 
 samples/sqlhist: $(LIBTRACEFS_STATIC)
-	$(Q)$(MAKE) -C $(src)/samples sqlhist
+	$(Q)$(call descend,$(src)/samples,sqlhist)
 
 sqlhist: samples/sqlhist
 
 samples: $(LIBTRACEFS_STATIC) force
-	$(Q)$(MAKE) -C $(src)/samples all
+	$(Q)$(call descend,$(src)/samples,all)
 
 clean:
 	$(MAKE) -C $(src)/utest clean
diff --git a/scripts/utils.mk b/scripts/utils.mk
index 0b3c0675b714..404b929a2b5f 100644
--- a/scripts/utils.mk
+++ b/scripts/utils.mk
@@ -3,6 +3,8 @@
 # Utils
 
  GOBJ		= $(notdir $(strip $@))
+ BASE1		= $(notdir $(strip $1))
+ BASE2		= $(notdir $(strip $2))
 
 
 ifeq ($(VERBOSE),1)
@@ -24,6 +26,7 @@ ifeq ($(findstring 1,$(SILENT)$(VERBOSE)),1)
   print_install =
   print_uninstall =
   print_update =
+  print_descend =
 else
   print_compile =		echo '  COMPILE            '$(GOBJ);
   print_app_build =		echo '  BUILD              '$(GOBJ);
@@ -35,6 +38,7 @@ else
   print_install =		echo '  INSTALL     '$1'	to	$(DESTDIR_SQ)$2';
   print_uninstall =		echo '  UNINSTALL     $(DESTDIR_SQ)$1';
   print_update =		echo '  UPDATE             '$(GOBJ);
+  print_descend =		echo '  DESCEND            '$(BASE1) $(BASE2);
 endif
 
 do_fpic_compile =					\
@@ -74,6 +78,22 @@ do_python_plugin_build =			\
 	($(print_plugin_build)			\
 	$(CC) $< -shared $(LDFLAGS) $(PYTHON_LDFLAGS) -o $@)
 
+ifneq ($(findstring $(MAKEFLAGS), w),w)
+PRINT_DIR = --no-print-directory
+else
+NO_SUBDIR = :
+endif
+
+#
+# Define a callable command for descending to a new directory
+#
+# Call by doing: $(call descend,directory[,target])
+#
+descend = \
+	($(print_descend)		\
+	$(MAKE) $(PRINT_DIR) -C $(1) $(2))
+
+
 define make_version.h
 	(echo '/* This file is automatically generated. Do not modify. */';		\
 	echo \#define VERSION_CODE $(shell						\
-- 
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 ` Steven Rostedt [this message]
2021-12-17  0:42 ` [PATCH 5/9] libtracefs: Have make clean output cleaner Steven Rostedt
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-5-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.