2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-22 18:07:12 +01:00
waf/docs/book/examples/scenarios_impfile/wscript
2011-09-10 11:13:51 +02:00

23 lines
423 B
Python

#! /usr/bin/env python
"""
Create a file in the build directory before the build starts
"""
cfg_file = 'somedir/foo.txt'
def configure(conf):
orig = conf.root.find_node('/etc/fstab')
txt = orig.read()
dest = conf.bldnode.make_node(cfg_file)
dest.parent.mkdir()
dest.write(txt)
conf.env.append_value('cfg_files', dest.abspath())
def build(ctx):
ctx(rule='cp ${SRC} ${TGT}', source=cfg_file, target='bar.txt')