+2004-07-15 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ * SConstruct: Further development.
+
+ * input/test/SConscript:
+ * input/template/SConscript:
+ * input/regression/SConscript:
+ * Documentation/bibliography/SConscript:
+ * Documentation/bibliography/index.html.in: New file.
+
+ * Documentation/bibliography/GNUmakefile (local-WWW): Remove index
+ generation.
+
+ * buildscripts/builder.py: Add new builders.
+
+ * make/stepmake.make:
+ * stepmake/stepmake/*.make:
+ * configure.in:
+ * lily/*:
+ * flower*: Use config.hh (Was config.h).
+
+ * scm/encoding.scm (get-coding): Print friendly error message when
+ no encoding is found, rather than crashing.
+
2004-07-15 Han-Wen Nienhuys <hanwen@xs4all.nl>
* lily/new-slur.cc (score_slopes): strong sloping score only when
GENHTMLS = engraving colorado computer-notation
OUTGENHTMLS = $(addprefix $(outdir)/, $(GENHTMLS:%=%.html))
-
-local-WWW: $(addprefix $(outdir)/, $(BIB_FILES:.bib=.html))
- $(PYTHON) $(step-bindir)/ls-latex.py --title 'References on Music Notation' \
- $(YO_FILES) $(OUTYO_FILES:.yo=.latex) $(BIB_FILES) $(DOC_FILES) $(TEX_FILES) \
- | sed "s!$(outdir)/!!g" > $(outdir)/index.html
+local-WWW: $(addprefix $(outdir)/, $(BIB_FILES:.bib=.html) index.html)
$(outdir)/%.bib: %.bib
ln -f $< $@
--- /dev/null
+# -*-python-*-
+
+Import ('env')
+bibs = env['src_glob'] (env, '*.bib')
+env.AT_COPY ('index.html.in')
+
+map (env.BIB2HTML, bibs)
+env.Alias ('doc', bibs)
+
--- /dev/null
+<html><title>References on Music Notation</title>
+ <body>
+ <h1> References on Music Notation</h1>
+ <ul>
+ <li>colorado.bib:
+ University of Colorado Engraving music bibliography
+ <p>
+ by Alyssa Lamb (edited & converted to bibtex by HWN)
+ </p>
+ (<a href=colorado.html>HTML</a>)
+ </li>
+ <li>computer-notation.bib:
+ The music notation with computer bibliography
+ <p>
+ by Han-Wen Nienhuys
+ </p>
+ (<a href=computer-notation.html>HTML</a>)
+ </li>
+ <li>engraving.bib:
+ The engraving bibliography
+ <p>
+ by Han-Wen Nienhuys
+ </p>
+ (<a href=engraving.html>HTML</a>)
+ </li>
+ </ul>
+ </body>
+</html>
epss = map (env.Png2eps, pngs)
env.Depends ('lilypond.texi', epss)
-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 \
$srcdir/ly/generate-documentation')
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]),
e.Command ('lilypond-internals/lilypond-internals.html',
'lilypond-internals.texi', a)
+#Hmm -- why not just mv ./Documentation/{*,*/*} ./doc :-)
env.Alias ('doc', texis)
env.Alias ('doc', dvis)
env.Alias ('doc', pss)
# -*-python-*-
'''
-Experimental scons (www.scons.org) building:
+Experimental scons (www.scons.org) building.
-scons TARGET builds from source directory ./TARGET (not recursive)
+Usage
+ scons TARGET
-Usage:
- scons
- scons lily # build lily
+build from source directory ./TARGET (not recursive)
- LILYPONDPREFIX=out-scons/usr/share/lilypond lily/out-scons/lilypond-bin
- scons doc # build web doc
+Configure, build
-? scons fonts # build all font stuff (split this? )
+ scons [config] # configure
+ scons # build all
- scons config # reconfigure
+Run from build tree
- scons / # builds all possible targets
+ run=$(pwd)/out-scons/usr
+ export LOCALE=$run/share/locale
+ export TEXMF='{'$run/share/lilypond,$(kpsexpand '$TEXMF')'}'
+ PATH=$run/bin:$PATH
- scons install
- scons -c # clean
- scons -h # help
+ #optionally, if you do not use custom.py below
+ #export LILYPONDPREFIX=$run/share/lilypond
- scons build=DIR # scrdir build, write to new tree =build
- scons out=DIR # write output to deeper dir DIR
+ lilypond-bin input/simple
-Optionally, make a custom.py. I have
+Other targets
+ scons mf-essential # build minimal mf stuff
+
+ scons doc # build web doc
+ scons config # reconfigure
+ scons install # install
+ scons -c # clean
+ scons -h # help
+
+ scons / # build *everything* (including installation)
+
+Options (see scons -h)
+ scons build=DIR # clean scrdir build, output below DIR
+ scons out=DIR # write output for alterative config to DIR
+
+Optional custom.py
import os
out='out-scons'
# TODO:
-# * add missing dirs
-# * cleanup
+# * add missing dirs:
+# - input/mutopia
+# - vim
+# * more program configure tests (mfont, ...?)
-# * separate environments?
-# - compile environment checks headers and libraries
-# - doc environment checks doc stuff
+# * more fine-grained config.hh -- move lilypondprefix to version.hh?
+# - config.hh: changes after system upgrades, affects all files
+# - version.hh: prefix, version etc? affects few
+
+# * grep FIXME $(find . -name 'S*t')
-# * commandline targets:
-# - clean => -c ?
-# * more fine-grained config.h -- move lilypondprefix to version.hh?
-# - config.h: changes after system upgrades, affects all files
-# - version.hh: prefix, version etc? affects few
import re
import glob
import stat
import shutil
-# faster but scary: when changing #includes, do scons --implicit-deps-changed
-# SetOption ('implicit_cache', 1)
+# duh, we need 0.95.1
+EnsureSConsVersion (0, 95)
# SConscripts are only needed in directories where something needs
# to be done, building or installing
-# TODO: Documentation/*, input/*/*, vim, po
-# rename Documentation/* to ./doc?
-
-# somethin's broken wrt config.h checksums?
-FOOSUMS = 1
+subdirs = ['flower', 'lily', 'mf', 'scm', 'ly',
+ 'scripts', 'elisp', 'buildscripts', 'po',
+ 'Documentation', 'Documentation/user', 'Documentation/topdocs',
+ 'Documentation/bibliography',
+ 'input', 'input/regression', 'input/test', 'input/template',
+ 'cygwin', 'debian',
+ ]
-subdirs = ['flower', 'lily', 'mf', 'scm', 'ly', 'Documentation',
- 'Documentation/user', 'Documentation/topdocs',
- 'input', 'scripts', 'elisp',
- 'buildscripts', 'cygwin', 'debian', 'po']
usage = r'''Usage:
-scons [KEY=VALUE].. [TARGET]..
+scons [KEY=VALUE].. [TARGET|DIR]..
+
+TARGETS: clean, config, doc, dist, install, mf-essential, po-update,
+ realclean, release, tar, TAGS
-where TARGET is config|lily|all|fonts|doc|tar|dist|release
'''
'CXXFLAGS',
'DEFINES',
'LIBS',
+ 'LINKFLAGS',
'METAFONT',
'PERL',
'PYTHON',
)
# Put your favourite stuff in custom.py
-CacheDir ("buildcache")
opts = Options ([config_cache, 'custom.py'], ARGUMENTS)
opts.Add ('prefix', 'Install prefix', '/usr/')
opts.Add ('out', 'Output directory', 'out-scons')
ENV = { 'PATH' : os.environ['PATH'] }
for key in ['LD_LIBRARY_PATH', 'GUILE_LOAD_PATH', 'PKG_CONFIG_PATH']:
- if os.environ.has_key(key):
+ if os.environ.has_key (key):
ENV[key] = os.environ[key]
env = Environment (
Help (usage + opts.GenerateHelpText (env))
+# Add all config_vars to opts, so that they will be read and saved
+# together with the other configure options.
map (lambda x: opts.AddOptions ((x,)), config_vars)
opts.Update (env)
+env['checksums'] = 1
if env['checksums']:
SetOption ('max_drift', 0)
+absbuild = Dir (env['build']).abspath
+outdir = os.path.join (Dir (env['build']).abspath, env['out'])
+run_prefix = os.path.join (absbuild, os.path.join (env['out'], 'usr'))
+
+CacheDir (os.path.join (outdir, 'build-cache'))
+
+if env['debugging']:
+ # No need to set $LILYPONDPREFIX to run lily, but cannot install...
+ env['prefix'] = run_prefix
+
prefix = env['prefix']
bindir = os.path.join (prefix, 'bin')
sharedir = os.path.join (prefix, 'share')
sharedir_package_version = sharedir_package_version,
)
-env.CacheDir (os.path.join (env['build'], '=build-cache'))
-
if env['debugging']:
env.Append (CFLAGS = '-g')
env.Append (CXXFLAGS = '-g')
if env['optimising']:
env.Append (CFLAGS = '-O2')
- env.Append (CXXFLAGS = '-O2')
- env.Append (CXXFLAGS = '-DSTRING_UTILS_INLINED')
+ env.Append (CXXFLAGS = ['-O2', '-DSTRING_UTILS_INLINED'])
if env['warnings']:
- env.Append (CFLAGS = '-W ')
- env.Append (CFLAGS = '-Wall')
- # what about = ['-W', '-Wall', ...]?
- env.Append (CXXFLAGS = '-W')
- env.Append (CXXFLAGS = '-Wall')
- env.Append (CXXFLAGS = '-Wconversion')
+ env.Append (CFLAGS = ['-W', '-Wall'])
+ # CXXFLAGS = $CFLAGS ...
+ env.Append (CXXFLAGS = ['-W', '-Wall', '-Wconversion'])
+env.Append (LINKFLAGS = ['-Wl,--export-dynamic'])
if env['verbose']:
- env['__verbose'] = '--verbose'
+ env['__verbose'] = ' --verbose'
+ env['set__x'] = 'set -x;'
-# Hmm
-#env.Append (ENV = {'PKG_CONFIG_PATH' : string.join (env['PKG_CONFIG_PATH'],
-# os.pathsep),
-# 'LD_LIBRARY_PATH' : string.join (env['LD_LIBRARY_PATH'],
-# os.pathsep),
-# 'GUILE_LOAD_PATH' : string.join (env['GUILE_LOAD_PATH'],
-# os.pathsep), })
-
-outdir = os.path.join (Dir (env['build']).abspath, env['out'])
-
-# This is interesting, version.hh is generated automagically, just in
-# time. Is this a .h /.hh issue? It seems to be, using config.hh (in
-# flower/file-name.cc) works. Bug report to SCons or rename to
-# config.hh or both?
-# config_h = os.path.join (outdir, 'config.hh')
-config_h = os.path.join (outdir, 'config.h')
-version_h = os.path.join (outdir, 'version.hh')
+config_hh = os.path.join (outdir, 'config.hh')
+version_hh = os.path.join (outdir, 'version.hh')
env.Alias ('config', config_cache)
-## Explicit dependencies
+## Explicit target and dependencies
+if 'clean' in COMMAND_LINE_TARGETS:
+ # ugh: prevent reconfigure instead of clean
+ os.system ('touch %s' % config_cache)
+
+ command = sys.argv[0] + ' -c .'
+ sys.stdout.write ('Running %s ... ' % command)
+ sys.stdout.write ('\n')
+ s = os.system (command)
+ if os.path.exists (config_cache):
+ os.unlink (config_cache)
+ Exit (s)
+
+if 'realclean' in COMMAND_LINE_TARGETS:
+ command = 'rm -rf $(find . -name "out-scons" -o -name ".scon*")'
+ sys.stdout.write ('Running %s ... ' % command)
+ sys.stdout.write ('\n')
+ s = os.system (command)
+ if os.path.exists (config_cache):
+ os.unlink (config_cache)
+ Exit (s)
+
# Without target arguments, build lily only
if not COMMAND_LINE_TARGETS:
env.Default ('lily')
'Documentation/user',
'Documentation/topdocs'])
-env.Depends (['lily', 'flower', 'all', '.'], config_h)
env.Depends ('doc', ['lily', 'mf'])
env.Depends ('input', ['lily', 'mf'])
-env.Depends ('doc', ['lily', 'mf'])
def list_sort (lst):
print 'Please install required packages'
for i in required:
print '%s: %s-%s or newer (found: %s %s)' % i
- sys.exit (1)
+ Exit (1)
if optional:
print
for i in list_sort (env['DEFINES'].keys ()):
config.write ('#define %s %s\n' % (i, env['DEFINES'][i]))
config.close ()
-
-if os.path.exists (config_cache) and 'config' in COMMAND_LINE_TARGETS:
- os.unlink (config_cache)
-# WTF?
-# scons: *** Calling Configure from Builders is not supported.
-# env.Command (config_cache, None, configure)
-if not os.path.exists (config_cache) \
- or (os.stat ('SConstruct')[stat.ST_MTIME]
- > os.stat (config_cache)[stat.ST_MTIME]):
- env = configure (None, None, env)
-
- # We 'should' save opts each time, but that makes config.h
- # always out of date, and that triggers recompiles, even when
- # using checksums?
- if FOOSUMS: #not env['checksums']:
- ## FIXME: Is this smart, using option cache for saving
- ## config.cache? I cannot seem to find the official method.
- map (lambda x: opts.AddOptions ((x,)), config_vars)
- opts.Save (config_cache, env)
- env.Command (config_h, config_cache, config_header)
+env.Command (config_hh, config_cache, config_header)
# hmm?
def xuniquify (lst):
n -= 1
return lst
-for i in config_vars:
- if env.has_key (i) and type (env[i]) == type ([]):
- env[i] = uniquify (env[i])
-if not FOOSUMS: #env['checksums']:
+def save_config_cache (env):
## FIXME: Is this smart, using option cache for saving
## config.cache? I cannot seem to find the official method.
- map (lambda x: opts.AddOptions ((x,)), config_vars)
-
+ for i in config_vars:
+ if env.has_key (i) and type (env[i]) == type ([]):
+ env[i] = uniquify (env[i])
opts.Save (config_cache, env)
- env.Command (config_h, config_cache, config_header)
-env.Command (version_h, '#/VERSION',
- '$PYTHON ./stepmake/bin/make-version.py VERSION > $TARGET')
+ ## FIXME: Something changes in the ENVironment that triggers
+ ## rebuild of everything if we continue after configuring.
+ ## Maybe there's a variable missing from config_vars?
+
+ ## How to print and debug the reasons scons has for rebuilding
+ ## a target (make --debug)?
-absbuild = Dir (env['build']).abspath
-run_prefix = os.path.join (absbuild, os.path.join (env['out'], 'usr'))
+ ## heet van de naald:
+ ## - Add a --debug=explain option that reports the reason(s) why SCons
+
+ if 'config' in COMMAND_LINE_TARGETS:
+ sys.stdout.write ('\n')
+ sys.stdout.write ('LilyPond configured')
+ sys.stdout.write ('\n')
+ sys.stdout.write ('now run')
+ sys.stdout.write ('\n')
+ sys.stdout.write (' scons [TARGET|DIR]...')
+ sys.stdout.write ('\n')
+ Exit (0)
+ elif 1: #not env['checksums']:
+ command = sys.argv[0] + ' ' + string.join (COMMAND_LINE_TARGETS)
+ sys.stdout.write ('Running %s ... ' % command)
+ sys.stdout.write ('\n')
+ s = os.system (command)
+ Exit (s)
+
+
+if os.path.exists (config_cache) and 'config' in COMMAND_LINE_TARGETS:
+ os.unlink (config_cache)
+# WTF?
+# scons: *** Calling Configure from Builders is not supported.
+# env.Command (config_cache, None, configure)
+if not os.path.exists (config_cache) \
+ or (os.stat ('SConstruct')[stat.ST_MTIME]
+ > os.stat (config_cache)[stat.ST_MTIME]):
+ env = configure (None, None, env)
+ save_config_cache (env)
+
+env.Command (version_hh, '#/VERSION',
+ '$PYTHON ./stepmake/bin/make-version.py VERSION > $TARGET')
# post-config environment update
env.Append (
frm = os.path.join (srcdir, src[1:])
else:
depth = len (string.split (dir, '/'))
- frm = os.path.join ('../' * depth, src, env['out'])
+ if src.find ('@') > -1:
+ frm = os.path.join ('../' * depth,
+ string.replace (src, '@',
+ env['out']))
+ else:
+ frm = os.path.join ('../' * depth, src,
+ env['out'])
+ if src[-1] == '/':
+ frm = os.path.join (frm, os.path.basename (dst))
+ if env['verbose']:
+ print 'ln -s %s -> %s' % (frm, os.path.basename (dst))
os.symlink (frm, os.path.basename (dst))
shutil.rmtree (run_prefix)
prefix = os.path.join (env['out'], 'usr')
map (lambda x: symlink (x[0], os.path.join (prefix, x[1])),
- (('python', 'lib/lilypond/python'),
- # UGHR, lilypond.py uses lilypond-bin from PATH
- ('lily', 'bin'),
- ('#mf', 'share/lilypond/fonts/mf'),
- ('mf', 'share/lilypond/fonts/afm'),
- ('mf', 'share/lilypond/fonts/tfm'),
- ('mf', 'share/lilypond/fonts/type1'),
- ('#tex', 'share/lilypond/tex/source'),
- ('mf', 'share/lilypond/tex/generate'),
- ('#ly', 'share/lilypond/ly'),
- ('#scm', 'share/lilypond/scm'),
- ('#ps', 'share/lilypond/ps'),
- ('elisp', 'share/lilypond/elisp')))
+ # ^# := source dir
+ # @ := out
+ # /$ := add dst file_name
+ (('python', 'lib/lilypond/python'),
+ ('lily/', 'bin/lilypond-bin'),
+ ('scripts/', 'bin/lilypond'),
+ ('scripts/', 'bin/lilypond-book'),
+ ('#mf', 'share/lilypond/fonts/mf'),
+ ('mf', 'share/lilypond/fonts/afm'),
+ ('mf', 'share/lilypond/fonts/tfm'),
+ ('mf', 'share/lilypond/fonts/type1'),
+ ('#tex', 'share/lilypond/tex/source'),
+ ('mf', 'share/lilypond/tex/generate'),
+ ('#ly', 'share/lilypond/ly'),
+ ('#scm', 'share/lilypond/scm'),
+ ('#ps', 'share/lilypond/ps'),
+ ('po/@/nl.mo', 'share/locale/nl/LC_MESSAGES/lilypond.mo'),
+ ('elisp', 'share/lilypond/elisp')))
os.chdir (srcdir)
if env['debugging']:
stamp = os.path.join (run_prefix, 'stamp')
env.Command (stamp, 'SConstruct', [symlink_tree, 'touch $TARGET'])
env.Depends ('lily', stamp)
-
+
#### dist, tar
def plus (a, b):
a + b
env.Depends (patch_name, dist_ball)
env.Alias ('release', patch)
+env.Append (
+ ETAGSFLAGS = ["""--regex='{c++}/^LY_DEFINE *(\([^,]+\)/\1/'""",
+ """--regex='{c++}/^LY_DEFINE *([^"]*"\([^"]+\)"/\1/'"""])
+# filter-out some files?
+env.Command ('TAGS', src_files, 'etags $ETAGSFLAGS $SOURCES')
+
for d in subdirs:
if os.path.exists (os.path.join (d, 'SConscript')):
b = os.path.join (env['build'], d, env['out'])
if os.environ.has_key ('TEXMF'):
env.Append (ENV = {'TEXMF' : os.environ['TEXMF']})
-env.Append (ENV = {'TEXMF' : '{' + env['LILYPONDPREFIX'] + ',' \
+env.Append (ENV = {'TEXMF' : '{$LILYPONDPREFIX,' \
+ os.popen ('kpsexpand \$TEXMF').read ()[:-1] + '}' })
if os.environ.has_key ('LD_LIBRARY_PATH'):
env.Append (ENV = { 'PYTHONPATH' : string.join (env['PYTHONPATH'],
os.pathsep) } )
-a = ['rm -f $$(grep -LF "\lilypondend" ${TARGET.dir}/lily-*.tex 2>/dev/null);',
+a = ['${__set_x}rm -f $$(grep -LF "\lilypondend" ${TARGET.dir}/lily-*.tex 2>/dev/null);',
'LILYPONDPREFIX=$LILYPONDPREFIX \
$PYTHON $LILYPOND_BOOK $__verbose \
--include=${TARGET.dir} $LILYPOND_BOOK_INCLUDES \
base = os.path.splitext (str (target[0]))[0]
return (target + [base + '.ps'], source)
-#debug = 'echo "PATH=$$PATH";'
-debug = ''
-a = debug + 'LILYPONDPREFIX=$LILYPONDPREFIX \
-$PYTHON $LILYPOND_PY $__verbose \
+a = '${set__x}LILYPONDPREFIX=$LILYPONDPREFIX \
+$PYTHON $LILYPOND_PY${__verbose}\
--include=${TARGET.dir} \
--output=${TARGET.base} $SOURCE'
lilypond = Builder (action = a, suffix = '.pdf', src_suffix = '.ly')
## emitter = add_ps_target)
env.Append (BUILDERS = {'LilyPond': lilypond})
-#verbose = verbose_opt (env, ' --verbose')
-verbose = ''
-a = debug + 'LILYPONDPREFIX=$LILYPONDPREFIX $PYTHON $ABC2LY_PY \
+a = '${set__x}LILYPONDPREFIX=$LILYPONDPREFIX $PYTHON $ABC2LY_PY \
--strict --output=${TARGET} $SOURCE'
ABC = Builder (action = a, suffix = '.ly', src_suffix = '.abc')
env.Append (BUILDERS = {'ABC': ABC})
if os.path.basename (os.path.dirname (str (target[0]))) == 'bin':
os.chmod (t, 0755)
-AT_COPY = Builder (action = at_copy)
+AT_COPY = Builder (action = at_copy, src_suffix = ['.in', '.py', '.sh',])
env.Append (BUILDERS = {'AT_COPY': AT_COPY})
-MO = Builder (action = '$MSGFMT -o $TARGET $SOURCE',
+MO = Builder (action = 'msgfmt -o $TARGET $SOURCE',
suffix = '.mo', src_suffix = '.po')
env.Append (BUILDERS = {'MO': MO})
-a = 'xgettext --default-domain=lilypond --join \
+ugh = 'ln -f po/lilypond.pot ${TARGET.dir}/lilypond.po; '
+a = ugh + 'xgettext --default-domain=lilypond --join \
--output-dir=${TARGET.dir} --add-comments \
--keyword=_ --keyword=_f --keyword=_i $SOURCES'
-POT = Builder (action = a, suffix = '.pot')
-#env.Append (BUILDERS = {'POT': POT})
-#env.Command(env['absbuild'] + '/po/' + env['out'] + '/lilypond.pot',
-env['pottarget'] = os.path.join (env['absbuild'], 'po', env['out'],
- 'lilypond.pot')
-env['potcommand'] = a
-
-a = 'msgmerge ${SOURCE} ${TARGET.dir}/lilypond.pot -o ${TARGET}'
+PO = Builder (action = a, suffix = '.pot',
+ src_suffix = ['.cc', '.hh', '.py'], multi = 1)
+##env.Append (BUILDERS = {'PO': PO})
+##env.Command(env['absbuild'] + '/po/' + env['out'] + '/lilypond.pot',
+env['potarget'] = os.path.join (env['absbuild'], 'po', env['out'],
+ 'lilypond.pot')
+env['pocommand'] = a
+
+ugh = '; mv ${TARGET} ${SOURCE}'
+a = 'msgmerge ${SOURCE} ${SOURCE.dir}/lilypond.pot -o ${TARGET}' + ugh
POMERGE = Builder (action = a, suffix = '.pom', src_suffix = '.po')
env.Append (BUILDERS = {'POMERGE': POMERGE})
+
+a = '$PYTHON $srcdir/buildscripts/bib2html.py -o $TARGET $SOURCE'
+BIB2HTML = Builder (action = a, suffix = '.html', src_suffix = '.bib')
+env.Append (BUILDERS = {'BIB2HTML': BIB2HTML})
+
+a = '$PYTHON $srcdir/buildscripts/lys-to-tely.py \
+--name=${TARGET.base} --title="$TITLE" $SOURCES'
+LYS2TELY = Builder (action = a, suffix = '.tely', src_suffix = '.ly')
+env.Append (BUILDERS = {'LYS2TELY': LYS2TELY})
AC_CONFIG_SRCDIR([lily/main.cc])
# Move to aclocal.m4?
-AC_CONFIG_HEADER([$CONFIGFILE.h:config.hh.in])
+AC_CONFIG_HEADER([$CONFIGFILE.hh:config.hh.in])
# Uncomment the configuration options your package needs.
if not env['static'] or env['shared']:
e.SharedLibrary (name, sources)
-#pot = env.POT (sources + includes)
-#map (lambda x: e.Depends
-pot = env.Command (env['pottarget'], sources + includes, env['potcommand'])
-env.Alias ('pot', pot)
+po = env.Command ('lilypond.po', sources + includes, env['pocommand'])
+env.Alias ('po-update', po)
Jan Nieuwenhuizen <janneke@gnu.org>
*/
-//#include "config.hh"
-#include "config.h"
#include <stdio.h>
#include <errno.h>
#include <limits.h>
+#include "config.hh"
+
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
Jan Nieuwenhuizen <janneke@gnu.org>
*/
-#include "config.h"
#include <stdio.h>
#include <errno.h>
#include <limits.h>
+#include "config.hh"
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#include <iostream>
-#include "config.h"
+#include "config.hh"
#include "getopt-long.hh"
#include "international.hh"
#include "string-convert.hh"
(c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-
#ifndef LIBC_EXTENSION_HH
#define LIBC_EXTENSION_HH
-#include "flower-proto.hh"
-#include "config.h"
-
-
#include <cstddef>
#include <stdarg.h>
+#include "config.hh"
+#include "flower-proto.hh"
+
char* strnlwr (char* start ,int n);
char* strnupr (char* start, int n);
*/
#include <stdarg.h>
-#include "config.h"
+
+#include "config.hh"
#include "string-convert.hh"
#include "international.hh"
# -*-python-*-
-import os
-
Import ('env')
-#sources = env['src_glob'] (env, '*.ly')
-#abc_sources = env['src_glob'] (env, '*.abc')
-#abc = map (lambda x: os.path.splitext (x)[0], abc_sources)
-#lys = map (env.Abc2ly, abc)
-
abcs = env['glob'] (env, '*.abc')
lys = env['glob'] (env, '*.ly') + map (env.ABC, abcs)
pdfs = map (env.LilyPond, lys)
--- /dev/null
+# -*-python-*-
+
+Import ('env')
+#lys = env['src_glob'] (env, '*.ly')
+lys = env['glob'] (env, '*.ly')
+
+e = env.Copy (
+ TITLE = 'LilyPond Regression Tests',
+ LILYPOND_BOOK_FLAGS = '''--process="lilypond-bin --header=texidoc -I$srcdir/input/test -e '(ly:set-option (quote internal-type-checking) #t)'"''',
+ __verbose = ' --verbose',
+ )
+
+tely = e.LYS2TELY ('collated-files', lys)
+texi = e.TEXI (tely)
+pdf = e.PDF (texi)
+html = e.PDF (texi)
+
+env.Alias ('doc', pdf)
+env.Alias ('doc', html)
+
+
--- /dev/null
+# -*-python-*-
+
+Import ('env')
+#lys = env['src_glob'] (env, '*.ly')
+lys = env['glob'] (env, '*.ly')
+
+e = env.Copy (
+ TITLE = 'LilyPond Template Files',
+ LILYPOND_BOOK_FLAGS = '''--process="lilypond-bin --header=texidoc -I$srcdir/input/test -e '(ly:set-option (quote internal-type-checking) #t)'"''',
+ __verbose = ' --verbose',
+ )
+
+tely = e.LYS2TELY ('collated-files', lys)
+texi = e.TEXI (tely)
+pdf = e.PDF (texi)
+html = e.PDF (texi)
+
+env.Alias ('doc', pdf)
+env.Alias ('doc', html)
+
+
--- /dev/null
+# -*-python-*-
+
+Import ('env')
+#lys = env['src_glob'] (env, '*.ly')
+lys = env['glob'] (env, '*.ly')
+
+e = env.Copy (
+ TITLE = 'LilyPond Tips and Tricks',
+ LILYPOND_BOOK_FLAGS = '''--process="lilypond-bin --header=texidoc -I$srcdir/input/test -e '(ly:set-option (quote internal-type-checking) #t)'"''',
+ __verbose = ' --verbose',
+ )
+
+tely = e.LYS2TELY ('collated-files', lys)
+texi = e.TEXI (tely)
+pdf = e.PDF (texi)
+html = e.PDF (texi)
+
+env.Alias ('doc', pdf)
+env.Alias ('doc', html)
+
+
# -*-python-*-
Import ('env')
-sources = env['src_glob'] (env, '*.cc') + ['parser.yy', 'lexer.ll']
-includes = env['src_glob'] (env, 'include/*.hh')
+
outdir = Dir ('.').abspath
+cc_sources = env['src_glob'] (env, '*.cc')
+sources = cc_sources + ['parser.yy', 'lexer.ll']
+includes = env['src_glob'] (env, 'include/*.hh')
e = env.Copy ()
-e.Append (YACCFLAGS = '-d')
e.Append (CPPPATH = [outdir, '#/lily/include', '#/flower/include'])
+e.Append (LEXFLAGS = ['-Cfe', '-p', '-p'])
+
+# SCons builds parser.cc and parser.hh automagically with this but
+# keeps removing and rebuilding parser.cc because it wants parser.hpp.
+# e.Append (YACCFLAGS = '-d')
+# e.Depends ('lexer.cc', 'parser.cc')
+# e.Depends ('my-lily-lexer.o', 'parser.cc')
+# e.Depends ('my-lily-parser.o', 'parser.cc')
-e.Depends ('lexer.cc', 'parser.cc')
-e.Depends ('my-lily-lexer.o', 'parser.cc')
-e.Depends ('my-lily-parser.o', 'parser.cc')
-map (e.Precious, ['parser.cc', 'lexer.cc', 'parser.hh'])
+# Adding an explicit Builder works well, we do not even need to list
+# header dependencies.
+HH = Builder (action = 'bison -d -o ${TARGET.base}.cc $SOURCE',
+ suffix = '.hh', src_suffix = '.yy')
+e.Append (BUILDERS = {'HH' : HH})
+e.HH ('parser.hh', 'parser.yy')
e.Append (LIBS = ['flower'])
e.ParseConfig ('guile-config link')
env.Install (env['bindir'], lily)
env.Alias ('install', env['bindir'])
-#po = e.PO (sources + includes)
-#env.Alias ('po', po)
+po = env.Command ('lilypond.po', cc_sources + includes, env['pocommand'])
+env.Alias ('po-update', po)
*/
-#include "config.h"
+#include "config.hh"
#include "main.hh"
#include "all-font-metrics.hh"
#include "warn.hh"
#include <math.h>
-#include "config.h"
+#include "config.hh"
#include "warn.hh"
#include "libc-extension.hh"
#include "bezier.hh"
#include <sstream>
-#include "config.h"
+#include "config.hh"
#include "includable-lexer.hh"
#include "file-path.hh"
/* GUILE only includes version in headers (libguile/version.h) as of
1.5.x. For some strange reason, they call it SCM.*VERSION.
- Not including config.h here, saves a lot of unnecessary
+ Not including config.hh here, saves a lot of unnecessary
recompiles. */
#include <libguile.h>
#define GUILE_MINOR_VERSION SCM_MINOR_VERSION
#define GUILE_PATCH_LEVEL SCM_MICRO_VERSION
#else
-#include "config.h"
+#include "config.hh"
#endif
#endif
#ifndef __PANGOFC_AFM_DECODER_H__
#define __PANGOFC_AFM_DECODER_H__
-#include "config.h"
+#include "config.hh"
#if HAVE_PANGO_FC_FONT_MAP_ADD_DECODER_FIND_FUNC
/* Note: in C and with explicit header for use outside of LilyPond. */
*/
#include <unistd.h>
-#include "config.h"
+#include "config.hh"
#define popen REALLYUGLYKLUDGE
#define pclose ANOTHERREALLYUGLYKLUDGE
(c) 1999--2004 Jan Nieuwenhuizen <janneke@gnu.org>
*/
-#include "config.h"
+#include "config.hh"
#include "version.hh"
#include "lily-version.hh"
#include <locale.h>
#include <string.h>
-#include "config.h"
+#include "config.hh"
#if HAVE_GETTEXT
#include <libintl.h>
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "config.h"
+#include "config.hh"
#if HAVE_PANGO_FC_FONT_MAP_ADD_DECODER_FIND_FUNC
/* Need to access to PangoFcFont.full_pattern. */
Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include "config.h"
+#include "config.hh"
#include <stdio.h>
#include <assert.h>
outdir=$(outroot)/$(outbase)
# why not generic ??
-config_h=$(builddir)/config$(CONFIGSUFFIX).h
+config_h=$(builddir)/config$(CONFIGSUFFIX).hh
# The outdir that was configured for: best guess to find binaries
outconfbase=out$(CONFIGSUFFIX)
# -*-python-*-
-import glob
import os
-import string
-import sys
-
Import ('env')
-here = os.getcwd ()
-reldir = str (Dir ('.').srcnode ())
-os.chdir (reldir)
-sources = glob.glob ('*.mf')
-outdir = os.path.join (env['build'], reldir, env['out'])
-
-#mf_sources = reduce (+,
-mf_sources = reduce (lambda x, y: x + y,
- map (glob.glob,
- ('feta[0-9]*.mf',
- 'feta-braces-[a-z].mf',
- 'feta-din*[0-9].mf',
- 'feta-nummer*[0-9].mf',
- 'parmesan[0-9]*.mf',)))
-os.chdir (here)
-
-#mf_sources = ('feta16.mf',)
-#mf_sources = ('feta-braces-a.mf',)
-font_stems = map (lambda x: os.path.splitext (x)[0], mf_sources)
-
-t = map (env.TFM, font_stems)
-a = map (env.AFM, font_stems)
-p = map (env.PFA, font_stems)
-
-map (lambda x: env.Depends (x + '.pfa', x + '.enc'), font_stems)
-#map (lambda x: env.Depends (x + '.pfa', x + '.log'), font_stems)
+#sources = env['src_glob'] (env, '*.mf')
+sources = env['glob'] (env, '*.mf')
+
+fonts = reduce (lambda x, y: x + y,
+ map (lambda x: env['glob'] (env, x),
+ ('feta[0-9]*.mf',
+ 'feta-braces-[a-z].mf',
+ 'feta-din*[0-9].mf',
+ 'feta-nummer*[0-9].mf',
+ 'parmesan[0-9]*.mf',)))
+
+env.Depends ('mf', 'mf-essential')
+stems = fonts #map (lambda x: os.path.splitext (x)[0], fonts)
+
+t = map (env.TFM, stems)
+a = map (env.AFM, stems)
+p = map (env.PFA, stems)
+
+map (lambda x: env.Depends (x + '.pfa', x + '.enc'), stems)
+
+mf_essential = ['feta16', 'feta20', 'parmesan16', ]
+pfa_essential = map (env.PFA, mf_essential)
+env.Alias ('mf-essential', pfa_essential)
+
+env.Alias ('mf', 'mf-essential')
+
+env.Command ('cmr.enc', 'cmr.enc.in', 'cp $SOURCE $TARGET')
+env.Alias ('mf', 'cmr.enc')
+env.Alias ('mf', p)
tfmdir = os.path.join (env['lilypondprefix'], 'fonts/tfm')
afmdir = os.path.join (env['lilypondprefix'], 'afm')
pfadir = os.path.join (env['lilypondprefix'], 'fonts/type1')
-#ti = map (lambda x: env.Install (tfmdir, x[0]), t)
ti = map (lambda x: env.Install (tfmdir, x), t)
ai = map (lambda x: env.Install (afmdir, x), a)
pi = map (lambda x: env.Install (pfadir, x), p)
env.Alias ('install', tfmdir)
env.Alias ('install', afmdir)
env.Alias ('install', pfadir)
-
-map (lambda x: env.Alias ('fonts', x), t + a + p)
-env.Command ('cmr.enc', 'cmr.enc.in', 'cp $SOURCE $TARGET')
-env.Alias ('fonts', 'cmr.enc')
Import ('env')
pos = env['glob'] (env, '*.po')
-#pot = env['glob'] (env, '*.pot')
-#pot = 'lilypond'
mos = map (env.MO, pos)
dir = env['localedir']
env.Install (dir, mos)
env.Alias ('install', dir)
-
-
-outdir = Dir ('.').abspath
-env.Depends ('po', 'pot')
-env.Depends ('po', env['pottarget'])
-
-#pots = map (lambda x: outdir + '/' + x + '.po', pos)
-map (lambda x: env.Depends (outdir + '/lilypond.pot', x), pos)
+env.Depends ('po', 'po-update')
+# map (lambda x: env.Depends (x + '.mo', x + '.pom'), pos)
poms = map (env.POMERGE, pos)
-env.Alias ('po', poms)
+env.Alias ('po-update', poms)
+env.Alias ('po', mos)
+#env.Alias ('all', mos)
INSTALLATION_OUT_FILES1=$(OUT_PY_MODULES) $(OUT_PYC_MODULES)
-$(outdir)/midi.lo: $(outdir)/config.h
+$(outdir)/midi.lo: $(outdir)/config.hh
(define (get-coding coding-name)
(let ((entry (assoc-get coding-name coding-alist)))
- (cons (car entry) (force (cdr entry)))))
+ (if entry (cons (car entry) (force (cdr entry)))
+ (if (equal? coding-name "feta-music")
+ (begin
+ (ly:warn "installation problem: deprecated encoding requested: ~S" coding-name)
+ (exit 1))
+ (let ((fallback "latin1"))
+ (ly:warn "programming error: no such encoding: ~S" coding-name)
+ (ly:warn "programming error: cross thumbs, using: ~S:" fallback)
+ (get-coding fallback))))))
(define-public (get-coding-filename coding-name)
(car (get-coding coding-name)))
# -*-python-*-
-import os
-
Import ('env')
sources = env['src_glob'] (env, '*.py')
-gen_files = map (lambda x: os.path.splitext (x)[0], sources)
gens = map (env.AT_COPY, sources)
dir = env['bindir']
-env.Install (dir, gen_files)
+env.Install (dir, gens)
+env.Alias ('install', env['bindir'])
-#pot = env.POT (sources)
-#env.Alias ('pot', pot)
+po = env.Command ('lilypond.po', sources, env['pocommand'])
+env.Alias ('po-update', po)
-$(EXECUTABLE): $(outdir)/config.h $(O_FILES) $(outdir)/version.hh
+$(EXECUTABLE): $(outdir)/config.hh $(O_FILES) $(outdir)/version.hh
$(foreach a, $(MODULE_LIBS), $(MAKE) -C $(a) && ) true
$(LD) -o $@ $(O_FILES) $(LOADLIBES) $(ALL_LDFLAGS)
$(outdir)/version.hh: $(depth)/VERSION $(config_make)
$(PYTHON) $(step-bindir)/make-version.py $< > $@
-$(outdir)/config.h: $(config_h)
+$(outdir)/config.hh: $(config_h)
cp -p $< $@
configure: configure.in aclocal.m4
-$(LIBRARY): $(outdir)/config.h $(O_FILES)
+$(LIBRARY): $(outdir)/config.hh $(O_FILES)
$(AR) $(ARFLAGS) $@ $(O_FILES)
# thanks to Nelson Beebe for this trick.
$(RANLIB) $@ || $(AR) ts $@ || true
-$(SHARED_LIBRARY): $(outdir)/config.h $(LO_FILES)
+$(SHARED_LIBRARY): $(outdir)/config.hh $(LO_FILES)
$(LD) $(SHARED_FLAGS) -o $@ $(LO_FILES) $(ALL_LDFLAGS)
local-dist: configure
-# urg!: this gets into every package (ie: yodl)
local-distclean:
- rm -f config.h config.hh config.make Makefile GNUmakefile \
+ rm -f config.hh config.make Makefile GNUmakefile \
config.cache config.status config.log index.html \
stepmake/stepmake/stepmake stepmake/stepmake/bin