This Node object, or the alias name,
may be used as a dependency of any other target,
including another alias. Alias can be called multiple times for the same
-alias to add additional targets to the alias.
+alias to add additional targets to the alias. There is also an Alias
+global function for creating or referencing an alias independently of
+any construction environment.
.ES
env.Alias('install', ['/usr/local/bin', '/usr/local/lib'])
can be converted into an Action object
(see below).
+.TP
+.RI Alias ( name )
+Creates or references an alias independent of the construction environment.
+
+.ES
+Alias('install')
+.EE
+
.TP
.RI BuildDir( build_dir ", " src_dir ", [" duplicate ])
This specifies a build directory
- Add support for using Ghostscript to convert Postscript to PDF files.
+ From Anthony Roach:
+
+ - Add a standalone "Alias" function (separate from an Environment).
+
From Greg Spencer:
- Support the C preprocessor #import statement.
import SCons.Util
import SCons.Options
import SCons
+import SCons.Node.Alias
import os
import os.path
def Exit(value=0):
sys.exit(value)
+
+def Alias(name):
+ alias = SCons.Node.Alias.default_ans.lookup(name)
+ if alias is None:
+ alias = SCons.Node.Alias.default_ans.Alias(name)
+ return alias
+
def BuildDefaultGlobals():
"""
Create a dictionary containing all the default globals for
globals['TargetSignatures'] = TargetSignatures
globals['Tool'] = SCons.Tool.Tool
globals['WhereIs'] = SCons.Util.WhereIs
+ globals['Alias'] = Alias
return globals
env.B(target = 'f3.out', source = 'f3.in')
SConscript('sub1/SConscript', "env")
SConscript('sub2/SConscript', "env")
-env.Alias('foo', ['f2.out', 'sub1'])
-env.Alias('bar', ['sub2', 'f3.out'])
+
+foo = Alias('foo')
+foo2 = env.Alias('foo', ['f2.out', 'sub1'])
+assert foo == foo2
+bar = env.Alias('bar', ['sub2', 'f3.out'])
env.Alias('blat', ['sub2', 'f3.out'])
env.Alias('blat', ['f2.out', 'sub1'])
env.Depends('f1.out', 'bar')
+
+assert Alias('foo') == foo
+assert Alias('bar') == bar
+
""" % python)
test.write(['sub1', 'SConscript'], """