wscript 914 B

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