blob: 6ae7898a685774acb119c75ae7b476411adcdad8 [file] [log] [blame]
akmhoquefa8ee9b2014-03-14 09:06:24 -05001#! /usr/bin/env python
2# encoding: utf-8
3# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
4
5from waflib import Task
6from waflib.TaskGen import extension
7class bison(Task.Task):
8 color='BLUE'
9 run_str='${BISON} ${BISONFLAGS} ${SRC[0].abspath()} -o ${TGT[0].name}'
10 ext_out=['.h']
11@extension('.y','.yc','.yy')
12def big_bison(self,node):
13 has_h='-d'in self.env['BISONFLAGS']
14 outs=[]
15 if node.name.endswith('.yc'):
16 outs.append(node.change_ext('.tab.cc'))
17 if has_h:
18 outs.append(node.change_ext('.tab.hh'))
19 else:
20 outs.append(node.change_ext('.tab.c'))
21 if has_h:
22 outs.append(node.change_ext('.tab.h'))
23 tsk=self.create_task('bison',node,outs)
24 tsk.cwd=node.parent.get_bld().abspath()
25 self.source.append(outs[0])
26def configure(conf):
27 conf.find_program('bison',var='BISON')
28 conf.env.BISONFLAGS=['-d']