~elementary-apps/noise/trunk

« back to all changes in this revision

Viewing changes to .waf-1.6.2-ad4cc42bd7d347f7e283789e711b993f/waflib/Tools/bison.py

  • Committer: Scott Ringwelski
  • Date: 2011-02-10 21:30:53 UTC
  • Revision ID: sgringwe@mtu.edu-20110210213053-d3c7mnexeref3cwj
sexy icons, sexy waf

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/env python
 
2
# encoding: utf-8
 
3
# WARNING! All changes made to this file will be lost!
 
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
def big_bison(self,node):
 
12
        has_h='-d'in self.env['BISONFLAGS']
 
13
        outs=[]
 
14
        if node.name.endswith('.yc'):
 
15
                outs.append(node.change_ext('.tab.cc'))
 
16
                if has_h:
 
17
                        outs.append(node.change_ext('.tab.hh'))
 
18
        else:
 
19
                outs.append(node.change_ext('.tab.c'))
 
20
                if has_h:
 
21
                        outs.append(node.change_ext('.tab.h'))
 
22
        tsk=self.create_task('bison',node,outs)
 
23
        tsk.cwd=node.parent.get_bld().abspath()
 
24
        self.source.append(outs[0])
 
25
def configure(conf):
 
26
        conf.find_program('bison',var='BISON')
 
27
        conf.env.BISONFLAGS=['-d']
 
28
 
 
29
extension('.y','.yc','.yy')(big_bison)
 
 
b'\\ No newline at end of file'