wscript (583B)
1 #!/usr/bin/env python 2 # encoding: utf-8 3 4 def options(opt): 5 opt.load('compiler_c') 6 7 def configure(conf): 8 conf.load('compiler_c flex bison') 9 conf.env.LIB_CALC = ['fl'] 10 11 def build(bld): 12 tg = bld( 13 features = 'c cprogram', 14 source = 'calc.l calc.y main.c', 15 target = 'calc', 16 use = 'CALC') 17 18 # to compile in c++ mode change to: 19 # features= 'cxx cxxprogram' 20 # and add: 21 # import waflib.Tools.cxx as cxx 22 # tg.mappings['.c'] = cxx.cxx_hook 23 24 # re-use the files for other targets: 25 # bld(features='c cshlib', source='calc.tab.c calc.lex.c', use='CALC', target='hmm') 26