wscript 643 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env python
  2. import shutil
  3. import time
  4. top='.'
  5. APPNAME='test'
  6. VERSION='0.0.1'
  7. def copy(task):
  8. time.sleep(2)
  9. shutil.copyfile(task.inputs[0].abspath(), task.outputs[0].abspath())
  10. return 0
  11. def options(opt):
  12. opt.load('compiler_c')
  13. def configure(cfg):
  14. cfg.load('compiler_c')
  15. def build(bld):
  16. dnode = bld.path.find_or_declare('depen.c')
  17. print ('dnode = %r' % dnode)
  18. assert dnode != None
  19. bld(rule=copy, target='foo.h', source='foo.h.tmpl')
  20. bld(rule=copy, target='depen.c', source='foo.c')
  21. bld.program(target='test_foo', source=['main.c', 'foo.c'], includes='.')
  22. bld.add_manual_dependency(bld.path.find_node('main.c'), dnode)