Pretty Make

From Freehackers

Jump to: navigation, search

Contents

[edit] Obsolescence

Pretty Make has become obsolete. The program still works but KDE is now using CMake which provides much better output than autotools used to.

[edit] Introduction

Pretty make is a very small python script that will organise and colorize your make output. I have written this because when compiling, I was sick of the endless lines of uninteresting options, which were hiding the gcc options I was looking for.

The program analyses its specific options then runs make with all the other options. So it is compatible with make. I use it every week to compile KDE with:

 alias make='pretty_make.py'. 

People have been wondering about CPU usage. Starting the python interpreter takes a little CPU, but this is before you have started your compilation, so you sill have plenty of CPU anyway. The python interpreter is started only once for a make command, so it won't matter much in you overall compilation speed.

Now, the parsing of the line uses builting python functions, which are written in C. So this is fast and there is really not a lot of work: split the line, compare beginning of words, fill lists, display. And such a line is displayed when gcc choose a new file to compile, so the tiny amount of CPU taken would have probably not been used anyway (except if you use -j12) because gcc was still loading the files at that time. When I compile, python doesn't make into 'top', so it effectively does not take CPU.


[edit] Features

All features are of course configurable.

  • Adapt the output to your terminal width
  • Hide libtool lines: the next line is the real compile line anyway.
  • Group similar options on separate lines: all -D together, all -I together, ...
  • Can hide uninteresting option: you get <-W> instead of all the -W options.
  • Colorize options differently: makes it easier to distinguish between -L, -I and -D
  • Colorize moc and uic lines differently: else, you tend to miss them even when looking for them
  • Enable or disable colors
  • Post-process your compilation output: compile with output to a file and beautify it later.
  • Useable inside vim and probably other editors
  • All options configurable

The default options you might want to alter are at the beginning of the program. There is no need to know python to modify them.

[edit] Screenshot

[edit] Before:

pretty-make-before.png

[edit] After:

pretty-make-after.png

[edit] Download

[edit] Version 1.3 : 20 july 2003

New features:

  • add more compiler names
  • add a debug option
  • handles properly argument with spaces inside
  • can now compile kernel without problems

Download: pretty_make.py

[edit] Version 1.2 : 02 april 2002

New features:

  • Argument -- passes all the remaining arguments to make (pretty-make.py -- --help yields make's help)
  • Transparancy in konsole is preserved when not altering background color.
  • Fix for arguments of type "arg=foo" that were not passed to make
  • Fix for keyboard interruption (^C) would leave the make running wild in the background


[edit] Version 1.1 : 26 march 2002

New features:

  • Fixes for tcsh users


[edit] Version 1.0 : 26 march 2002

Initial release.


[edit] Usage

Many way to use it:

  • Adapt the output to your terminal width
  • Hide libtool lines: the next line is the real compile line anyway.
  • Group similar options on separate lines: all -D together, all -I together, ...
  • Can hide uninteresting option: you get <-W> instead of all the -W options.
  • Colorize options differently: makes it easier to distinguish between -L, -I and -D
  • Colorize moc and uic lines differently: else, you tend to miss them even when looking for them
  • Enable or disable colors
  • Post-process your compilation output: compile with output to a file and beautify it later.
  • Useable inside vim and probably other editors
  • All options configurable


Red Hat users, be warned: pretty make won't run on your system, because recent Red Hat distributions ship with an old version of python, Python 1.5.2, which is not supported by pretty_make. It is amazing that RedHat ships with such an old version of python. It is now three years old and python has seen 8 stable releases since 1.5.2. This is one more reason for me not to use RedHat. Mandrake and Suse don't have this problem, and I think Debian doesn't too. If you want to run pretty_make, you need to upgrade your version of python.

[edit] Feedback

Bugs, suggestions, patch, I am open to feedback. Contact me

[edit] Other similar programs

Pretty make doesn't use these program but you may want to check them if you like coloured output.


[edit] Other Projects of Bluebird

  • VimWrapper: a library to integrate Vim into other software
  • Vy: a generic vi engine written in Python
  • LuaUnit: a unittest framework for the Lua language
  • Klotski: a mind-breaking game
  • Yzis: a generic vi engine written in C++
  • Indent Finder: set your editor to the correct indentation automatically
  • Pretty Make: beautify your make output
  • Keep Cool: keep your CPU at low temperature while compiling.
  • KMerge: text document merging tool developed for KDE 1.
Personal tools