Changeset 01855a5 in rtems-libbsd


Ignore:
Timestamp:
May 7, 2018, 8:19:28 AM (13 months ago)
Author:
Christian Mauderer <christian.mauderer@…>
Branches:
b5f8d4831d66364b7391e3660560cb9bbecada2e, 31b5c87357cee83d6a3419c5d801a9bf16912714
Children:
09bbedc
Parents:
879eaa7
git-author:
Christian Mauderer <christian.mauderer@…> (05/07/18 08:19:28)
git-committer:
Christian Mauderer <christian.mauderer@…> (08/01/18 07:55:27)
Message:

waf: Allow to only generate lex and yacc.

In some applications, it's usefull if the files generated by lex or yacc
are not build automatically. With that it is for example possible to
create a wrapper source file that sets some defines before the generated
code is parsed.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • builder.py

    r879eaa7 r01855a5  
    548548class LexFragmentComposer(BuildSystemFragmentComposer):
    549549
    550     def __init__(self, sym, dep, cflags = None, includes = None):
     550    def __init__(self, sym, dep, cflags = None, includes = None, build = True):
    551551        self.sym = sym
    552552        self.dep = dep
    553553        self.cflags, self.includes = _cflagsIncludes(cflags, includes)
     554        self.build = build
    554555
    555556    def compose(self, path):
    556557        d = { 'file': path,
    557558              'sym': self.sym,
    558               'dep': self.dep }
     559              'dep': self.dep,
     560              'build': self.build }
    559561        if None not in self.cflags:
    560562            d['cflags'] = self.cflags
     
    565567class YaccFragmentComposer(BuildSystemFragmentComposer):
    566568
    567     def __init__(self, sym, header, cflags = None, includes = None):
     569    def __init__(self, sym, header, cflags = None, includes = None, build = True):
    568570        self.sym = sym
    569571        self.header = header
    570572        self.cflags, self.includes = _cflagsIncludes(cflags, includes)
     573        self.build = build
    571574
    572575    def compose(self, path):
    573576        d = { 'file': path,
    574577              'sym': self.sym,
    575               'header': self.header }
     578              'header': self.header,
     579              'build': self.build }
    576580        if None not in self.cflags:
    577581            d['cflags'] = self.cflags
  • waf_libbsd.py

    r879eaa7 r01855a5  
    362362                        source = lex['file'],
    363363                        rule = lex_rule)
    364                 bld.objects(target = 'lex_%s' % (lex['sym']),
    365                             features = 'c',
    366                             cflags = cflags,
    367                             includes = lexIncludes + includes,
    368                             defines = defines + lexDefines,
    369                             source = lex['file'][:-2] + '.c')
     364                if lex['build']:
     365                    bld.objects(target = 'lex_%s' % (lex['sym']),
     366                                features = 'c',
     367                                cflags = cflags,
     368                                includes = lexIncludes + includes,
     369                                defines = defines + lexDefines,
     370                                source = lex['file'][:-2] + '.c')
    370371                libbsd_use += ['lex_%s' % (lex['sym'])]
    371372
     
    399400                        source = yaccFile,
    400401                        rule = yacc_rule)
    401                 bld.objects(target = 'yacc_%s' % (yaccSym),
    402                             features = 'c',
    403                             cflags = cflags,
    404                             includes = yaccIncludes + includes,
    405                             defines = defines + yaccDefines,
    406                             source = yaccFile[:-2] + '.c')
     402                if yacc['build']:
     403                    bld.objects(target = 'yacc_%s' % (yaccSym),
     404                                features = 'c',
     405                                cflags = cflags,
     406                                includes = yaccIncludes + includes,
     407                                defines = defines + yaccDefines,
     408                                source = yaccFile[:-2] + '.c')
    407409                libbsd_use += ['yacc_%s' % (yaccSym)]
    408410
Note: See TracChangeset for help on using the changeset viewer.