[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CVS version is not less verbose

From: Alexandre Duret-Lutz
Subject: Re: CVS version is not less verbose
Date: Fri, 25 Apr 2003 23:32:12 +0200
User-agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.2 (gnu/linux)

>>> "Akim" == Akim Demaille <address@hidden> writes:


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


 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)

address@hidden'echo' && for f in $$MAKEFLAGS; do \
  case "$$f" in *=*) ;; *s*) verb=: ;; esac; done

        $(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.

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

        $(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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]