summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/SConscript42
1 files changed, 13 insertions, 29 deletions
diff --git a/src/SConscript b/src/SConscript
index 8e6e1b45e..69c5b946d 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -32,11 +32,7 @@ import imp
import os
import sys
-from os.path import basename
-from os.path import join as joinpath
-from os.path import exists
-from os.path import isdir
-from os.path import isfile
+from os.path import basename, exists, isdir, isfile, join as joinpath
import SCons
@@ -181,31 +177,19 @@ env.Append(CPPDEFINES=[('THE_ISA','%s_ISA' % env['TARGET_ISA'].upper())])
########################################################################
#
-# Walk the tree and execute all SConscripts
+# Walk the tree and execute all SConscripts in subdirectories
#
-srcdir = env['SRCDIR']
-for root, dirs, files in os.walk(srcdir, topdown=True):
- if root == srcdir:
- # we don't want to recurse back into this SConscript
- continue
-
- if 'SConscript' in files:
- # strip off the srcdir part since scons will try to find the
- # script in the build directory
- base = root[len(srcdir) + 1:]
- SConscript(joinpath(base, 'SConscript'))
-
-extra_string = env['EXTRAS']
-if extra_string and extra_string != '' and not extra_string.isspace():
- for extra in extra_string.split(':'):
- print 'Adding', extra, 'to source directory list'
- env.Append(CPPPATH=[Dir(extra)])
- for root, dirs, files in os.walk(extra, topdown=True):
- if 'SConscript' in files:
- subdir = root[len(os.path.dirname(extra))+1:]
- print ' Found SConscript in', subdir
- build_dir = joinpath(env['BUILDDIR'], subdir)
- SConscript(joinpath(root, 'SConscript'), build_dir=build_dir)
+
+for base_dir in base_dir_list:
+ here = Dir('.').srcnode().abspath
+ for root, dirs, files in os.walk(base_dir, topdown=True):
+ if root == here:
+ # we don't want to recurse back into this SConscript
+ continue
+
+ if 'SConscript' in files:
+ build_dir = joinpath(env['BUILDDIR'], root[len(base_dir) + 1:])
+ SConscript(joinpath(root, 'SConscript'), build_dir=build_dir)
for opt in env.ExportOptions:
env.ConfigFile(opt)