hammer/src/SConscript
Joe Rozner 76034ae4d7 Install internal headers for Go bindings
Go, and likely other language bindings will, need access to create
new combinators. This functionality is currently located
src/parsers/parser_internal.h. Install this header to the system with
dependent headers until a better solution can be found.
2013-11-21 12:02:18 -08:00

89 lines
2 KiB
Python

# -*- python -*-
Import('env')
bindings = []
dist_headers = [
"hammer.h",
"allocator.h",
"glue.h",
"internal.h"
]
parsers_headers = [
"parsers/parser_internal.h"
]
backends_headers = [
"backends/regex.h",
"backends/contextfree.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
['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',
'registry.c',
'system_allocator.c']
tests = ['t_benchmark.c',
't_bitreader.c',
't_bitwriter.c',
't_parser.c',
't_grammar.c',
't_misc.c']
libhammer_shared = env.SharedLibrary('hammer', parsers + backends + misc_hammer_parts)
libhammer_static = env.StaticLibrary('hammer', parsers + backends + misc_hammer_parts)
env.Install("$libpath", [libhammer_static, libhammer_shared])
env.Install("$incpath", dist_headers)
env.Install("$parsersincpath", parsers_headers)
env.Install("$backendsincpath", backends_headers)
env.Install("$pkgconfigpath", "../../../libhammer.pc")
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'])
Export("libhammer_static libhammer_shared")
for b in bindings:
env.SConscript(["bindings/%s/SConscript" % b])