7 sources = env['src_glob'] (env, '*.tely')
8 pngs = env['src_glob'] (env, '*.png')
10 mfbuild = os.path.join (env['absbuild'], 'mf', env['out'])
11 lilybuild = os.path.join (env['absbuild'], 'lily', env['out'])
12 userbuild = os.path.join (env['absbuild'], 'Documentation/user', env['out'])
14 env.Depends ('lilypond.texi', env['LILYPOND_BIN'])
15 env.Depends ('lilypond.texi', 'lilypond-internals.texi')
17 png_stems = map (lambda x: os.path.splitext (x)[0], pngs)
18 epss = map (env.Png2eps, png_stems)
19 env.Depends ('lilypond.texi', epss)
21 lydir = Dir ('.').srcnode ().abspath + '/../../ly'
22 env.Command ('lilypond-internals.texi', env['LILYPOND_BIN'],
24 && LILYPONDPREFIX=$LILYPONDPREFIX $LILYPOND_BIN $__verbose \
25 $lydir/generate-documentation')
27 doc_stems = map (lambda x: os.path.splitext (x)[0], sources)
28 texis = map (env.TEXI, doc_stems)
29 dvis = map (env.Texi2dvi, doc_stems)
30 pss = map (env.PostScript, map (lambda x: x + '.dvi', doc_stems))
31 pdfs = map (env.Dvi2pdf, doc_stems)
34 def file_subst (file_name, find, subst):
35 s = open (file_name).read ()
36 t = string.replace (find, subst, s)
38 os.rename (file_name, file_name + '~')
39 h = open (file_name, "w")
44 e['usersrc'] = Dir ('.').srcnode ().abspath
45 def url_fixup (target, source, env):
46 file_subst (str (target[0]),
47 '\.\./lilypond-internals', 'lilypond-internals/')
48 a = ['$MAKEINFO -I$usersrc -I${SOURCE.dir} --html \
49 --css-include=$usersrc/../texinfo.css $__verbose \
50 --output=${TARGET.dir} $SOURCE',
51 '$MAKEINFO -I$usersrc -I${SOURCE.dir} --html --no-split --no-headers \
52 --css-include=$usersrc/../texinfo.css $__verbose \
53 --output=$TARGET $SOURCE',
55 'ln -f ${SOURCE.dir}/*.png ${SOURCE.dir}/*.ly ${TARGET.dir}/']
57 e.Command ('lilypond/lilypond.html', 'lilypond.texi', a)
58 e.Command ('lilypond-internals/lilypond-internals.html',
59 'lilypond-internals.texi', a)
61 env.Alias ('doc', texis)
62 env.Alias ('doc', dvis)
63 env.Alias ('doc', pss)
64 env.Alias ('doc', pdfs)
66 env.Alias ('doc', 'lilypond/lilypond.html')
67 env.Alias ('doc', 'lilypond-internals/lilypond-internals.html')