]> git.donarmstrong.com Git - lilypond.git/commitdiff
Updates. Add targets: tar, dist, release.
authorJan Nieuwenhuizen <janneke@gnu.org>
Mon, 12 Jul 2004 21:52:54 +0000 (21:52 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 12 Jul 2004 21:52:54 +0000 (21:52 +0000)
Documentation/SConscript
Documentation/user/SConscript
SConstruct
buildscripts/builder.py
flower/SConscript
input/SConscript
lily/SConscript
ly/SConscript
python/lilylib.py
scm/SConscript

index 56b9039c03128c4ecdaa2ef742b3ea7192f6cc4e..6b27c415806d5a0e2e6d9dff8dbc2e46b7312ff2 100644 (file)
@@ -1,13 +1,5 @@
 # -*-python-*-
 
-import glob
-import os
-
 Import ('env')
-here = os.getcwd ()
-reldir = str (Dir ('.').srcnode ())
-os.chdir (reldir)
 sources = ['index.html.in', 'texinfo.css']
-os.chdir (here)
-outdir = os.path.join (env['build'], reldir, env['out'])
 
index 2798c17df69b5c0b8a56ad59e2b9542bc005e464..d0c237277ec7c6f619f3c0e5b66910f225e60de8 100644 (file)
@@ -6,13 +6,8 @@ import re
 import sys
 
 Import ('env')
-here = os.getcwd ()
-reldir = str (Dir ('.').srcnode ())
-os.chdir (reldir)
-sources = glob.glob ('*.tely')
-pngs = glob.glob ('*.png')
-os.chdir (here)
-outdir = os.path.join (env['build'], reldir, env['out'])
+sources = env['src_glob'] (env, '*.tely')
+pngs = env['src_glob'] (env, '*.png')
 
 def verbose_opt (env, opt):
        if env['verbose']:
@@ -26,19 +21,8 @@ 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'])
 
-# more of these? -- howto?
-env.Depends ('lilypond.texi', os.path.join (mfbuild, 'feta16list.ly'))
-env.Depends ('lilypond.texi', os.path.join (mfbuild, 'parmesan16list.ly'))
-# or these
-env.Depends ('doc', os.path.join (mfbuild, 'feta20.enc'))
-env.Depends ('doc', os.path.join (mfbuild, 'feta20.enc'))
-
 env.Depends ('lilypond.texi', LILYPOND_BIN)
 env.Depends ('lilypond.texi', 'lilypond-internals.texi')
-
-##env.Depends ('lilypond.texi', 'fonts')
-
-# simple:
 env.Depends ('doc', mfbuild)
 
 png_stems = map (lambda x: os.path.splitext (x)[0], pngs)
@@ -69,7 +53,9 @@ def file_subst (file_name, find, subst):
                h.write (t)
                h.close ()
 
-docdir = os.path.join (env['srcdir'], 'Documentation')
+##docdir = os.path.join (env['srcdir'], 'Documentation')
+docdir = Dir ('.').srcnode ().abspath + '/..'
+reldir = 'foe'
 out = env['out']
 srcdir = env['srcdir']
 verbose = verbose_opt (env, ' --verbose')
index 95c2253ccd06a98ef3eaf17702c43bd45ad3dcb3..2b23ff6401829e7c8f06f09075f8ca6561ad69a5 100644 (file)
@@ -74,6 +74,13 @@ if not COMMAND_LINE_TARGETS:
 # All builds everything (all directories)
 env.Alias ('all', ['lily', 'mf', 'input', 'Documentation'])
 
+#?
+env.Depends ('Documentation', ['lily', 'mf'])
+env.Depends ('input', ['lily', 'mf'])
+env.Depends ('doc', ['lily', 'mf'])
+env.Depends ('doc', 'mf')
+env.Depends ('input', ['lily', 'mf'])
+
 
 ## FIXME: opts in function
 
@@ -298,7 +305,7 @@ def configure (env):
                        defines['HAVE_PANGO_CVS'] = '1'
                        defines['HAVE_PANGO_FC_FONT_MAP_ADD_DECODER_FIND_FUNC'] = '1'
 
-       # ugh - needed at all?  make Builder/Command for config.h!
+       # use Command
        if not os.path.exists (outdir):
                os.mkdir (outdir)
 
@@ -307,7 +314,6 @@ def configure (env):
                config.write ('#define %s %s\n' % (i, defines[i]))
        config.close ()
 
-
        os.system (sys.executable \
                   + ' ./stepmake/bin/make-version.py VERSION > '\
                   + os.path.join (outdir, 'version.hh'))
@@ -332,16 +338,10 @@ def configure (env):
 # Hmm.  Must configure when building lily, to get compiler and linker
 # flags set-up.
 # FIXME
-if not os.path.exists (config_h) or 'config' in COMMAND_LINE_TARGETS\
-   or 'lily' in BUILD_TARGETS or 'all' in BUILD_TARGETS:
+if 1 or not os.path.exists (config_h) or 'config' in COMMAND_LINE_TARGETS:
        env = configure (env)
 
-if os.path.exists ('parser'):
-       env.Append (LIBPATH = ['#/flower', '#/lily', '#/parser', '#/gui',],
-                   CPPPATH = [outdir, '#',])
-else:  
-       env.Append (LIBPATH = ['#/flower/' + out,],
-                   CPPPATH = [outdir, '#',])
+env.Append (LIBPATH = ['#/flower/' + out,], CPPPATH = [outdir, '#',])
 
 Export ('env')
 
@@ -382,9 +382,8 @@ SConscript ('buildscripts/builder.py')
 
 for d in subdirs:
        b = os.path.join (build, d, out)
-       # Support clean sourctree build (srcdir build)
-       # and outdir build.
-       # TODO: figure out SConscript (dir, builddir, duplicate)) feature
+       # Support clean sourcetree build (--srcdir build)
+       # and ./out build.
        if (build and build != '.') \
           or (out and out != '.'):
                env.BuildDir (b, d, duplicate=0)
@@ -431,13 +430,10 @@ def symlink_tree (prefix):
 
 if env['debugging']:
        prefix = os.path.join (out, 'usr')
-       if not os.path.exists (prefix):
+       if not os.path.exists (os.path.join (absbuild, prefix)):
                symlink_tree (prefix)
 
 #### dist, tar
-src_files = ['ChangeLog', '.cvsignore', 'Documentation/index.html.in',
-            'lily/beam.cc']
-
 def cvs_files (dir):
        entries = open (os.path.join (dir, 'CVS/Entries')).readlines ()
        files = filter (lambda x: x[0] != 'D', entries)
index 889c347e02c667b7ce98230afd5c76cafa5ab899..2997b7f2f75a4ddade148f95006190afc6b56acb 100644 (file)
@@ -1,5 +1,6 @@
 # -*-python-*-
 
+import glob
 import os
 import re
 import string
@@ -166,13 +167,6 @@ def add_enc_src (target, source, env):
        base = os.path.splitext (str (target[0]))[0]
        return (target, source + [base + '.enc'])
 
-def encoding_opt (target):
-       base = os.path.splitext (os.path.basename (str (target[0])))[0]
-       enc = base + '.enc'
-       if os.path.exists (os.path.join (outdir, enc)):
-               return ' --encoding=' + enc
-       return ''
-
 # UGH, should fix --output option for mftrace
 verbose = verbose_opt (env, ' --verbose')
 a = ('(cd ${TARGET.dir} && '
@@ -190,7 +184,7 @@ pfa = Builder (action = a,
               emitter = add_enc_src)
 env.Append (BUILDERS = {'PFA': pfa})
 
-# FIXMExo
+# FIXME
 #verbose = verbose_opt (env, ' --verbose')
 verbose = ''
 DIFF_PY = os.path.join (srcdir, 'stepmake/bin/package-diff.py')
@@ -200,3 +194,10 @@ a = ('%(PYTHON)s %(DIFF_PY)s%(verbose)s'\
 patch = Builder (action = a, suffix = '.diff', src_suffix = '.tar.gz')
 env.Append (BUILDERS = {'PATCH': patch})
 
+def src_glob (env, s):
+       here = os.getcwd ()
+       os.chdir (env.Dir ('.').srcnode ().abspath)
+       result = glob.glob (s)
+       os.chdir (here)
+       return result
+env['src_glob'] = src_glob
index ee172728062327b68d9a907735de2fabec75abd0..e4d36036e603e2782023f233d452dcaeeccf8b8f 100644 (file)
@@ -1,15 +1,11 @@
 # -*-python-*-
 
-import glob
-import os
-
 Import ('env')
-here = os.getcwd ()
-reldir = str (Dir ('.').srcnode ())
-os.chdir (reldir)
-sources = glob.glob ('*.cc')
-os.chdir (here)
-outdir = os.path.join (env['build'], reldir, env['out'])
+sources = env['src_glob'] (env, '*.cc')
+outdir = Dir ('.').path
+
+# abs_srcdir = Dir ('.').srcnode ().abspath
+# abs_outdir = Dir ('.').abspath
 
 name = 'flower'
 e = env.Copy ()
index 1e3c40092f06afcede83370f3a378271725472ce..7185004e326addf26aa39222f7a15a2e06e7ea1b 100644 (file)
@@ -1,26 +1,12 @@
 # -*-python-*-
 
-import glob
 import os
 
 Import ('env')
-here = os.getcwd ()
-reldir = str (Dir ('.').srcnode ())
-os.chdir (reldir)
-sources = glob.glob ('*.ly')
-abc_sources = glob.glob ('*.abc')
-os.chdir (here)
-outdir = os.path.join (env['build'], reldir, env['out'])
+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)
 
-stems = map (lambda x: os.path.splitext (x)[0], sources)
-abc_stems = map (lambda x: os.path.splitext (x)[0], abc_sources)
-lys = map (env.Abc2ly, abc_stems)
-examples = map (env.LilyPond, stems + abc_stems)
+examples = map (env.LilyPond, sources + abc)
 env.Alias ('doc', examples)
-
-LILYPOND_BIN = env['LILYPOND_BIN']
-
-mfbuild = os.path.join (env['absbuild'], 'mf', env['out'])
-#e.Depends ('doc', 'fonts')
-env.Depends ('doc', mfbuild)
-env.Depends ('doc', LILYPOND_BIN)
index 69769b51dda68496f95a293c1b2a338c30248e40..d9597c65bccf1c313d310098b51216d744b8fab6 100644 (file)
@@ -1,38 +1,17 @@
 # -*-python-*-
 
-import glob
-import os
-
 Import ('env')
-here = os.getcwd ()
-reldir = str (Dir ('.').srcnode ())
-os.chdir (reldir)
-sources = glob.glob ('*.cc') + ['parser.yy', 'lexer.ll']
-includes = glob.glob ('include/*.hh')
-os.chdir (here)
-outdir = os.path.join (env['build'], reldir, env['out'])
-
-name = 'lyparser'
+sources = env['src_glob'] (env, '*.cc') + ['parser.yy', 'lexer.ll']
+includes = env['src_glob'] (env, 'include/*.hh')
+outdir = Dir ('.').path
 
 e = env.Copy ()
-
-#let's do this after the split
-#sources = filter (lambda x: x != 'pangofc-afm-decoder.cc', sources)
-#pango = env.Copy ()
-#if pango['gui']:
-#      pango.ParseConfig ('pkg-config --cflags --libs gtk+-2.0')
-#      pango.ParseConfig ('pkg-config --cflags --libs pango')
-#pango.Object ('foo-' + 'pangofc-afm-decoder.o', 'pangofc-afm-decoder.cc')
-#
-#e.Object ('pangofc-afm-decoder.o', 'foo-pangofc-afm-deocder.o')
-
 e.Append (YACCFLAGS = '-d')
 e.Append (CPPPATH = [outdir, '#/lily/include', '#/flower/include'])
 e.Depends ('lexer.cc', 'parser.cc')
 e.Depends ('my-lily-lexer.o', 'parser.cc')
 e.Depends ('my-lily-parser.o', 'parser.cc')
 
-# some stuff here from lily-as-lib
 e.Append (LIBS = ['flower'])
 e.ParseConfig ('guile-config link')
 name = 'lilypond-bin'
index c5f1d69bd2788b9b25d38b589a21a654d63f3485..88143d3250941b44689af454193233cfe1116d1a 100644 (file)
@@ -1,16 +1,7 @@
 # -*-python-*-
 
-import glob
-import os
-
 Import ('env')
-here = os.getcwd ()
-reldir = str (Dir ('.').srcnode ())
-os.chdir (reldir)
-sources = glob.glob ('*.ly')
-os.chdir (here)
-outdir = os.path.join (env['build'], reldir, env['out'])
-
-lydir = os.path.join (env['sharedir_package_version'], 'ly')
-env.Install (lydir, sources)
-env.Alias ('install', lydir)
+sources = env['src_glob'] (env, '*.scm')
+dir = env['sharedir_package_version'] + '/ly'
+env.Install (dir, sources)
+env.Alias ('install', dir)
index 220d30bae44af7486c5d5bf742ebf21644e9b06f..cca0c239d49ebe95d6d9f15712dfa689a40a1500 100644 (file)
@@ -237,7 +237,7 @@ def command_name (cmd):
 
        # deal with "((latex ) >& 1 ) .." too
        cmd = re.match ("([\(\)]*)([^ ]*)", cmd).group(2)
-       return os.path.split (cmd)[1]
+       return os.basename (cmd)
 
 def error_log (name):
        name = re.sub('[^a-z]','x', name)
index adbeac354f722734c24420c0d4e7c2b730b17381..c0c45dd4df2fedd74d563010e3de0293466249b9 100644 (file)
@@ -1,16 +1,7 @@
 # -*-python-*-
 
-import glob
-import os
-
 Import ('env')
-here = os.getcwd ()
-reldir = str (Dir ('.').srcnode ())
-os.chdir (reldir)
-sources = glob.glob ('*.scm')
-os.chdir (here)
-outdir = os.path.join (env['build'], reldir, env['out'])
-
-scmdir = os.path.join (env['sharedir_package_version'], 'scm')
-env.Install (scmdir, sources)
-env.Alias ('install', scmdir)
+sources = env['src_glob'] (env, '*.scm')
+dir = env['sharedir_package_version'] + '/scm'
+env.Install (dir, sources)
+env.Alias ('install', dir)