libtool
[Top][All Lists]
Advanced

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

Re: make -s


From: Ralf Wildenhues
Subject: Re: make -s
Date: Sun, 13 Jan 2008 17:46:37 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

* Richard Hacker wrote on Fri, Jan 11, 2008 at 01:21:50PM CET:
> On Thursday 10 January 2008 21:30, Ralf Wildenhues wrote:
> > > > If you want all tools silenced which are called by make, then I suggest
> > > > to simply use
> > > >   make >/dev/null || make
> > >
> > > well, we're after the automatic output going away, not intended output.
> >
> > So what's intended output?  
> I think that the output should be similar to make -s. This is also not 
> completely quiet, compiler warnings and the like are shown. It just means 
> that the make commands should not be shown, whereas the output of the 
> commands are very well.

Note, with `make -s', the
  ./libtool --mode=compile ...

that come from make, are not shown, only what libtool itself generates is.

> This reduces much of the 'make noise' and reduces the 
> output to compiler warnings and errors. Quite honestly, I recently oversaw a 
> compiler warning due to noise because I was on the command line and not in an 
> editor.

Fair enough.

> > Should libtool parse their $TOOLFLAGS too?
> Good point. No not really. Why should the tools parse their caller's flags? 

So why then should libtool parse make's flags?  libtool and make (and
automake) are separate programs, and each can be used without the other.
libtool can also be called by smake, whatnot.

> Quite frankly, make should be the one that calls the various tools with their 
> respective --silent flag set, not the other way 'round, right?

OK, that sounds like cleaner design. (*)

> > If all you want is libtool to go silent globally in your package then
> > what about just
> >   AC_SUBST([AM_LIBTOOLFLAGS], [--silent])
> This is not the intention of the root of this discussion.

Fair enough.

> Just as well as 
> make >/dev/null 2>&1
> is also not the point. 

I don't think it ever came up in this discussion to throw away stderr.

> If libtool complains, it should show it, whether it be stdout or stderr, it 
> should all be shown. However, the ugly  ;)
> 'g++ -DHAVE_CONFIG_H -I. -I. -I. -Wall -g -O2 .....' 
> that libtool calls is not really essential to the programmer when (s)he calls 
> make -s. 

Fair enough.

> True, my editor should pick up these compiler warnings, but funnily enough, 
> my 
> vim allways ends up with a blank buffer after doing :make but not 
> with ':make -s' when I use my patch to silence libtool.

What's left in there?  Typically, vim has troubles throwing out what's
irrelevant if it doesn't see at least some compile commands it can get
at.

> So, here is my modest opinion. If I as a programmer call
> *) 'make' on its own, it should show its commands as well as their output
> *) 'make -s', it should not show the commands it calls, only the output of 
> these.

OK understood.

> However, libtool is responsible for parsing *make's *FLAGS

Now, this contradicts your statement (*) above, no?

If `make -s' were to influence libtool verbosity, there are several
choices to implement this:
- inside the libtool script, parse MAKEFLAGS
- automake hackery that puts necessary code in Makefile.in so that upon
  `make -s', libtool is called with --silent

The first choice is unclean in that a tools glimps at stuff that's not
its domain.  It also does not nicely extend to other build tools.

The second choice leaves users of make-without-automake in the cold, but
my assumption is that none of you care about it (of course they could
always copy that implementation).  It also carries the burden of larger
Makefiles, likely even more verbose output when `make' is issued without
`-s'.

The problem of implementing the required logic in a Makefile is that,
while it is quite cheap to do with GNU make, I only see ugly solutions
that work with portable make.  They either
- require the choice of silency to be made at configure time already,
- or generate even more output in the non-silent case,
- and/or bloat the resulting Makefile by more than just a small amount.

If someone sees a way to avoid these, I'd love to hear about it.

FWIW, here's a patch that goes the "ugly design" way of implementing
this in libtool, which I think is portable.

Cheers,
Ralf

2008-01-13  Ralf Wildenhues  <address@hidden>

        * libltdl/config/ltmain.m4sh: If MAKEFLAGS indicates that
        `make -s' has called us, be --silent by default.
        * doc/libtool.texi (Invoking libtool): Document it.
        * NEWS: Update.
        Suggested by Bob Rossi, Mike Frysinger and numerous others.

Index: NEWS
===================================================================
RCS file: /cvsroot/libtool/libtool/NEWS,v
retrieving revision 1.214
diff -u -r1.214 NEWS
--- NEWS        12 Jan 2008 17:00:51 -0000      1.214
+++ NEWS        13 Jan 2008 16:40:43 -0000
@@ -74,6 +74,7 @@
     libtool library files.  This variable takes flags that should be
     used by dependent libraries and programs, but that do not fit into
     `dependency_libs' for both clarity and backward-compatibility.
+  - `make -s' makes libtool go silent by default now.
 
 * Changes in supported systems or compilers:
 
Index: doc/libtool.texi
===================================================================
RCS file: /cvsroot/libtool/libtool/doc/libtool.texi,v
retrieving revision 1.234
diff -u -r1.234 libtool.texi
--- doc/libtool.texi    6 Jan 2008 16:33:30 -0000       1.234
+++ doc/libtool.texi    13 Jan 2008 16:40:46 -0000
@@ -1199,7 +1199,8 @@
 
 @item -v
 @itemx --verbose
-Print out progress and informational messages (enabled by default).
+Print out progress and informational messages (enabled by default
+unless called by @command{make -s}).
 
 @item --version
 Print libtool version information and exit.
Index: libltdl/config/ltmain.m4sh
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/config/ltmain.m4sh,v
retrieving revision 1.95
diff -u -r1.95 ltmain.m4sh
--- libltdl/config/ltmain.m4sh  12 Jan 2008 13:58:14 -0000      1.95
+++ libltdl/config/ltmain.m4sh  13 Jan 2008 16:40:48 -0000
@@ -152,6 +152,14 @@
 opt_silent=false
 opt_debug=:
 
+# By default, go silent upon `make -s'.
+for f in $MAKEFLAGS; do
+  case $f in
+    *=* | --[!s]*);;
+    *s*) opt_silent=: ;;
+  esac
+done
+
 # If this variable is set in any of the actions, the command in it
 # will be execed at the end.  This prevents here-documents from being
 # left over by shells.




reply via email to

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