wscript
#! /usr/bin/env python
"""
The variable conf.env.TOUCH (set by conf.find_program) is re-used during the build
Try:
$ waf configure clean build
"""
top = '.'
out = 'build'
def options(ctx):
ctx.add_option('--foo', action='store', default=False, help='Silly test')
def configure(ctx):
ctx.env.FOO = ctx.options.foo
ctx.find_program('touch', var='TOUCH', mandatory=True) # a configuration helper
def build(ctx):
print(ctx.env.TOUCH)
print(ctx.env.FOO)
ctx(rule='${TOUCH} ${TGT}', target='bar.txt')