]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/SConscript
*** empty log message ***
[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 sources = ['user/lilypond.tely', 'user/music-glossary.tely']
11 os.chdir (here)
12
13 Import ('env')
14 e = env.Copy ()
15 outdir = os.path.join (env['build'], reldir, env['out'])
16
17 # Too late
18 e.Append (LILYPOND_BOOK_PATH = [os.path.join (env['srcdir'], reldir, 'user')])
19 e['LILYPOND_BOOK_PATH'].append (os.path.join (env['srcdir'], reldir, 'user'))
20
21
22
23 def verbose_opt (env, opt):
24         if env['verbose']:
25                 return opt
26         return ''
27
28 LILYPOND_BIN = env['LILYPOND_BIN']
29 LILYPONDPREFIX = env['LILYPONDPREFIX']
30
31
32 mfbuild = os.path.join (env['absbuild'], 'mf', env['out'])
33 lilybuild = os.path.join (env['absbuild'], 'lily', env['out'])
34 userbuild = os.path.join (env['absbuild'], 'Documentation/user', env['out'])
35 e.Depends ('user/lilypond.texi', os.path.join (mfbuild, 'feta16list.ly'))
36 e.Depends ('user/lilypond.texi', os.path.join (mfbuild, 'parmesan16list.ly'))
37 ##e.Depends ('lilypond.texi', os.path.join (userbuild, 'music-glossary.texi'))
38 e.Depends ('lilypond.texi', 'lilypond-internals.texi')
39 e.Depends ('lilypond.texi', os.path.join (lilybuild, 'lilypond-bin'))
40
41 e.Command ('lilypond-internals.texi', LILYPOND_BIN,
42            ('(cd $$(dirname $TARGET) && \
43            LILYPONDPREFIX=%(LILYPONDPREFIX)s %(LILYPOND_BIN)s ' \
44             + verbose_opt (env, ' --verbose') \
45             + ' ' + os.path.join (env['srcdir'], 'ly/generate-documentation')\
46             + ')') % vars ())
47
48 doc_stems = map (lambda x: os.path.splitext (x)[0], sources)
49 texis = map (e.Tely2texi, doc_stems)
50 dvis = map (e.Texi2dvi, doc_stems)
51 pss = map (e.PostScript, doc_stems)
52 pdfs = map (e.Dvi2pdf, doc_stems)
53
54 e.Alias ('doc', texis)
55 e.Alias ('doc', dvis)
56 e.Alias ('doc', pss)
57 e.Alias ('doc', pdfs)
58
59 #testing
60 all_sources = ['SConscript',] + sources
61 x = env.Tar (env['tarball'], all_sources)