This repository holds some simple waf tools which help build code.
To use waf-tools
you write a simple file named wscript
which defines a few Python functions. You then use waf
, included in this package, to configure, build and install your code.
Set up a development area like this:
$ mkdir -p /path/to/my/dev $ cd /path/to/my/dev $ git clone [email protected]:BNLIF/waf-tools.git $ alias waf=`pwd`/waf-tools/waf $ waf --version
You may also want to bring your own packages in this development area:
$ git clone <my-git-repository-url> $ cd <my-git-repository>/
The main tool will build and install your source package into API headers, shared libraries, ROOT dictionaries, main programs and tests. To make the wscript
file simpler you can follow some source directory layout conventions.
APPNAME
- your package has a name set by the
APPNAME
variable in the wscript file. This may differ from your top-level package source directory src/
- holds library C++ source code and any private (non-API) headers
inc/
- holds public API headers here in a subdirectory
<name>/
Following these conventions your wscript
file is essentially boilerplate listing what types of things your package provides as shown in this example:
APPNAME = 'MyPackage'
def options(ctx):
ctx.load('find_package')
def configure(ctx):
ctx.load('find_package')
def build(bld):
bld.shared_library()
bld.api_headers()
bld.rootcint_dictionary()
Using waf
as aliased above (it needs to be physically in the waf-tools/
directory do:
$ waf --prefix=/path/to/install configure build install
As you develop you can re-build by simply typing:
$ waf
See wire-cell-data on GitHub.