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')
16 env.Depends ('doc', mfbuild)
18 png_stems = map (lambda x: os.path.splitext (x)[0], pngs)
19 epss = map (env.Png2eps, png_stems)
20 env.Depends ('lilypond.texi', epss)
22 lydir = Dir ('.').srcnode ().abspath + '/../../ly'
23 env.Command ('lilypond-internals.texi', env['LILYPOND_BIN'],
25 && LILYPONDPREFIX=$LILYPONDPREFIX $LILYPOND_BIN $__verbose \
26 $lydir/generate-documentation')
28 doc_stems = map (lambda x: os.path.splitext (x)[0], sources)
29 texis = map (env.Tely2texi, doc_stems)
30 dvis = map (env.Texi2dvi, doc_stems)
31 pss = map (env.PostScript, map (lambda x: x + '.dvi', doc_stems))
32 pdfs = map (env.Dvi2pdf, doc_stems)
35 def file_subst (file_name, find, subst):
36 s = open (file_name).read ()
37 t = string.replace (find, subst, s)
39 os.rename (file_name, file_name + '~')
40 h = open (file_name, "w")
45 e['usersrc'] = Dir ('.').srcnode ().abspath
46 def url_fixup (target, source, env):
47 file_subst (str (target[0]),
48 '\.\./lilypond-internals', 'lilypond-internals/')
49 a = ['$MAKEINFO -I$usersrc -I${SOURCE.dir} --html \
50 --css-include=$usersrc/../texinfo.css $__verbose \
51 --output=${TARGET.dir} $SOURCE',
52 '$MAKEINFO -I$usersrc -I${SOURCE.dir} --html --no-split --no-headers \
53 --css-include=$usersrc/../texinfo.css $__verbose \
54 --output=$TARGET $SOURCE',
56 'ln -f ${SOURCE.dir}/*.png ${SOURCE.dir}/*.ly ${TARGET.dir}/']
58 e.Command ('lilypond/lilypond.html', 'lilypond.texi', a)
59 e.Command ('lilypond-internals/lilypond-internals.html',
60 'lilypond-internals.texi', a)
62 env.Alias ('doc', texis)
63 env.Alias ('doc', dvis)
64 env.Alias ('doc', pss)
65 env.Alias ('doc', pdfs)
67 env.Alias ('doc', 'lilypond/lilypond.html')
68 env.Alias ('doc', 'lilypond-internals/lilypond-internals.html')