6
Import ('env', 'base_glob')
7
tely = base_glob ('*.tely')
8
png = base_glob ('*.png')
10
# We need lily and mf to build these.
11
env.Depends ('lilypond.texi', ['#/lily', '#/mf', '#/python'])
12
env.Depends ('music-glossary.texi', ['#/lily', '#/mf', '#/python'])
14
env.Depends ('lilypond.texi', 'lilypond-internals.texi')
16
eps = map (env.PNG2EPS, png)
17
env.Depends ('lilypond.texi', eps)
20
LILYPOND_BOOK_FLAGS = '''--process="lilypond --backend=eps --formats=ps,png --header=texidoc -I#/input/test -e '(ly:set-option (quote internal-type-checking) \#t)'"''',
21
__verbose = ' --verbose',
22
GENERATE_DOCUMENTATION = '$srcdir/ly/generate-documentation',
25
e.Command ('lilypond-internals.texi', ['#/lily', '#/mf', '#/python'],
26
'cd ${TARGET.dir} && $LILYPOND $GENERATE_DOCUMENTATION')
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)
36
info = map (env.INFO, tely)
38
def file_subst (file_name, find, subst):
39
s = open (file_name).read ()
40
t = string.replace (s, find, subst)
42
os.rename (file_name, file_name + '~')
43
h = open (file_name, "w")
47
e['usersrc'] = Dir ('.').srcnode ().abspath
48
e['userout'] = Dir ('.').abspath
50
a = ['$MAKEINFO -I$usersrc -I${SOURCE.dir} --html \
51
--css-include=$srcdir/Documentation/texinfo.css $__verbose \
52
--output=${TARGET.dir} $SOURCE',
53
'ln -f ${SOURCE.dir}/*.png ${SOURCE.dir}/*.ly ${TARGET.dir}/',]
55
e.Command ('lilypond/index.html', 'lilypond.texi', a)
56
e.Command ('lilypond-internals/index.html', 'lilypond-internals.texi', a)
57
e.Command ('music-glossary/index.html', 'music-glossary.texi', a)
59
a = ['$MAKEINFO -I$usersrc -I${SOURCE.dir} --html \
60
--no-split --no-headers \
61
--css-include=$srcdir/Documentation/texinfo.css $__verbose \
62
--output=$TARGET $SOURCE']
64
e.Command ('lilypond.html', 'lilypond.texi', a)
65
e.Command ('lilypond-internals.html', 'lilypond-internals.texi', a)
66
e.Command ('music-glossary.html', 'music-glossary.texi', a)
68
#Hmm -- why not just mv ./Documentation/{*,*/*} ./doc :-)
69
env.Alias ('doc', texi)
70
env.Alias ('doc', dvi)
72
env.Alias ('doc', pdf)
74
env.Alias ('doc', 'lilypond/index.html')
75
env.Alias ('doc', 'lilypond-internals/index.html')
76
env.Alias ('doc', 'lilypond.html')
77
env.Alias ('doc', 'lilypond-internals.html')
79
# install ('lilypond/*', env['sharedir_doc_package'] + '/html')
80
# install ('lilypond-user/*', env['sharedir_doc_package'] + '/html')