env = Environment ()
opts = Options (None, ARGUMENTS)
-##opts.Add (PackageOption ('prefix', 'Install prefix', '/usr/'))
-## `Path' means a directory rather than a path?
-opts.Add (PathOption ('prefix', 'Install prefix', '/usr/'))
+opts.Add ('prefix', 'Install prefix', '/usr/')
+opts.Add ('outdir', 'Output directory', 'out')
opts.AddOptions (
BoolOption ('warnings', 'compile with -Wall and similiar',
1),
BoolOption ('optimising', 'compile with optimising',
1),
BoolOption ('shared', 'build shared libraries',
- 1),
- BoolOption ('static', 'build static libraries',
0),
+ BoolOption ('static', 'build static libraries',
+ 1),
)
Help (opts.GenerateHelpText (env))
config.close ()
env = conf.Finish ()
+os.system (sys.executable \
+ + ' ./stepmake/bin/make-version.py VERSION > version.hh')
+
+Export ('env')
+
+#this could happen after flower...
+env.ParseConfig ('guile-config compile')
+
+builddir = ''
+outdir = env['outdir']
+
if os.path.exists ('parser'):
env.Append (LIBPATH = ['#/flower', '#/lily', '#/parser', '#/gui',],
CPPPATH = ['#',])
else:
- env.Append (LIBPATH = ['#/flower', '#/lily',],
+ env.Append (LIBPATH = ['#/flower/' + outdir,],
CPPPATH = ['#',])
-os.system (sys.executable \
- + ' ./stepmake/bin/make-version.py VERSION > version.hh')
-
-Export ('env')
-
-if 1:
- #simple: build in ./flower
- SConscript ('flower/SConscript')
-else:
- # moellik: build in [/tmp/build/]flower[/out]
- # werkt 'bijna', maar glob in flower/Sconscript snapt niet
- # dat-i in flower SCRDRI moet globben
- builddir = ''
- outdir = 'out'
+#ugh: remove make config output
+if os.path.exists ('lily/out/config.h'):
+ os.unlink ('lily/out/config.h')
- d = 'flower'
+subdirs = ('flower', 'lily',)
+#subdirs = ('flower', 'lily', 'parser', 'gui', 'main',)
+for d in subdirs:
alias = os.path.join (builddir, d, outdir)
env.BuildDir (alias, d)
SConscript (os.path.join (alias, 'SConscript'))
-env.ParseConfig ('guile-config compile')
-
-SConscript ('lily/SConscript')
-if os.path.exists ('parser'):
- SConscript ('parser/SConscript')
- SConscript ('gui/SConscript')
- SConscript ('main/SConscript')
import glob
import os
+## this only works for BuildDir aliasing, not for scons -Y ../scrdir
+here = os.getcwd ()
+os.chdir (str (Dir ('.').srcnode ()))
sources = glob.glob ('*.cc') + ['parser.yy', 'lexer.ll']
+os.chdir (here)
+
name = 'lyparser'
Import ('env')
e.Depends ('lexer.cc', 'parser.cc')
# some stuff here from lily-as-lib
-if os.path.exists ('main.cc'):
+if not os.path.exists ('main.cc'):
if env['static']:
e.Library (name, sources)
- if not env['static'] or ['shared']:
+ if not env['static'] or env['shared']:
e.SharedLibrary (name, sources)
else:
#e.Append (LIBS = ['lygui', 'lyparser', 'lily', 'flower'])