verbosity
Hi, I'm working on moving an existing project to use autotools. One of the issues that I've encountered is that the build process is very verbose. Due to factors outside my control, the CPPFLAGS used for compiling contain a very long list of include flags. This results in the compile command being about 1100 chars long. Further, as the libtool invocation and the underlying g++ invocation are both printed, the output for compiling each object file is 2200 chars. On an 80-char-wide terminal, that's 28 lines. This makes it *very* easy to miss potential important compiler warnings and such in all the noise. I'd like be able to reduce the output to just the target of the make rule for developers. Something like: src/control/TerminationCriteria.o src/control/InstructionQueue.o ... Is there some way to do this with automake? Further, I'd like to control the behavior with a configure flag, so developers get the reduced output making warnings and other issues more apparent while users by default get the verbose output so any platform-specific issues or configure errors are more apparent. I know how to turn off the echoing of the underlying command from the libtool wrapper (the --silent option). I can control that from the configure script. The problem is how to control the output of make. I can pass the '-s' option to make, but that can't be controlled from the configure script and results in no output at all. In hand-rolled build systems, I've controlled this output by prefixing the commands in each rule with a variable such as $(PREFIX). To get the verbose output: PREFIX= . To get reduced output: PREFIX=@echo $@; . Any suggestions as to how I could achieve the same type of thing in automake would be greatly appreciated. Thanks.
Re: verbosity
On Fri, Jan 12, 2007 at 11:28:24AM -0600, Jason Kraftcheck wrote: Hi, I'm working on moving an existing project to use autotools. One of the issues that I've encountered is that the build process is very verbose. Due to factors outside my control, the CPPFLAGS used for compiling contain a very long list of include flags. This results in the compile command being about 1100 chars long. Further, as the libtool invocation and the underlying g++ invocation are both printed, the output for compiling each object file is 2200 chars. On an 80-char-wide terminal, that's 28 lines. This makes it *very* easy to miss potential important compiler warnings and such in all the noise. I'd like be able to reduce the output to just the target of the make rule for developers. Something like: src/control/TerminationCriteria.o src/control/InstructionQueue.o ... Is there some way to do this with automake? Try 'make -s', it's not excatly what you want, but may help. Bob Rossi
Re: verbosity
Hello Jason, * Jason Kraftcheck wrote on Fri, Jan 12, 2007 at 06:28:24PM CET: I'm working on moving an existing project to use autotools. One of the issues that I've encountered is that the build process is very verbose. Use alias mymake='make -s LIBTOOLFLAGS=--silent' (with Automake = 1.10), or, most portably, make /dev/null || make Apparently someone also made a Debian package out of his patches to make Automake silent. You can search the automake(-patches) lists for several past instances, if you're apt to hack Automake. I know how to turn off the echoing of the underlying command from the libtool wrapper (the --silent option). I can control that from the configure script. The problem is how to control the output of make. I can pass the '-s' option to make, but that can't be controlled from the configure script and results in no output at all. Looking for this (not quite sure how portable)? AM_MAKEFLAGS=-s Cheers, Ralf
Re: verbosity
Jason Kraftcheck wrote: This makes it *very* easy to miss potential important compiler warnings and such in all the noise. I have heard this infrequently from posters but I don't experience this myself and here is why. I think I will go out on a limb and say that most (many?) developers use automated tools to walk through every warning and every error output from the compilers when building their projects. Because of this I find it unlikely that anyone doing this would miss a warning or an error. In fact because of this warnings are an extra annoyance and will usually get fixed. (Even without -Werror.) My personal tool of choice for this is emacs. But before you balk at that (because if not then you would not have been asking your question) let me say that surely vim, kdevelop, or other IDEs also have capabilities in this area. Instead of trying to hide useful output from the build process let me suggest instead that you investigate using an improved IDE to build and develop your project. An IDE that walks through the warnings and errors removes much of the drudgery. I highly recommend this. Barring this I would use gcc's -Werror option to make all warnings into errors. This way warnings will not be missed. But I realize that you said this was a legacy application. Cleaning up a legacy application to be completely warning free can be a challenging process. I am facing that prospect (again) myself right now. Just my two cents... Bob