From 140d836e9cd54fb67b969fd82ef7ed19ba574d40 Mon Sep 17 00:00:00 2001 From: Luca Falavigna Date: Sat, 26 Apr 2014 15:11:58 +0200 Subject: Imported Upstream version 2.3.1 --- src/engine/SCons/Script/SConscript.xml | 165 +++++++++++++++++++++++++-------- 1 file changed, 126 insertions(+), 39 deletions(-) (limited to 'src/engine/SCons/Script/SConscript.xml') diff --git a/src/engine/SCons/Script/SConscript.xml b/src/engine/SCons/Script/SConscript.xml index e30997c..9fab301 100644 --- a/src/engine/SCons/Script/SConscript.xml +++ b/src/engine/SCons/Script/SConscript.xml @@ -1,15 +1,35 @@ + + +%scons; + +%builders-mod; + +%functions-mod; + +%tools-mod; + +%variables-mod; +]> + + + + (targets) + This specifies a list of default targets, which will be built by &scons; @@ -18,7 +38,9 @@ Multiple calls to &f-Default; are legal, and add to the list of default targets. + + Multiple targets should be specified as separate arguments to the &f-Default; @@ -27,16 +49,20 @@ method, or as a list. will also accept the Node returned by any of a construction environment's builder methods. + + Examples: + - + Default('foo', 'bar', 'baz') env.Default(['a', 'b', 'c']) hello = env.Program('hello', 'hello.c') env.Default(hello) - + + An argument to &f-Default; of @@ -46,13 +72,16 @@ Later calls to &f-Default; will add to the (now empty) default-target list like normal. + + The current list of targets added using the &f-Default; function or method is available in the DEFAULT_TARGETS list; see below. + @@ -61,17 +90,21 @@ see below. (major, minor) + Ensure that the Python version is at least major.minor. This function will print out an error message and exit SCons with a non-zero exit code if the actual Python version is not late enough. + + Example: + - + EnsurePythonVersion(2,2) - + @@ -80,6 +113,7 @@ EnsurePythonVersion(2,2) (major, minor, [revision]) + Ensure that the SCons version is at least major.minor, or @@ -90,14 +124,17 @@ is specified. This function will print out an error message and exit SCons with a non-zero exit code if the actual SCons version is not late enough. + + Examples: + - + EnsureSConsVersion(0,14) EnsureSConsVersion(0,96,90) - + @@ -106,6 +143,7 @@ EnsureSConsVersion(0,96,90) ([value]) + This tells &scons; to exit immediately @@ -115,6 +153,7 @@ A default exit value of 0 (zero) is used if no value is specified. + @@ -123,6 +162,7 @@ is used if no value is specified. (vars) + This tells &scons; to export a list of variables from the current @@ -137,10 +177,13 @@ as separate arguments or as a list. Keyword arguments can be used to provide names and their values. A dictionary can be used to map variables to a different name when exported. Both local variables and global variables can be exported. + + Examples: + - + env = Environment() # Make env available for all SConscript files to Import(). Export("env") @@ -157,8 +200,9 @@ Export(debug = env) # Make env available using the name debug: Export({"debug":env}) - + + Note that the &f-SConscript; function supports an @@ -168,6 +212,7 @@ set of variables to a single SConscript file. See the description of the &f-SConscript; function, below. + @@ -176,6 +221,7 @@ function, below. () + Returns the absolute path name of the directory from which &scons; was initially invoked. @@ -188,6 +234,7 @@ options, which internally change to the directory in which the &SConstruct; file is found. + @@ -196,6 +243,7 @@ file is found. (text) + This specifies help text to be printed if the argument is given to @@ -206,6 +254,7 @@ is called multiple times, the text is appended together in the order that &f-Help; is called. + @@ -214,6 +263,7 @@ is called. (vars) + This tells &scons; to import a list of variables into the current SConscript file. This @@ -230,15 +280,18 @@ Multiple variable names can be passed to &f-Import; as separate arguments or as a list. The variable "*" can be used to import all variables. + + Examples: + - + Import("env") Import("env", "variable") Import(["env", "variable"]) Import("*") - + @@ -247,6 +300,7 @@ Import("*") ([vars..., stop=]) + By default, this stops processing the current SConscript file and returns to the calling SConscript file @@ -256,7 +310,9 @@ string arguments. Multiple strings contaning variable names may be passed to &f-Return;. Any strings that contain white space + + The optional stop= keyword argument may be set to a false value @@ -271,10 +327,13 @@ are still the values of the variables in the named at the point &f-Return; is called. + + Examples: + - + # Returns without returning a value. Return() @@ -286,7 +345,7 @@ Return("foo", "bar") # Returns the values of Python variables 'val1' and 'val2'. Return('val1 val2') - + @@ -300,6 +359,7 @@ Return('val1 val2') + This tells &scons; to execute @@ -311,7 +371,9 @@ will be returned by the call to There are two ways to call the &f-SConscript; function. + + The first way you can call &f-SConscript; is to explicitly specify one or more @@ -323,13 +385,15 @@ multiple scripts must be specified as a list a function like &f-Split;). Examples: - + + SConscript('SConscript') # run SConscript in the current directory SConscript('src/SConscript') # run SConscript in the src directory SConscript(['src/SConscript', 'doc/SConscript']) config = SConscript('MyConfig.py') - + + The second way you can call &f-SConscript; is to specify a list of (sub)directory names @@ -349,13 +413,15 @@ by supplying an optional keyword argument. The first three examples below have the same effect as the first three examples above: - + + SConscript(dirs='.') # run SConscript in the current directory SConscript(dirs='src') # run SConscript in the src directory SConscript(dirs=['src', 'doc']) SConscript(dirs=['sub1', 'sub2'], name='MySConscript') - + + The optional exports argument provides a list of variable names or a dictionary of @@ -373,13 +439,15 @@ must use the &f-link-Import; function to import the variables. Examples: - + + foo = SConscript('sub/SConscript', exports='env') SConscript('dir/SConscript', exports=['env', 'variable']) SConscript(dirs='subdir', exports='env variable') SConscript(dirs=['one', 'two', 'three'], exports='shared_info') - + + If the optional variant_dir argument is present, it causes an effect equivalent to the @@ -405,7 +473,9 @@ file. See the description of the &f-VariantDir; function below for additional details and restrictions. + + If variant_dir is present, @@ -421,32 +491,40 @@ file resides and the file is evaluated as if it were in the variant_dir directory: - + + SConscript('src/SConscript', variant_dir = 'build') - + + is equivalent to + - + VariantDir('build', 'src') SConscript('build/SConscript') - + + This later paradigm is often used when the sources are in the same directory as the &SConstruct;: + - + SConscript('SConscript', variant_dir = 'build') - + + is equivalent to + - + VariantDir('build', '.') SConscript('build/SConscript') - + + + + Here are some composite examples: + - + # collect the configuration information and use it to build src and doc shared_info = SConscript('MyConfig.py') SConscript('src/SConscript', exports='shared_info') SConscript('doc/SConscript', exports='shared_info') - + - + # build debugging and production versions. SConscript # can use Dir('.').path to determine variant. SConscript('SConscript', variant_dir='debug', duplicate=0) SConscript('SConscript', variant_dir='prod', duplicate=0) - + - + # build debugging and production versions. SConscript # is passed flags to use. opts = { 'CPPDEFINES' : ['DEBUG'], 'CCFLAGS' : '-pgdb' } SConscript('SConscript', variant_dir='debug', duplicate=0, exports=opts) opts = { 'CPPDEFINES' : ['NODEBUG'], 'CCFLAGS' : '-O' } SConscript('SConscript', variant_dir='prod', duplicate=0, exports=opts) - + - + # build common documentation and compile for different architectures SConscript('doc/SConscript', variant_dir='build/doc', duplicate=0) SConscript('src/SConscript', variant_dir='build/x86', duplicate=0) SConscript('src/SConscript', variant_dir='build/ppc', duplicate=0) - + + + \ No newline at end of file -- cgit v1.2.3