This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: CVS version is not less verbose


>>> "Akim" == Akim Demaille <akim at epita dot fr> writes:

[...]

 Akim> I have no idea whether the following is portable.

[...]

 Akim> MAKE_VERBOSE = @
 Akim> all:
 Akim> $(MAKE_VERBOSE)echo toto

[...]

I've tried this successfully with GNU, *BSD, Solaris, HP-UX, and
OSF Make.  Although I can't see how this helps in this case,
that seems like an interesting idea to make debugging of quiet
rules easier.

Here William would like to get rid of the `echo'.  A similar
answer would be to use `$(ECHO)' instead of `echo', so that
people can run `make -s ECHO=:' to disable all output.
It's a bit clumsy, though.

Another idea would be that we automatically disable `echo'
when `-s' has been passed to make.

I've been toying with the following Makefile lately
(tested only with GNU, *BSD, and Solaris make only)

----------------------------------------
am__SETUP_VERB= at verb='echo' && for f in $$MAKEFLAGS; do \
  case "$$f" in *=*) ;; *s*) verb=: ;; esac; done

all:
	$(am__SETUP_VERB) && \
	: 'hidden command' && \
	$$verb : 'echoed command' && \
	: 'echoed command'
----------------------------------------

% make -s
% make
: echoed command

I also have a shell-function based implementation which allows
not to repeat verbose commands.

----------------------------------------
am__SETUP_VERB= at verb () { echo "$$@"; "$$@"; } && for f in $$MAKEFLAGS; \
  do case "$$f" in *=*) ;; *s*) verb () { "$$@"; } ;; esac; done

all:
	$(am__SETUP_VERB) && \
	: 'hidden command' && \
	verb : 'echoed command'
----------------------------------------

That sounds great from the user interface point of view since
`-s' is all you have to type, but it would be a bit
unsatisfactory to have to run $(am__SETUP_VERB) in *each*
compile rule.

Another idea would be to use `$(ECHO)' instead of `echo' as
suggested, and override it based on MAKEFLAGS (using code
similar to am__SETUP_VERB) when calling make recursively.  This
would require that we call make recursively even to process the
current directory.

Anyway, that might give ideas...
-- 
Alexandre Duret-Lutz




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]