here = os.getcwd ()
reldir = str (Dir ('.').srcnode ())
os.chdir (reldir)
-sources = glob.glob ('*.tely') + glob.glob ('user/*.tely')
+###sources = glob.glob ('*.tely') + glob.glob ('user/*.tely')
+sources = ['user/lilypond.tely', 'user/music-glossary.tely']
os.chdir (here)
Import ('env')
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'])
e.Depends ('user/lilypond.texi', os.path.join (mfbuild, 'feta16list.ly'))
e.Depends ('user/lilypond.texi', os.path.join (mfbuild, 'parmesan16list.ly'))
+##e.Depends ('lilypond.texi', os.path.join (userbuild, 'music-glossary.texi'))
e.Depends ('lilypond.texi', 'lilypond-internals.texi')
+e.Depends ('lilypond.texi', os.path.join (lilybuild, 'lilypond-bin'))
e.Command ('lilypond-internals.texi', LILYPOND_BIN,
('(cd $$(dirname $TARGET) && \
+ ' ' + os.path.join (env['srcdir'], 'ly/generate-documentation')\
+ ')') % vars ())
-docs = e.Tely2pdf (sources)
+doc_stems = map (lambda x: os.path.splitext (x)[0], sources)
+texis = map (e.Tely2texi, doc_stems)
+dvis = map (e.Texi2dvi, doc_stems)
+pss = map (e.PostScript, doc_stems)
+pdfs = map (e.Dvi2pdf, doc_stems)
-e.Alias ('doc', docs)
+e.Alias ('doc', texis)
+e.Alias ('doc', dvis)
+e.Alias ('doc', pss)
+e.Alias ('doc', pdfs)
#testing
all_sources = ['SConscript',] + sources
# TODO:
+# * separate environments?
+# - compile environment checks headers and libraries
+# - doc environment checks doc stuff
+#
# * running from build-dir, without installing?
# - scons will not install, if PREFIX lives outside of CWD
# - build symlink tree
'#/Documentation/user',
os.path.join (absbuild, 'Documentation', out)]
+env['MAKEINFO_PATH'] = ['.', '#/Documentation/user',
+ os.path.join (absbuild, 'Documentation', out)]
+
## TEXINFO_PAPERSIZE_OPTION= $(if $(findstring $(PAPERSIZE),a4),,-t @afourpaper)
-env['TEXINFO_PAPERSIZE_OPTION'] = '-t@afourpaper'
+env['TEXINFO_PAPERSIZE_OPTION'] = '-t @afourpaper'
SConscript ('buildscripts/builder.py')
return x
return string.join (map (lambda x: prefix + dir (x), path), infix)
+MAKEINFO_INCLUDES = join_path (env['MAKEINFO_PATH'], '', ' -I')
a = env['MAKEINFO'] + verbose_opt (env, ' --verbose') \
+ + MAKEINFO_INCLUDES \
+ ' --no-split --no-headers --output=$TARGET $SOURCE'
texi2txt = Builder (action = a, suffix = '.txt', src_suffix = '.texi')
env.Append (ENV = {'TEXMF' : '{' + LILYPONDPREFIX + ',' \
+ os.popen ('kpsexpand \$TEXMF').read ()[:-1] + '}' })
+## + ' --output=$$(basename $TARGET) --format=%(LILYPOND_BOOK_FORMAT)s\
a = (r'''rm -f $$(grep -LF '\lilypondend' $$(dirname $TARGET))/lily-*.tex 2>/dev/null;''' \
+ 'LILYPONDPREFIX=%(LILYPONDPREFIX)s '\
+ PYTHON + ' ' + LILYPOND_BOOK + verbose_opt (env, ' --verbose')\
+ ' --include=$$(dirname $TARGET) %(LILYPOND_BOOK_INCLUDES)s'\
+ r""" --process='%(LILYPOND_BIN)s %(LILYPOND_BOOK_INCLUDES)s'"""\
- + ' --output=$$(basename $TARGET) --format=%(LILYPOND_BOOK_FORMAT)s\
+ + ' --output=$$(dirname $TARGET) --format=%(LILYPOND_BOOK_FORMAT)s\
%(LILYPOND_BOOK_FLAGS)s\
$SOURCE') % vars ()
-
-tely2pdf = Builder (action = a, suffix = '.texi', src_suffix = '.tely')
-
-env.Append (BUILDERS = {'Tely2pdf': tely2pdf})
+tely2texi = Builder (action = a, suffix = '.texi', src_suffix = '.tely')
+env.Append (BUILDERS = {'Tely2texi': tely2texi})
TEXINFO_PAPERSIZE_OPTION = env['TEXINFO_PAPERSIZE_OPTION']
a = '(cd $$(dirname $TARGET) &&\
- texi2dvi --batch %(TEXINFO_PAPERSIZE_OPTION)s $$(basename $SOURCE)' % vars ()
-
+ texi2dvi --batch %(TEXINFO_PAPERSIZE_OPTION)s $$(basename $SOURCE))' % vars ()
texi2dvi = Builder (action = a, suffix = '.dvi', src_suffix = '.texi')
-
env.Append (BUILDERS = {'Texi2dvi': texi2dvi})
-
-# $(outdir)/lilypond/lilypond.html: $(outdir)/lilypond.texi
-# mkdir -p $(dir $@)
-# $(MAKEINFO) -I$(outdir) --output=$(outdir)/lilypond --css-include=$(builddir)/Documentation/texinfo.css --html $<
-# $(MAKEINFO) -I$(outdir) --output=$@ --css-include=$(builddir)/Documentation/texinfo.css --html --no-split --no-headers $<
-# perl -i~ -pe 's!../lilypond-internals!lilypond-internals/!g' $(outdir)/lilypond.html
-# rm -f $(outdir)/lilypond/*.png $(outdir)/lilypond/*.ly
-# -ln -f $(outdir)/*.png $(outdir)/*.ly $(outdir)/lilypond/
-
+env.Append (DVIPSFLAGS = '-Ppdf -ta4 +u lilypond.map')
+
+DVIPS_PAPERSIZE = 'a4'
+DVIPSFLAGS = env['DVIPSFLAGS']
+a = ('dvips %(DVIPSFLAGS)s' \
+ + ' -o $TARGET.pdfps'\
+ + ' -t %(DVIPS_PAPERSIZE)s $SOURCE &&'\
+ + ' ps2pdf -sPAPERSIZE=%(DVIPS_PAPERSIZE)s $TARGET.pdfps $TARGET') \
+ % vars ()
+dvi2pdf = Builder (action = a, suffix = '.pdf', src_suffix = '.dvi')
+env.Append (BUILDERS = {'Dvi2pdf': dvi2pdf})
def command_name (cmd):
- # deal with "((latex ) >& 1 ) .." too
+ # deal with "((latex ) >& 1 ) .." too
cmd = re.match ("([\(\)]*)([^ ]*)", cmd).group(2)
return os.path.split (cmd)[1]