wscript (914B)
1 #! /usr/bin/env python 2 3 """ 4 A build iterator similar to "waf step" but following the dependencies of input/output files 5 6 waf make --files=aa 7 waf clean make --files=cc 8 """ 9 10 top = '.' 11 out = 'build' 12 13 def options(opt): 14 opt.load('make') 15 16 def configure(conf): 17 conf.load('make') 18 19 def build(bld): 20 21 x = bld.path.make_node('wscript') 22 23 def xxx(**kw): 24 # this is just an alias, but aliases are convenient, use them! 25 if not 'rule' in kw: 26 kw['rule'] = 'cp ${SRC} ${TGT}' 27 return bld(**kw) 28 29 xxx(source=x, target=x.change_ext('.a'), name='a') 30 xxx(source=x.change_ext('.a'), target=x.change_ext('.aa'), name='aa') 31 32 xxx(source=x, target=x.change_ext('.b'), name='b') 33 xxx(source=x.change_ext('.b'), target=x.change_ext('.bb'), name='bb') 34 35 xxx(source=x, target=x.change_ext('.c'), name='c') 36 37 xxx(rule='cat ${SRC} > ${TGT}', source=[x.change_ext('.bb'), x.change_ext('.aa')], target=[x.change_ext('.cc')], name='cc') 38