]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/user/SConscript
* SConstruct (symlink): Add dvips and music-drawing-routines.ps.
[lilypond.git] / Documentation / user / SConscript
index fd2359b523eee606c48493d22b1e08fd0fe3d162..7c8fc75b840449c6b394e1f9790c42df8ae5de1f 100644 (file)
@@ -4,61 +4,64 @@ import os
 import string
 
 Import ('env')
-sources = env['src_glob'] (env, '*.tely')
-pngs = env['src_glob'] (env, '*.png')
+telys = env['glob'] (env, '*.tely')
+pngs = env['glob'] (env, '*.png')
 
-mfbuild = os.path.join (env['absbuild'], 'mf', env['out'])
-lilybuild = os.path.join (env['absbuild'], 'lily', env['out'])
-userbuild = os.path.join (env['absbuild'], 'Documentation/user', env['out'])
+# We need lily and mf to build these.
+env.Depends ('lilypond.texi', ['#/lily', '#/mf'])
+env.Depends ('music-glossary.texi', ['#/lily', '#/mf'])
 
-env.Depends ('lilypond.texi', env['LILYPOND_BIN'])
 env.Depends ('lilypond.texi', 'lilypond-internals.texi')
-env.Depends ('doc', mfbuild)
 
-png_stems = map (lambda x: os.path.splitext (x)[0], pngs)
-epss = map (env.Png2eps, png_stems)
+epss = map (env.Png2eps, pngs)
 env.Depends ('lilypond.texi', epss)
 
-lydir = Dir ('.').srcnode ().abspath + '/../../ly'
-env.Command ('lilypond-internals.texi', env['LILYPOND_BIN'],
+e = env.Copy (
+       LILYPOND_BOOK_FLAGS = '''--process="lilypond-bin -I$srcdir/input/test -e '(ly:set-option (quote internal-type-checking) \#t)'"''',
+       __verbose = ' --verbose',
+       )
+
+e.Command ('lilypond-internals.texi', env['LILYPOND_BIN'],
             'cd ${TARGET.dir} \
             && LILYPONDPREFIX=$LILYPONDPREFIX $LILYPOND_BIN $__verbose \
-            $lydir/generate-documentation')
-
-doc_stems = map (lambda x: os.path.splitext (x)[0], sources)
-texis = map (env.Tely2texi, doc_stems)
-dvis = map (env.Texi2dvi, doc_stems)
-pss = map (env.PostScript, map (lambda x: x + '.dvi', doc_stems))
-pdfs = map (env.Dvi2pdf, doc_stems)
+            $srcdir/ly/generate-documentation')
 
+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)
 
 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
+e['userout'] = Dir ('.').abspath
 def url_fixup (target, source, env):
        file_subst (str (target[0]),
-                   '\.\./lilypond-internals', 'lilypond-internals/')
+                   '../lilypond-internals', 'lilypond-internals/')
+
 a = ['$MAKEINFO -I$usersrc -I${SOURCE.dir} --html \
---css-include=$usersrc/../texinfo.css $__verbose \
---output=${TARGET.dir} $SOURCE',
-     '$MAKEINFO -I$usersrc -I${SOURCE.dir} --html --no-split --no-headers \
-     --css-include=$usersrc/../texinfo.css $__verbose \
+     --css-include=$srcdir/Documentation/texinfo.css $__verbose \
+     --output=${TARGET.dir} $SOURCE',
+     '$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}/']
-     
+     '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)
+          'lilypond-internals.texi', a)
 
+#Hmm -- why not just mv ./Documentation/{*,*/*} ./doc :-)
 env.Alias ('doc', texis)
 env.Alias ('doc', dvis)
 env.Alias ('doc', pss)
@@ -66,3 +69,8 @@ env.Alias ('doc', pdfs)
 
 env.Alias ('doc', 'lilypond/lilypond.html')
 env.Alias ('doc', 'lilypond-internals/lilypond-internals.html')
+
+#dir = env['DESTDIR'] + env['sharedir_doc_package'] + '/html'
+#env.Install (dir, 'lilypond')
+#env.Install (dir, 'lilypond-user')
+#env.Alias ('install', dir)