summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2017-04-27 23:50:09 -0700
committerGabe Black <gabeblack@google.com>2017-04-28 21:11:43 +0000
commit4d1e1478360ad5131e780164c1547c4e2bc6ed5e (patch)
tree29de195ac7ac3676c4690d0aded150f16d17af08
parent2ee0992a05c48b8b1d3e12a7361f4114136264f8 (diff)
downloadgem5-4d1e1478360ad5131e780164c1547c4e2bc6ed5e.tar.xz
scons: Find ext build directories automatically.
The ext directories with SConscripts in them are easy to find automatically. Avoid boilerplate listing them out and SConscript()ing them manually. Change-Id: Ib723882aebc00e639eb8ec44904bb05ffa2c6b55 Reviewed-on: https://gem5-review.googlesource.com/2942 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
-rwxr-xr-xSConstruct34
1 files changed, 7 insertions, 27 deletions
diff --git a/SConstruct b/SConstruct
index 6010f3a57..26b1acf6e 100755
--- a/SConstruct
+++ b/SConstruct
@@ -1339,33 +1339,13 @@ config_builder = Builder(emitter = config_emitter, action = config_action)
main.Append(BUILDERS = { 'ConfigFile' : config_builder })
-# libelf build is shared across all configs in the build root.
-main.SConscript('ext/libelf/SConscript',
- variant_dir = joinpath(build_root, 'libelf'))
-
-# iostream3 build is shared across all configs in the build root.
-main.SConscript('ext/iostream3/SConscript',
- variant_dir = joinpath(build_root, 'iostream3'))
-
-# libfdt build is shared across all configs in the build root.
-main.SConscript('ext/libfdt/SConscript',
- variant_dir = joinpath(build_root, 'libfdt'))
-
-# fputils build is shared across all configs in the build root.
-main.SConscript('ext/fputils/SConscript',
- variant_dir = joinpath(build_root, 'fputils'))
-
-# DRAMSim2 build is shared across all configs in the build root.
-main.SConscript('ext/dramsim2/SConscript',
- variant_dir = joinpath(build_root, 'dramsim2'))
-
-# DRAMPower build is shared across all configs in the build root.
-main.SConscript('ext/drampower/SConscript',
- variant_dir = joinpath(build_root, 'drampower'))
-
-# nomali build is shared across all configs in the build root.
-main.SConscript('ext/nomali/SConscript',
- variant_dir = joinpath(build_root, 'nomali'))
+# builds in ext are shared across all configs in the build root.
+ext_dir = abspath(joinpath(str(main.root), 'ext'))
+for root, dirs, files in os.walk(ext_dir):
+ if 'SConscript' in files:
+ build_dir = os.path.relpath(root, ext_dir)
+ main.SConscript(joinpath(root, 'SConscript'),
+ variant_dir=joinpath(build_root, build_dir))
###################################################
#