mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-30 05:52:24 +01:00
23 lines
423 B
Python
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')
|
|
|