summaryrefslogtreecommitdiffstats
path: root/doc/user/builders-commands.xml
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/user/builders-commands.xml
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/user/builders-commands.xml')
-rw-r--r--doc/user/builders-commands.xml21
1 files changed, 21 insertions, 0 deletions
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>
+