import os
import string
-Import ('env')
-telys = env['glob'] (env, '*.tely')
-pngs = env['glob'] (env, '*.png')
+Import ('env', 'base_glob')
+tely = base_glob ('*.tely')
+png = base_glob ('*.png')
+
+# We need lily and mf to build these.
+env.Depends ('lilypond.texi', ['#/lily', '#/mf', '#/python'])
+env.Depends ('music-glossary.texi', ['#/lily', '#/mf', '#/python'])
-env.Depends ('lilypond.texi', env['LILYPOND_BIN'])
env.Depends ('lilypond.texi', 'lilypond-internals.texi')
-epss = map (env.Png2eps, pngs)
-env.Depends ('lilypond.texi', epss)
+eps = map (env.PNG2EPS, png)
+env.Depends ('lilypond.texi', eps)
+
+e = env.Copy (
+ LILYPOND_BOOK_FLAGS = '''--process="lilypond --backend=eps --formats=ps,png --header=texidoc -I#/input/test -e '(ly:set-option (quote internal-type-checking) \#t)'"''',
+ __verbose = ' --verbose',
+ GENERATE_DOCUMENTATION = '$srcdir/ly/generate-documentation',
+ )
+
+e.Command ('lilypond-internals.texi', ['#/lily', '#/mf', '#/python'],
+ 'cd ${TARGET.dir} && $LILYPOND $GENERATE_DOCUMENTATION')
-env.Command ('lilypond-internals.texi', env['LILYPOND_BIN'],
- 'cd ${TARGET.dir} \
- && LILYPONDPREFIX=$LILYPONDPREFIX $LILYPOND_BIN $__verbose \
- $srcdir/ly/generate-documentation')
+## FIXME: implicit steps from [TE]LY -> PDF
+texi = map (env.TEXI, tely)
+dvi = map (env.TEXIDVI, tely)
+ps = map (env.DVIPS, tely) ###map (lambda x: x + '.dvi', tely))
+dvipdf = map (env.DVIPDF, tely)
+pdf = map (env.PSPDF, dvipdf)
-texis = map (env.TEXI, telys)
-dvis = map (env.Texi2dvi, telys)
-pss = map (env.PostScript, map (lambda x: x + '.dvi', telys))
-pdfs = map (env.Dvi2pdf, telys)
-infos = map (env.INFO, telys)
+# FIXME: install
+info = map (env.INFO, tely)
def file_subst (file_name, find, subst):
s = open (file_name).read ()
- t = string.replace (find, subst, s)
+ t = string.replace (s, find, subst)
if s != t:
os.rename (file_name, file_name + '~')
h = open (file_name, "w")
h.write (t)
h.close ()
-e = env.Copy ()
e['usersrc'] = Dir ('.').srcnode ().abspath
-def url_fixup (target, source, env):
- file_subst (str (target[0]),
- '../lilypond-internals', 'lilypond-internals/')
-a = ['$MAKEINFO -I$srcdir/Documenation/user -I${SOURCE.dir} --html \
---css-include=$srcdir/Documentation/texinfo.css $__verbose \
---output=${TARGET.dir} $SOURCE',
- '$MAKEINFO -I$srcdir/Documentation/user -I${SOURCE.dir} --html \
+e['userout'] = Dir ('.').abspath
+
+a = ['$MAKEINFO -I$usersrc -I${SOURCE.dir} --html \
+ --css-include=$srcdir/Documentation/texinfo.css $__verbose \
+ --output=${TARGET.dir} $SOURCE',
+ 'ln -f ${SOURCE.dir}/*.png ${SOURCE.dir}/*.ly ${TARGET.dir}/',]
+
+e.Command ('lilypond/index.html', 'lilypond.texi', a)
+e.Command ('lilypond-internals/index.html', 'lilypond-internals.texi', a)
+e.Command ('music-glossary/index.html', 'music-glossary.texi', a)
+
+a = ['$MAKEINFO -I$usersrc -I${SOURCE.dir} --html \
--no-split --no-headers \
- --css-include=$srcdir/Documentation/../texinfo.css $__verbose \
- --output=$TARGET $SOURCE',
- url_fixup,
- 'ln -f ${SOURCE.dir}/*.png ${SOURCE.dir}/*.ly ${TARGET.dir}/']
-
-e.Command ('lilypond/lilypond.html', 'lilypond.texi', a)
-e.Command ('lilypond-internals/lilypond-internals.html',
- 'lilypond-internals.texi', a)
-
-env.Alias ('doc', texis)
-env.Alias ('doc', dvis)
-env.Alias ('doc', pss)
-env.Alias ('doc', pdfs)
-
-env.Alias ('doc', 'lilypond/lilypond.html')
-env.Alias ('doc', 'lilypond-internals/lilypond-internals.html')
+ --css-include=$srcdir/Documentation/texinfo.css $__verbose \
+ --output=$TARGET $SOURCE']
+
+e.Command ('lilypond.html', 'lilypond.texi', a)
+e.Command ('lilypond-internals.html', 'lilypond-internals.texi', a)
+e.Command ('music-glossary.html', 'music-glossary.texi', a)
+
+#Hmm -- why not just mv ./Documentation/{*,*/*} ./doc :-)
+env.Alias ('doc', texi)
+env.Alias ('doc', dvi)
+env.Alias ('doc', ps)
+env.Alias ('doc', pdf)
+
+env.Alias ('doc', 'lilypond/index.html')
+env.Alias ('doc', 'lilypond-internals/index.html')
+env.Alias ('doc', 'lilypond.html')
+env.Alias ('doc', 'lilypond-internals.html')
+
+# install ('lilypond/*', env['sharedir_doc_package'] + '/html')
+# install ('lilypond-user/*', env['sharedir_doc_package'] + '/html')