]> 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 pngs = glob.glob ('user/*.png')
12 os.chdir (here)
13
14 Import ('env')
15 e = env.Copy ()
16 outdir = os.path.join (env['build'], reldir, env['out'])
17
18 # Too late
19 e.Append (LILYPOND_BOOK_PATH = [os.path.join (env['srcdir'], reldir, 'user')])
20 e['LILYPOND_BOOK_PATH'].append (os.path.join (env['srcdir'], reldir, 'user'))
21
22
23
24 def verbose_opt (env, opt):
25         if env['verbose']:
26                 return opt
27         return ''
28
29 LILYPOND_BIN = env['LILYPOND_BIN']
30 LILYPONDPREFIX = env['LILYPONDPREFIX']
31
32
33 mfbuild = os.path.join (env['absbuild'], 'mf', env['out'])
34 lilybuild = os.path.join (env['absbuild'], 'lily', env['out'])
35 userbuild = os.path.join (env['absbuild'], 'Documentation/user', env['out'])
36 e.Depends ('user/lilypond.texi', os.path.join (mfbuild, 'feta16list.ly'))
37 e.Depends ('user/lilypond.texi', os.path.join (mfbuild, 'parmesan16list.ly'))
38 e.Depends ('lilypond.texi', 'lilypond-internals.texi')
39 e.Depends ('lilypond.texi', os.path.join (lilybuild, 'lilypond-bin'))
40
41 png_stems = map (lambda x: os.path.splitext (x)[0], pngs)
42 epss = map (e.Png2eps, png_stems)
43 e.Depends ('lilypond.texi', epss)
44
45 e.Command ('lilypond-internals.texi', LILYPOND_BIN,
46            ('(cd $$(dirname $TARGET) && \
47            LILYPONDPREFIX=%(LILYPONDPREFIX)s %(LILYPOND_BIN)s ' \
48             + verbose_opt (env, ' --verbose') \
49             + ' ' + os.path.join (env['srcdir'], 'ly/generate-documentation')\
50             + ')') % vars ())
51
52 doc_stems = map (lambda x: os.path.splitext (x)[0], sources)
53 texis = map (e.Tely2texi, doc_stems)
54 dvis = map (e.Texi2dvi, doc_stems)
55 pss = map (e.PostScript, map (lambda x: x + '.dvi', doc_stems))
56 pdfs = map (e.Dvi2pdf, doc_stems)
57
58 docdir = os.path.join (env['srcdir'], 'Documentation')
59 out = env['out']
60 # TODO: purl (ugh?), symlinks
61 a = ('makeinfo -I$$(dirname $SOURCE) \
62 --output=%(out)s/lilypond \
63 --css-include=%(docdir)s/texinfo.css \
64 --html' \
65      + verbose_opt (env, ' --verbose') \
66      + ' $SOURCE && \
67      makeinfo -I$$(dirname $SOURCE) \
68      --output=$TARGET \
69      --css-include=%(docdir)s/texinfo.css \
70      --html --no-split --no-headers' \
71      + verbose_opt (env, ' --verbose') \
72      + ' $SOURCE') % vars ()
73 #e.Command ('lilypond/lilypond.html',
74 #          'lilypond.texi',
75 e.Command ('user/lilypond/lilypond.html',
76            'user/lilypond.texi',
77 #          os.path.join (userbuild, 'lilypond.texi'),
78            a)
79
80 # TODO: purl (ugh?), symlinks
81 a = ('makeinfo -I$$(dirname $SOURCE) \
82 --output=%(out)s/lilypond-internals \
83 --css-include=%(docdir)s/texinfo.css \
84 --html' \
85      + verbose_opt (env, ' --verbose') \
86      + ' $SOURCE && \
87      makeinfo -I$$(dirname $SOURCE) \
88      --output=$TARGET \
89      --css-include=%(docdir)s/texinfo.css \
90      --html --no-split --no-headers' \
91      + verbose_opt (env, ' --verbose') \
92      + ' $SOURCE') % vars ()
93 #e.Command ('lilypond-internals/lilypond-internals.html',
94 #          'lilypond-internals.texi',
95 e.Command ('user/lilypond-internals/lilypond-internals.html',
96            'user/lilypond-internals.texi',
97 #          os.path.join (userbuild, 'lilypond-internals.texi'),
98            a)
99
100 e.Alias ('doc', texis)
101 e.Alias ('doc', dvis)
102 e.Alias ('doc', pss)
103 e.Alias ('doc', pdfs)
104
105 #e.Alias ('doc', 'user/lilypond-internals/lilypond.html')
106 #e.Alias ('doc', 'user/lilypond-internals/lilypond-internals.html')
107
108 #testing
109 all_sources = ['SConscript',] + sources
110 x = env.Tar (env['tarball'], all_sources)