github.com/hwaf/hwaf@v0.0.0-20140814122253-5465f73b20f1/py-hwaftools/orch/worch/tbbinst.py (about) 1 #!/usr/bin/env python 2 ''' 3 tbb is cantankerous package to build. This feature should follow 4 "tarball" or another that provides the "unpacked" step. 5 ''' 6 from waflib.TaskGen import feature 7 import orch.features 8 9 def configure(cfg): 10 orch.features.register_defaults( 11 'tbbinst', 12 # gratuitious wart _src 13 source_archive_file = '{source_unpacked}_src.tgz', 14 unpacked_target = 'Makefile', 15 # Non standard location to build - must match source unpacked 16 build_target = 'crappy-build-system', 17 install_target = '{install_dir}/lib/libtbb.so', 18 ) 19 return 20 21 def build(bld): 22 pass 23 24 @feature('tbbinst') 25 def feature_tbbinst(tgen): 26 27 flag = tgen.make_node(tgen.worch.build_dir).make_node(tgen.worch.build_target) 28 build_rule = "(cd src && make cpp0x=1 tbb_release) && touch %s" 29 tgen.step('build', 30 rule = build_rule % flag.abspath(), 31 source = tgen.control_node('unpack'), 32 target = flag) 33 34 instarg = tgen.make_node(tgen.worch.install_target) 35 libdir = instarg.parent.abspath() 36 install_rule = 'mkdir -p %s && cp build/*_release/libtbb* %s/' 37 install_rule = install_rule % (libdir,libdir) 38 tgen.step('install', 39 rule = install_rule, 40 source = flag, 41 target = instarg) 42