wscript 916 B

1234567891011121314151617181920212223242526272829
  1. #! /usr/bin/env python
  2. from waflib import Build
  3. def build(bld):
  4. # Call make for building, but keep waf for install/uninstall
  5. # there is no 'clean' here
  6. def make_all(tsk):
  7. # create the output folder in advance
  8. d = tsk.generator.path
  9. d.get_bld().mkdir()
  10. ret = tsk.generator.bld.exec_command('make all', cwd=d.abspath())
  11. # install the files by waf - it might be more maintainable to do it through make though
  12. tsk.set_outputs(d.get_bld().ant_glob('*.so'))
  13. tsk.generator.bld.install_files('${LIBDIR}', tsk.outputs, postpone=False)
  14. return ret
  15. # the attribute 'always' is used to force the make execution, else
  16. # the make command will be called only once
  17. bld(rule=make_all, always=True, name='call make')
  18. # for a hybrid build...
  19. bld.post_mode = Build.POST_LAZY
  20. bld.add_group()
  21. bld.read_shlib('foo', paths=[bld.path.get_bld().abspath()])
  22. bld.program(source='main.c', target='a', use='foo')