summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2006-12-04 09:09:36 -0800
committerSteve Reinhardt <stever@eecs.umich.edu>2006-12-04 09:09:36 -0800
commit51e3688701fe66987f96c5ddc5b8f111f4ad94d6 (patch)
tree0cdd8f725ef379e785aed6247b5a0befe05a021b /SConstruct
parent6b9903f4265a263df5a99c607b4595360fa4f56d (diff)
downloadgem5-51e3688701fe66987f96c5ddc5b8f111f4ad94d6.tar.xz
Better handling of scons -u targets.
--HG-- extra : convert_revision : 7bf0688a1c83d8385b77a59a1c75040e9624c0ae
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct20
1 files changed, 13 insertions, 7 deletions
diff --git a/SConstruct b/SConstruct
index b9a2defda..7e8c6c2f0 100644
--- a/SConstruct
+++ b/SConstruct
@@ -106,13 +106,6 @@ sys.path.append(joinpath(ROOT, 'src/python'))
# Find default configuration & binary.
Default(os.environ.get('M5_DEFAULT_BINARY', 'build/ALPHA_SE/m5.debug'))
-# Ask SCons which directory it was invoked from.
-launch_dir = GetLaunchDir()
-
-# Make targets relative to invocation directory
-abs_targets = map(lambda x: os.path.normpath(joinpath(launch_dir, str(x))),
- BUILD_TARGETS)
-
# helper function: find last occurrence of element in list
def rfind(l, elt, offs = -1):
for i in range(len(l)+offs, 0, -1):
@@ -142,6 +135,19 @@ def compare_versions(v1, v2):
# recognize that ALPHA_SE specifies the configuration because it
# follow 'build' in the bulid path.
+# Generate absolute paths to targets so we can see where the build dir is
+if COMMAND_LINE_TARGETS:
+ # Ask SCons which directory it was invoked from
+ launch_dir = GetLaunchDir()
+ # Make targets relative to invocation directory
+ abs_targets = map(lambda x: os.path.normpath(joinpath(launch_dir, str(x))),
+ COMMAND_LINE_TARGETS)
+else:
+ # Default targets are relative to root of tree
+ abs_targets = map(lambda x: os.path.normpath(joinpath(ROOT, str(x))),
+ DEFAULT_TARGETS)
+
+
# Generate a list of the unique build roots and configs that the
# collected targets reference.
build_paths = []