]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/SConscript
* SConstruct (symlink): Add dvips and music-drawing-routines.ps.
[lilypond.git] / Documentation / user / SConscript
1 # -*-python-*-
2
3 import os
4 import string
5
6 Import ('env')
7 telys = env['glob'] (env, '*.tely')
8 pngs = env['glob'] (env, '*.png')
9
10 # We need lily and mf to build these.
11 env.Depends ('lilypond.texi', ['#/lily', '#/mf'])
12 env.Depends ('music-glossary.texi', ['#/lily', '#/mf'])
13
14 env.Depends ('lilypond.texi', 'lilypond-internals.texi')
15
16 epss = map (env.Png2eps, pngs)
17 env.Depends ('lilypond.texi', epss)
18
19 e = env.Copy (
20         LILYPOND_BOOK_FLAGS = '''--process="lilypond-bin -I$srcdir/input/test -e '(ly:set-option (quote internal-type-checking) \#t)'"''',
21         __verbose = ' --verbose',
22         )
23
24 e.Command ('lilypond-internals.texi', env['LILYPOND_BIN'],
25              'cd ${TARGET.dir} \
26              && LILYPONDPREFIX=$LILYPONDPREFIX $LILYPOND_BIN $__verbose \
27              $srcdir/ly/generate-documentation')
28
29 texis = map (env.TEXI, telys)
30 dvis = map (env.Texi2dvi, telys)
31 pss = map (env.PostScript, map (lambda x: x + '.dvi', telys))
32 pdfs = map (env.Dvi2pdf, telys)
33 infos = map (env.INFO, telys)
34
35 def file_subst (file_name, find, subst):
36         s = open (file_name).read ()
37         t = string.replace (s, find, subst)
38         if s != t:
39                 os.rename (file_name, file_name + '~')
40                 h = open (file_name, "w")
41                 h.write (t)
42                 h.close ()
43
44 e['usersrc'] = Dir ('.').srcnode ().abspath
45 e['userout'] = Dir ('.').abspath
46 def url_fixup (target, source, env):
47         file_subst (str (target[0]),
48                     '../lilypond-internals', 'lilypond-internals/')
49
50 a = ['$MAKEINFO -I$usersrc -I${SOURCE.dir} --html \
51      --css-include=$srcdir/Documentation/texinfo.css $__verbose \
52      --output=${TARGET.dir} $SOURCE',
53      '$MAKEINFO -I$usersrc -I${SOURCE.dir} --html \
54      --no-split --no-headers \
55      --css-include=$srcdir/Documentation/texinfo.css $__verbose \
56      --output=$TARGET $SOURCE',
57      url_fixup,
58      'ln -f ${SOURCE.dir}/*.png ${SOURCE.dir}/*.ly ${TARGET.dir}/',]
59
60 e.Command ('lilypond/lilypond.html', 'lilypond.texi', a)
61 e.Command ('lilypond-internals/lilypond-internals.html',
62            'lilypond-internals.texi', a)
63
64 #Hmm -- why not just mv ./Documentation/{*,*/*} ./doc :-)
65 env.Alias ('doc', texis)
66 env.Alias ('doc', dvis)
67 env.Alias ('doc', pss)
68 env.Alias ('doc', pdfs)
69
70 env.Alias ('doc', 'lilypond/lilypond.html')
71 env.Alias ('doc', 'lilypond-internals/lilypond-internals.html')
72
73 #dir = env['DESTDIR'] + env['sharedir_doc_package'] + '/html'
74 #env.Install (dir, 'lilypond')
75 #env.Install (dir, 'lilypond-user')
76 #env.Alias ('install', dir)