summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@oberbrunner.com>2008-10-02 01:43:53 (GMT)
committerGary Oberbrunner <garyo@oberbrunner.com>2008-10-02 01:43:53 (GMT)
commit2339a80cd71559200f18733234af6d5fb93ccbf7 (patch)
tree196981760f94a7566a5abe3aa94097bc7243624c /doc
parent58b4b0a5adcbf3db1bbb7536d367c3629b1264ec (diff)
downloadSCons-2339a80cd71559200f18733234af6d5fb93ccbf7.zip
SCons-2339a80cd71559200f18733234af6d5fb93ccbf7.tar.gz
SCons-2339a80cd71559200f18733234af6d5fb93ccbf7.tar.bz2
Add Users Guide example of using $SOURCE substitution in a target name in a Command builder. Just doc.
Diffstat (limited to 'doc')
-rw-r--r--doc/user/builders-commands.in23
-rw-r--r--doc/user/builders-commands.xml21
2 files changed, 44 insertions, 0 deletions
diff --git a/doc/user/builders-commands.in b/doc/user/builders-commands.in
index 7265a23..d824052 100644
--- a/doc/user/builders-commands.in
+++ b/doc/user/builders-commands.in
@@ -131,3 +131,26 @@
<scons_output example="ex2">
<scons_output_command>scons -Q</scons_output_command>
</scons_output>
+
+ <para>
+
+ Note that &cv-link-SOURCE; and &cv-link-TARGET; are expanded
+ in the source and target as well as of SCons 1.1,
+ so you can write:
+
+ </para>
+
+ <scons_example name="ex3">
+ <file name="SConstruct" printme="1">
+ env.Command('${SOURCE.basename}.out', 'foo.in', build)
+ </file>
+ </scons_example>
+
+
+ <para>
+
+ which does the same thing as the previous example, but allows you
+ to avoid repeating yourself.
+
+ </para>
+
diff --git a/doc/user/builders-commands.xml b/doc/user/builders-commands.xml
index 15a6015..fcb2a96 100644
--- a/doc/user/builders-commands.xml
+++ b/doc/user/builders-commands.xml
@@ -123,3 +123,24 @@
% <userinput>scons -Q</userinput>
build(["foo.out"], ["foo.in"])
</screen>
+
+ <para>
+
+ Note that &cv-link-SOURCE; and &cv-link-TARGET; are expanded
+ in the source and target as well as of SCons 1.1,
+ so you can write:
+
+ </para>
+
+ <programlisting>
+ env.Command('${SOURCE.basename}.out', 'foo.in', build)
+ </programlisting>
+
+
+ <para>
+
+ which does the same thing as the previous example, but allows you
+ to avoid repeating yourself.
+
+ </para>
+