]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/SConscript
ce873d728bc813ff21747b2fa5dfa68d40238a1a
[lilypond.git] / Documentation / SConscript
1 # -*-python-*-
2
3 import glob
4 import os
5
6 here = os.getcwd ()
7 reldir = str (Dir ('.').srcnode ())
8 os.chdir (reldir)
9 sources = glob.glob ('*.tely') + glob.glob ('user/*.tely')
10 os.chdir (here)
11
12 Import ('env')
13 e = env.Copy ()
14 outdir = os.path.join (env['build'], reldir, env['out'])
15
16 # Too late
17 e.Append (LILYPOND_BOOK_PATH = [os.path.join (env['srcdir'], reldir, 'user')])
18 e['LILYPOND_BOOK_PATH'].append (os.path.join (env['srcdir'], reldir, 'user'))
19
20
21
22 def verbose_opt (env, opt):
23         if env['verbose']:
24                 return opt
25         return ''
26
27 LILYPOND_BIN = env['LILYPOND_BIN']
28 LILYPONDPREFIX = env['LILYPONDPREFIX']
29
30 # $(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi: $(builddir)/lily/$(outconfbase)/lilypond-bin
31 #       cd $(outdir) && $(builddir)/lily/$(outconfbase)/lilypond-bin --verbose $(abs-srcdir)/ly/generate-documentation
32 #       rm -f $(outdir)/lilypond-internals.nexi
33 #       -ln $(outdir)/lilypond-internals.texi $(outdir)/lilypond-internals.nexi
34
35 e.Depends ('lilypond.texi', 'feta16list.ly')
36 e.Depends ('lilypond.texi', 'parmesan16list.ly')
37 e.Depends ('lilypond.texi', 'lilypond-internals.texi')
38                          
39 e.Command ('lilypond-internals.texi', LILYPOND_BIN,
40            ('(cd $$(dirname $TARGET) && \
41            LILYPONDPREFIX=%(LILYPONDPREFIX)s %(LILYPOND_BIN)s ' \
42             + verbose_opt (env, ' --verbose') \
43             + ' ' + os.path.join (env['srcdir'], 'ly/generate-documentation')\
44             + ')') % vars ())
45
46 docs = e.Tely2pdf (sources)
47
48 e.Alias ('doc', docs)
49
50 #testing
51 all_sources = ['SConscript',] + sources
52 x = env.Tar (env['tarball'], all_sources)