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