]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/SConscript
(note): Remove
[lilypond.git] / Documentation / user / SConscript
1 # -*-python-*-
2
3 import os
4 import string
5
6 Import ('env', 'base_glob')
7 tely = base_glob ('*.tely')
8 png = base_glob ('*.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 eps = map (env.PNG2EPS, png)
17 env.Depends ('lilypond.texi', eps)
18
19 e = env.Copy (
20         LILYPOND_BOOK_FLAGS = '''--process="lilypond-bin -I#/input/test -e '(ly:set-option (quote internal-type-checking) \#t)'"''',
21         __verbose = ' --verbose',
22         GENERATE_DOCUMENTATION = '$srcdir/ly/generate-documentation',
23         )
24
25 e.Command ('lilypond-internals.texi', ['#/lily', '#/mf'],
26            'cd ${TARGET.dir} && $LILYPOND_BIN $GENERATE_DOCUMENTATION')
27
28 ## FIXME: implicit steps from [TE]LY -> PDF
29 texi = map (env.TEXI, tely)
30 dvi = map (env.TEXIDVI, tely)
31 ps = map (env.DVIPS, tely) ###map (lambda x: x + '.dvi', tely))
32 dvipdf = map (env.DVIPDF, tely)
33 pdf = map (env.PSPDF, dvipdf)
34
35 # FIXME: install
36 info = map (env.INFO, tely)
37
38 def file_subst (file_name, find, subst):
39         s = open (file_name).read ()
40         t = string.replace (s, find, subst)
41         if s != t:
42                 os.rename (file_name, file_name + '~')
43                 h = open (file_name, "w")
44                 h.write (t)
45                 h.close ()
46
47 e['usersrc'] = Dir ('.').srcnode ().abspath
48 e['userout'] = Dir ('.').abspath
49 def url_fixup (target, source, env):
50         file_subst (str (target[0]),
51                     '../lilypond-internals', 'lilypond-internals/')
52
53 # fixme: see builder.py
54 a = ['$MAKEINFO -I$usersrc -I${SOURCE.dir} --html \
55      --css-include=$srcdir/Documentation/texinfo.css $__verbose \
56      --output=${TARGET.dir} $SOURCE',
57      '$MAKEINFO -I$usersrc -I${SOURCE.dir} --html \
58      --no-split --no-headers \
59      --css-include=$srcdir/Documentation/texinfo.css $__verbose \
60      --output=$TARGET $SOURCE',
61      url_fixup,
62      'ln -f ${SOURCE.dir}/*.png ${SOURCE.dir}/*.ly ${TARGET.dir}/',]
63
64 e.Command ('lilypond/lilypond.html', 'lilypond.texi', a)
65 e.Command ('lilypond-internals/lilypond-internals.html',
66            'lilypond-internals.texi', a)
67
68 #Hmm -- why not just mv ./Documentation/{*,*/*} ./doc :-)
69 env.Alias ('doc', texi)
70 env.Alias ('doc', dvi)
71 env.Alias ('doc', ps)
72 env.Alias ('doc', pdf)
73
74 env.Alias ('doc', 'lilypond/lilypond.html')
75 env.Alias ('doc', 'lilypond-internals/lilypond-internals.html')
76
77 # install ('lilypond/*', env['sharedir_doc_package'] + '/html')
78 # install ('lilypond-user/*', env['sharedir_doc_package'] + '/html')