Skip to content

BNLIF/waf-tools

Repository files navigation

Waf Tools

This repository holds some simple waf tools which help build code.

How to use this package.

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.

Setting up

Set up a development area like this:

$ mkdir -p /path/to/my/dev
$ cd /path/to/my/dev
$ git clone git@github.com: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>/

Using the tools

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>/

Conventional wscript

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()

Building

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

Examples

See wire-cell-data on GitHub.

About

Some simple waf tools to help build code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published