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