6 This creates a hash of global Aliases (dummy targets).
11 # Copyright (c) 2001, 2002 Steven Knight
13 # Permission is hereby granted, free of charge, to any person obtaining
14 # a copy of this software and associated documentation files (the
15 # "Software"), to deal in the Software without restriction, including
16 # without limitation the rights to use, copy, modify, merge, publish,
17 # distribute, sublicense, and/or sell copies of the Software, and to
18 # permit persons to whom the Software is furnished to do so, subject to
19 # the following conditions:
21 # The above copyright notice and this permission notice shall be included
22 # in all copies or substantial portions of the Software.
24 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
25 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
26 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
28 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
29 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
30 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33 __revision__ = "__FILE__ __REVISION__ __DATE__ __USER__"
41 class AliasNameSpace(UserDict.UserDict):
42 def Alias(self, name):
43 if self.has_key(name):
44 raise SCons.Errors.UserError
45 self[name] = SCons.Node.Alias.Alias(name)
48 def lookup(self, name):
54 class Alias(SCons.Node.Node):
55 def __init__(self, name):
56 SCons.Node.Node.__init__(self)
63 """A "builder" for aliases."""
66 def set_bsig(self, bsig):
67 """An alias has no signature."""
70 def set_csig(self, csig):
71 """An alias has no signature."""
74 def current(self, calc):
75 """If all of our children were up-to-date, then this
76 Alias was up-to-date, too."""
77 # Allow the children to calculate their signatures.
80 for kid in self.children(None):
82 if s and (not state or s > state):
84 if state == 0 or state == SCons.Node.up_to_date:
90 """An Alias is not recorded in .sconsign files"""
93 def is_under(self, dir):
94 # Make Alias nodes get built regardless of
95 # what directory scons was run from. Alias nodes
96 # are outside the filesystem:
99 default_ans = AliasNameSpace()
101 SCons.Node.arg2nodes_lookups.append(default_ans.lookup)