README.md: improve markdown formatting, update homepage, use https
[pd-aubio.git] / waflib / Tools / bison.py
1 #! /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
5 from waflib import Task
6 from waflib.TaskGen import extension
7 class 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')
12 def 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])
26 def configure(conf):
27         conf.find_program('bison',var='BISON')
28         conf.env.BISONFLAGS=['-d']