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')
11 e.Append (CPPPATH = [outdir, '#/lily/include', '#/flower/include'])
12 e.Append (LEXFLAGS = ['-Cfe', '-p', '-p'])
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')
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')
28 e.Append (LIBS = ['flower'])
29 e.ParseConfig ('guile-config link')
32 lily = e.Program (name, sources)
33 env.Install (env['bindir'], lily)
34 env.Alias ('install', env['bindir'])
36 po = env.Command ('lilypond.po', cc_sources + includes, env['pocommand'])
37 env.Alias ('po-update', po)