My favorites | Sign in
Logo
waf
Project hosting will be READ-ONLY Wednesday, 7AM PST due to brief network maintenance
                
Search
for
Updated Apr 21, 2009 by richard.quirk
Labels: Featured, User-Documentation
UsingWaf  
How to use the waf build system

Introduction

We describe here how to build software with Waf. We assume that Waf is already installed in on your system or is present in your source tree. If not read InstallingWaf

Building with Waf

Getting Help

To get help for Waf simply run waf --help and you will get the following output

Usage: waf [command] [options]

* Main commands (example: ./waf build -j4)
  build    : builds the project
  clean    : removes the build files
  configure: configures the project
  dist     : makes a tarball for redistributing the sources
  distcheck: checks if the sources compile (tarball from 'dist')
  distclean: removes the build directory
  install  : installs the build files
  uninstall: removes the installed files

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -j JOBS, --jobs=JOBS  amount of parallel jobs (N)
  -k, --keep            keep running happily on independent task groups
  -v, --verbose         verbosity level -v -vv or -vvv [default: 0]
  --nocache             ignore the WAFCACHE (if set)
  --zones=ZONES         debugging zones (task_gen, deps, tasks, etc)
  -p, --progress        -p: progress bar; -pp: ide output
  --targets=COMPILE_TARGETS
                        build given task generators, e.g. "target1,target2"

  configuration options:
    -b BLDDIR, --blddir=BLDDIR
                        build dir for the project (configuration)
    -s SRCDIR, --srcdir=SRCDIR
                        src dir for the project (configuration)
    --prefix=PREFIX     installation prefix (configuration) [default: '/usr/local/']

  installation options:
    --destdir=DESTDIR   installation root [default: '']
    -f, --force         force file installation

Waf Commands to Build Software

If you have a project which already uses the Waf build system, building the software is usually done by executing the following three commands

waf configure
waf build
waf install

If you have worked with autotools which uses configure, make, make install you probably noticed that the commands are very similar.

Uninstalling Software

A really neat feature of Waf is that you can also uninstall your software again by running

waf uninstall

Got in troubles ?

In case there's something wrong with your configure/build you might want to add the -v option to the commands, see DebuggingWaf

Configure

To see what failed on configure, read the file config.log (located in the build dir).

Progress bar

If you like progress bars run

waf build -p


Sign in to add a comment
Hosted by Google Code