Clone in a terminal:
#! /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')

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112