wscript 978 B

123456789101112131415161718192021222324252627282930313233343536
  1. #! /usr/bin/env python
  2. def configure(conf):
  3. conf.env.thecmd = 'all'
  4. conf.load('gcc')
  5. def build(bld):
  6. bld(rule='touch ${TGT}', target='bar.txt')
  7. bld.recurse('just_make')
  8. from waflib.Build import BuildContext, InstallContext, UninstallContext, CleanContext
  9. class _build(BuildContext):
  10. def compile(self):
  11. ret = self.exec_command('make %s' % self.env.thecmd, cwd=self.path.abspath())
  12. if ret:
  13. self.fatal('make returned %r' % ret)
  14. super(_build, self).compile()
  15. class _clean(CleanContext):
  16. def clean(self):
  17. self.exec_command('make clean', cwd=self.path.abspath())
  18. super(_clean, self).clean()
  19. class _install(InstallContext):
  20. def compile(self):
  21. ret = self.exec_command('make install', cwd=self.path.abspath())
  22. if ret:
  23. self.fatal('make install returned %r' % ret)
  24. super(_install, self).compile()
  25. class _uninstall(UninstallContext):
  26. def compile(self):
  27. self.exec_command('make uninstall', cwd=self.path.abspath())
  28. super(_uninstall, self).compile()