]> git.donarmstrong.com Git - lilypond.git/blob - lily/SConscript
* SConstruct: Further development.
[lilypond.git] / lily / SConscript
1 # -*-python-*-
2
3 Import ('env')
4
5 outdir = Dir ('.').abspath
6 cc_sources =  env['src_glob'] (env, '*.cc')
7 sources = cc_sources + ['parser.yy', 'lexer.ll']
8 includes = env['src_glob'] (env, 'include/*.hh')
9
10 e = env.Copy ()
11 e.Append (CPPPATH = [outdir, '#/lily/include', '#/flower/include'])
12 e.Append (LEXFLAGS = ['-Cfe', '-p', '-p'])
13
14 # SCons builds parser.cc and parser.hh automagically with this but
15 # keeps removing and rebuilding parser.cc because it wants parser.hpp.
16 # e.Append (YACCFLAGS = '-d')
17 # e.Depends ('lexer.cc', 'parser.cc')
18 # e.Depends ('my-lily-lexer.o', 'parser.cc')
19 # e.Depends ('my-lily-parser.o', 'parser.cc')
20
21 # Adding an explicit Builder works well, we do not even need to list
22 # header dependencies.
23 HH = Builder (action = 'bison -d -o ${TARGET.base}.cc $SOURCE',
24               suffix = '.hh', src_suffix = '.yy')
25 e.Append (BUILDERS = {'HH' : HH})
26 e.HH ('parser.hh', 'parser.yy')
27
28 e.Append (LIBS = ['flower'])
29 e.ParseConfig ('guile-config link')
30 name = 'lilypond-bin'
31 lily = e.Program (name, sources)
32 env.Install (env['bindir'], lily)
33 env.Alias ('install', env['bindir'])
34
35 po = env.Command ('lilypond.po', cc_sources + includes, env['pocommand'])
36 env.Alias ('po-update', po)