hammer/src/SConscript

77 lines
1.7 KiB
Text
Raw Normal View History

2013-07-10 21:32:05 +02:00
# -*- python -*-
Import('env')
2013-09-12 10:39:50 -07:00
bindings = []
2013-10-29 17:35:37 -04:00
dist_headers = [
"hammer.h",
"allocator.h",
"glue.h"
]
parsers = ['parsers/%s.c'%s for s in
['action',
'and',
'attr_bool',
'bits',
'butnot',
'ch',
'charset',
'choice',
'difference',
'end',
'epsilon',
'ignore',
'ignoreseq',
'indirect',
'int_range',
'many',
'not',
'nothing',
'optional',
'sequence',
'token',
'unimplemented',
'whitespace',
'xor']]
backends = ['backends/%s.c' % s for s in
2013-07-10 21:32:05 +02:00
['packrat', 'llk', 'regex', 'glr', 'lalr', 'lr', 'lr0']]
misc_hammer_parts = [
'allocator.c',
'benchmark.c',
'bitreader.c',
'bitwriter.c',
'cfgrammar.c',
'datastructures.c',
'desugar.c',
'glue.c',
'hammer.c',
'pprint.c',
2013-11-19 21:14:39 -06:00
'registry.c',
'system_allocator.c']
tests = ['t_benchmark.c',
't_bitreader.c',
't_bitwriter.c',
't_parser.c',
't_grammar.c',
't_misc.c']
2013-09-12 10:39:50 -07:00
libhammer_shared = env.SharedLibrary('hammer', parsers + backends + misc_hammer_parts)
libhammer_static = env.StaticLibrary('hammer', parsers + backends + misc_hammer_parts)
2013-10-29 17:35:37 -04:00
env.Install("$libpath", [libhammer_static, libhammer_shared])
env.Install("$incpath", dist_headers)
testenv = env.Clone()
testenv.ParseConfig('pkg-config --cflags --libs glib-2.0')
testenv.Append(LIBS=['hammer'], LIBPATH=['.'])
testenv.Program('test_suite', tests + ['test_suite.c'])
2013-10-29 17:35:37 -04:00
2013-09-12 10:39:50 -07:00
Export("libhammer_static libhammer_shared")
for b in bindings:
env.SConscript(["bindings/%s/SConscript" % b])