This is the homepage for the prettification of GNU Automake.
There is no question that Automake could generate Makefiles which output progress in a much nicer way. There are already projects employing a more informational approach to compiling. The Linux kernel is probably the best known example. Samba did it long before.
The normal user is not interrested in knowing the compilation flags used to build the killer app. She merely wants to know if any progress is made. How long will the compilation take and what should she do during that time.
Also, during development (although this has been under heavy discussion) it is easier to find warnings and errors if the compilation command line does not extend five lines. Because different people have different views of the process, it was neccessary to be able to turn pretty commands on and off.
By far, the easiest way to control this sort of thing is to include the switch
configure and using the substitution engine Autoconf already has.
As of today, the prettification takes a Linux approach and outputs things like
This hides all the gory details and makes it a lot easier to spot warnings and errors.
Figure 1: The Linux style output. [C++ ] control.cc [YACC ] parser.y
Distributed under the GNU General Public License, Version 2.
|1.3||Dec 9, 2006||Untested 1.10||Patch (71 kB)||Fixed broken
Fixed erronous copyright.
|1.2||Nov 8, 2006||Untested 1.10||Patch (71 kB)||First release for 1.10.|
|1.1||Nov 8, 2006||1.9.6||Patch (69 kB)||Added prettycmds.m4 to Makefile, it was missing in installation (Found by Philipp G.).
The patch name should be in plural.
A circular dependency on aclocal exists. See below.
|1.0||July 11, 2006||1.9.6||Patch (69 kB)||First release.|
patch -P0or so).
touch -r m4/auxdir.m4 m4/init.m4).
m4/init.m4. Seeing this, automake tries to rebuild its own
The implementation uses a number of new Autoconf
They are expanded to at-signs (@) and colons (:) and are placed in front of
certain action lines in Automake's templates (stored in
When pretty commands are active, the at-signs (expanded from
hide the command line and
AMPRETTYECHO is expanded to
to tell the user what gives...
When pretty commands are disabled,
AMSHOWCMDSAT is expanded to the empty
AMPRETTYECHO is expanded to a colon (which is the no-op of [most] shell scripts).
For instance, the
distclean target of
now looks like the code in Figure 2.
The benefit of not simply expanding
Figure 2: The new looks of a cleaning rule. distclean-compile: @@AMPRETTYECHO@ ' [RM ] *.tab.c' @AMSHOWCMDSAT@-rm -f *.tab.c
AMPRETTYECHOto a hash (comment it out, is that it allows the echoing to be included in a multiline action command. The only side effect to this the author has seen, is that the templates may be harder to maintain due to the extra text.
To implement the switch between pretty commands and verbose commands, a new
Autoconf macro was added, called
AM_PRETTY_CMDS. It is called from
AM_INIT_AUTOMAKE. It adds the command line switches
needed substitutions are declared and the libtool macro is modified to be silent
If you are just compiling a package which has been prettified, you simply
--enable-pretty-commands to the
command line and hope for the best. The default is still the old behaviour;
to show the entire command lines.
Since Automake is open-source, the prettification can be completly integrated into Automake and requires no changes to your code, in the normal case.
However, if you write your own actions, you will need to patch them to use the magic substitutions. First read about the implementation, though. There are four substitution macros you need to be aware of:
|Macro||Substitutes to||Use at||Description|
|AMSHOWCMDSAT||@||empty||Beginning of action command line||Silences the command when pretty commands are enabled.|
|AMDEPSHOWCMDSAT||@||empty||Beginning of action command line||Silences the command, but only when dependency tracking is off.|
||Allows us to not print the pretty string when pretty commands is disabled.|
||Some normal commands (especially dependency tracking) use echo to furnish their output. To disable this, a simple "@" is not enough.|
Of these, you will probably only use
Now, if you write a rule to generate source code from an RPC file, you probably write something along the lines of the code in Figure 3. This must be prettified to read like Figure 4. You should note the double @ on the first action line. Otherwise, the echo command itself would be output. Not very pretty…
Figure 3: A simple
%.ss.c: %.rg $(RPCGEN) $(RPCGENFLAGS) -m -o $@ $<
Figure 4: The new looks of the rule. %.ss.c: %.rg @@AMPRETTYECHO@ ' [RPC SS ] $<' @AMSHOWCMDSAT@$(RPCGEN) $(RPCGENFLAGS) -m -o $@ $<
That's all. As stated earlier, if you don't write your own rules, you won't need to change your code.
$(am_prettyecho)and setting some make variables. It would still require