Waf

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Waf
Waf Logo.jpg
Developer(s) Thomas Nagy
Stable release 1.6.10 / December 17, 2011; 46 days ago (2011-12-17)
Written in Python[1]
Operating system Windows, POSIX
Type Software development tools
License New BSD License
Website waf.googlecode.com

Waf is a build automation tool – a program that assists in the automatic compilation and installation of other programs or libraries.

Contents

[edit] Features

[edit] General

  • Portable to Unix and non-Unix systems
  • Lightweight
  • Offers a Turing-complete programming language (similar to SCons)
  • Support for standard targets: configure, build, clean, distclean, install, and uninstall

[edit] Language Support

[edit] Other

  • Colored output and progress bar display
  • Scripts are Python modules
  • XML script front-end and a dedicated, easy-to-parse "IDE output" mode to ease the interaction with integrated development environments
  • Modular configuration scheme with customizable command-line parsing
  • Daemon mode for background recompilation
  • Find source files intelligently (glob()-like) to ease script maintenance
  • Support for global object cache to avoid unnecessary recompilations
  • Support for unit tests run on programs at the end of builds

[edit] Requirements

  • No installation required: the waf script (only 95 KB) can be distributed and used directly
  • Python is an external dependency

[edit] History

Thomas Nagy created a build automation tool called BKsys which was designed to sit on top of SCons, providing higher-level functionality similar to that of Autotools. When Thomas Nagy decided that SCons' fundamental issues (most notably the poor scalability) were too complex and time-consuming to fix, he started a complete rewrite which he named Waf.

In 2005 the KDE project considered moving from Autotools to SCons and BKsys in its builds, but a year later the decision was made to instead use CMake. Waf was still in a very early pre-alpha stage at that point.[2]

[edit] Example Waf file

Below is a very simple wscript that would compile a source called "hello-world.c" using the platform default c-compiler:

top = '.'
out = 'build'
 
def options(opt):
    opt.load('compiler_c')
 
def configure(conf):
    conf.load('compiler_c')
 
def build(bld):
    bld.program(source = 'hello-world.c', target = 'hello-world', features = 'c cprogram')

The project is built with the following command line:

waf configure build

[edit] Notable applications

Waf is used to build software by a number of different free and open source projects.

[edit] See also

[edit] References

[edit] External links

Personal tools
Namespaces
Variants
Actions
Navigation
Interaction
Toolbox
Print/export
Languages