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