Control GNU autotools make output

2019-08-04 07:44发布

问题:

I am using GNU autoconf/automake. Is there any way I can control what make prints to stdout from configure.ac or Makefile.am? For example, suppress mv and cp commands being printed out to the screen, only print the name of the file being compiled by gcc rather than the whole command line, highlight gcc warnings in some way.

回答1:

Is Prettify Automake what you want?


Edit: As of Automake 1.10b, silent-rules is built-in. Not the same code or style but similar in effect.



回答2:

Modern Automake (after in 1.10b) supports --silent-rules which will suppress the full compile command. (eg, output is "CC foo" instead of "gcc -DHAVE_CONFIG_H ...") That may be all you need. You need to add "silent-rules" to AM_INIT_AUTOMAKE and pass --enable-silent-rules to configure (or put it in CONFIG_SITE) to enable the feature. See the automake docs for details.



回答3:

I believe the easiest thing is to write a wrapper script which runs *make and parses the output. I believe I have seen this being done in Ubuntu somewhere ...