6 Import ('env', 'base_glob', 'src_glob')
7 tely = base_glob ('*.tely')
8 png = src_glob ('*.png') + map (env.EPS2PNG, base_glob ('*.eps'))
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 = src_glob ('*.eps') + map (env.PNG2EPS, base_glob ('*.png'))
17 env.Depends ('lilypond.texi', eps + png)
19 lilypond_book_flags = '''--format=$LILYPOND_BOOK_FORMAT --process="lilypond -I$srcdir/input/manual/ $__verbose --backend=eps --formats=ps,png --header=texidoc -dcheck-internal-types -ddump-signatures -danti-alias-factor=2 -dgs-load-fonts" '''
21 # LILYPOND_BOOK_FLAGS = '''--process="lilypond --backend=eps --formats=ps,png --header=texidoc -I#/input/manual -e '(ly:set-option (quote internal-type-checking) \#t)'"''',
22 LILYPOND_BOOK_FLAGS = lilypond_book_flags,
23 __verbose = ' --verbose',
24 GENERATE_DOCUMENTATION = '$srcdir/ly/generate-documentation',
25 ## TEXI2DVI_FLAGS = ['-I#Documentation/user'],
28 e.Command ('lilypond-internals.texi', ['#/lily', '#/mf', '#/python'],
29 'cd ${TARGET.dir} && $LILYPOND $GENERATE_DOCUMENTATION')
31 ## FIXME: implicit steps from [TE]LY -> PDF
32 texi = map (env.TEXI, tely)
33 dvi = map (env.TEXIDVI, tely)
34 ps = map (env.DVIPS, tely) ###map (lambda x: x + '.dvi', tely))
35 dvipdf = map (env.DVIPDF, tely)
36 pdf = map (env.PSPDF, dvipdf)
39 info = map (env.INFO, tely)
41 def file_subst (file_name, find, subst):
42 s = open (file_name).read ()
43 t = string.replace (s, find, subst)
45 os.rename (file_name, file_name + '~')
46 h = open (file_name, "w")
50 e['usersrc'] = Dir ('.').srcnode ().abspath
51 e['userout'] = Dir ('.').abspath
53 a = ['$MAKEINFO -I$usersrc -I${SOURCE.dir} --html \
54 --css-include=$srcdir/Documentation/texinfo.css $__verbose \
55 --output=${TARGET.dir} $SOURCE',
56 'ln -f ${SOURCE.dir}/*.png ${SOURCE.dir}/*.ly ${TARGET.dir}/',]
58 e.Command ('lilypond/index.html', 'lilypond.texi', a)
59 e.Command ('lilypond-internals/index.html', 'lilypond-internals.texi', a)
60 e.Command ('music-glossary/index.html', 'music-glossary.texi', a)
62 a = ['$MAKEINFO -I$usersrc -I${SOURCE.dir} --html \
63 --no-split --no-headers \
64 --css-include=$srcdir/Documentation/texinfo.css $__verbose \
65 --output=$TARGET $SOURCE']
67 e.Command ('lilypond.html', 'lilypond.texi', a)
68 e.Command ('lilypond-internals.html', 'lilypond-internals.texi', a)
69 e.Command ('music-glossary.html', 'music-glossary.texi', a)
71 #Hmm -- why not just mv ./Documentation/{*,*/*} ./doc :-)
72 env.Alias ('doc', texi)
73 env.Alias ('doc', dvi)
75 env.Alias ('doc', pdf)
77 env.Alias ('doc', 'lilypond/index.html')
78 env.Alias ('doc', 'lilypond-internals/index.html')
79 env.Alias ('doc', 'lilypond.html')
80 env.Alias ('doc', 'lilypond-internals.html')
82 # install ('lilypond/*', env['sharedir_doc_package'] + '/html')
83 # install ('lilypond-user/*', env['sharedir_doc_package'] + '/html')