Subject: bug#19847: Print full subdirectory path in "Making ... in ..." messages

From: Karl Wette <[email-masked]>
Date: Thu, 12 Feb 2015 19:18:57 +0100

I would like to suggest a small improvement to the "Making ... in ..."
messages printed by recursive Automake. Instead of printing just the name
of the directory "make" is about to recurse into, I believe that it would
be more informative to print the full path of the directory relative to the
top level of the package.

As an illustration, suppose a package has the following directory structure:

./Makefile.am
./packages/apple/include/Makefile.am
./packages/apple/Makefile.am
./packages/apple/src/Makefile.am
./packages/banana/include/Makefile.am
./packages/banana/Makefile.am
./packages/banana/src/Makefile.am
./packages/carrot/include/Makefile.am
./packages/carrot/Makefile.am
./packages/carrot/src/Makefile.am
./packages/Makefile.am

Currently running "make -s" from the top level would print something like:

Making all in packages
Making all in apple
Making all in include
  CC       something...
Making all in src
  CC       something...
Making all in banana
Making all in include
  CC       something...
Making all in src
  CC       something...
Making all in carrot
Making all in include
  CC       something...
Making all in src
  CC       something...

which make it difficult to see which directory make is currently in. A more
informative output would be something like:

Making all in packages
Making all in packages/apple
Making all in packages/apple/include
  CC       something...
Making all in packages/apple/src
  CC       something...
Making all in packages/banana
Making all in packages/banana/include
  CC       something...
Making all in packages/banana/src
  CC       something...
Making all in packages/carrot
Making all in packages/carrot/include
  CC       something...
Making all in packages/carrot/src
  CC       something...

Of course, one can always run "make" without "-s" to get make's own
"Entering/Leaving directory ..." messages, but this is generally very
verbose. If Automake is going to print out its own recursion-related
messages, it would be useful it they were slightly more informative.

Also, I believe "make" on MacOSX doesn't print "Entering/Leaving directory
..." messages unless they are explicitly enabled with "-w". So this would
make the default output from running "make" on MacOSX a little more
informative.

A proposed patch against git commit 6357a63 in the Automake git repository
is attached.

Cheers, Karl
>From 5ed1c2fa9c949490e6126f4da31f67ed5e063084 Mon Sep 17 00:00:00 2001
From: Karl Wette <[email-masked]>
Date: Thu, 12 Feb 2015 18:48:29 +0100
Subject: [PATCH] Print full subdirectory path in "Making ... in ..." messages

---
 lib/am/subdirs.am | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/am/subdirs.am b/lib/am/subdirs.am
index cc00d58..50fe136 100644
--- a/lib/am/subdirs.am
+++ b/lib/am/subdirs.am
@@ -54,8 +54,13 @@ $(am__recursive_targets):
 	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
 	  *) list='$(SUBDIRS)' ;; \
 	esac; \
+	if test "$(subdir)" = "."; then \
+	  thisdir=""; \
+	else \
+	  thisdir="$(subdir)/"; \
+	fi; \
 	for subdir in $$list; do \
-	  echo "Making $$target in $$subdir"; \
+	  echo "Making $$target in $$thisdir$$subdir"; \
 	  if test "$$subdir" = "."; then \
 	    dot_seen=yes; \
 	    local_target="$$target-am"; \
-- 
1.9.1