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'])
12 env.Depends ('music-glossary.texi', ['#/lily', '#/mf'])
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-bin -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'],
26 'cd ${TARGET.dir} && $LILYPOND_BIN $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
49 def url_fixup (target, source, env):
50 file_subst (str (target[0]),
51 '../lilypond-internals', 'lilypond-internals/')
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',
62 'ln -f ${SOURCE.dir}/*.png ${SOURCE.dir}/*.ly ${TARGET.dir}/',]
64 e.Command ('lilypond/lilypond.html', 'lilypond.texi', a)
65 e.Command ('lilypond-internals/lilypond-internals.html',
66 'lilypond-internals.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/lilypond.html')
75 env.Alias ('doc', 'lilypond-internals/lilypond-internals.html')
77 # install ('lilypond/*', env['sharedir_doc_package'] + '/html')
78 # install ('lilypond-user/*', env['sharedir_doc_package'] + '/html')