Deleted Added
sdiff udiff text old ( 3717:d4eacb8998d2 ) new ( 3718:9d40568cfaeb )
full compact
1# -*- mode:python -*-
2
3# Copyright (c) 2004-2005 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 92 unchanged lines hidden (view full) ---

101# Figure out which configurations to set up based on the path(s) of
102# the target(s).
103#
104###################################################
105
106# Find default configuration & binary.
107Default(os.environ.get('M5_DEFAULT_BINARY', 'build/ALPHA_SE/m5.debug'))
108
109# Ask SCons which directory it was invoked from.
110launch_dir = GetLaunchDir()
111
112# Make targets relative to invocation directory
113abs_targets = map(lambda x: os.path.normpath(joinpath(launch_dir, str(x))),
114 BUILD_TARGETS)
115
116# helper function: find last occurrence of element in list
117def rfind(l, elt, offs = -1):
118 for i in range(len(l)+offs, 0, -1):
119 if l[i] == elt:
120 return i
121 raise ValueError, "element not found"
122
123# helper function: compare dotted version numbers.

--- 13 unchanged lines hidden (view full) ---

137 return 0
138
139# Each target must have 'build' in the interior of the path; the
140# directory below this will determine the build parameters. For
141# example, for target 'foo/bar/build/ALPHA_SE/arch/alpha/blah.do' we
142# recognize that ALPHA_SE specifies the configuration because it
143# follow 'build' in the bulid path.
144
145# Generate a list of the unique build roots and configs that the
146# collected targets reference.
147build_paths = []
148build_root = None
149for t in abs_targets:
150 path_dirs = t.split('/')
151 try:
152 build_top = rfind(path_dirs, 'build', -2)

--- 475 unchanged lines hidden ---