Re: Confusing message when make starts in current directory

2021-12-15 Thread Paul Smith
On Wed, 2021-12-15 at 17:59 +0100, Andrea Monaco wrote:
> In my opinion, those messages should always come with a chdir.

Well, make can't know whether the previous make started in the same
directory or not, at least not reliably.

If you do something like the very common, and POSIX-compatible:

   subdir:
   cd subdir && $(MAKE)

rather than the GNU make-specific "$(MAKE) -C subdir", then it's not
make doing the chdir, the shell does it before make is ever invoked.

I guess make could provide its current directory to its child make in
some kind of environment variable, then the child make could compare it
and omit the message if they were the same.

But that seems like a lot of work for a relatively cosmetic issue.

Also, it would mean that the recursive counter would have holes; that
is it might go from "make[1]" to "make[4]" if the 2 and 3 recursions
were in the same directory.  I don't know why that would be an issue
but could be...

Cheers!




Confusing message when make starts in current directory

2021-12-15 Thread Andrea Monaco


Hello!


I noticed that when invoking make in the current directory, say
"/home/john/foo", it often starts with the message

  make[1]: Entering directory '/home/john/foo'

and ends with

  make[1]: Leaving directory '/home/john/foo'


A message like that is correct and useful when make descends in
subdirectories, but I find it a bit confusing when the directory make
starts from (or ends with) is the current one; you don't enter a
directory you are already in, and you don't leave it if the program
completes there.

In my opinion, those messages should always come with a chdir.



Thanks,

Andrea Monaco