summaryrefslogtreecommitdiffstats
path: root/doc/user/builders-commands.xml
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2010-01-19 07:06:10 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2010-01-19 07:06:10 (GMT)
commit0f73b4ad9204d64748398ea5c6657455ea3f0306 (patch)
tree0483dc3727591da7ec2057e4e80f4b4ce970ec0c /doc/user/builders-commands.xml
parentbf296710383d7b1a744b62a007041c677583ad6a (diff)
downloadSCons-0f73b4ad9204d64748398ea5c6657455ea3f0306.zip
SCons-0f73b4ad9204d64748398ea5c6657455ea3f0306.tar.gz
SCons-0f73b4ad9204d64748398ea5c6657455ea3f0306.tar.bz2
rebuilt docs
Diffstat (limited to 'doc/user/builders-commands.xml')
-rw-r--r--doc/user/builders-commands.xml59
1 files changed, 59 insertions, 0 deletions
diff --git a/doc/user/builders-commands.xml b/doc/user/builders-commands.xml
index 23fe4ce..fcb2a96 100644
--- a/doc/user/builders-commands.xml
+++ b/doc/user/builders-commands.xml
@@ -85,3 +85,62 @@
<screen>
% <userinput>scons -Q</userinput>
+ sed 's/x/y/' &lt; foo.in &gt; foo.out
+ </screen>
+
+ <para>
+
+ This is often more convenient than
+ creating a &Builder; object
+ and adding it to the &cv-link-BUILDERS; variable
+ of a &consenv;
+
+ </para>
+
+ <para>
+
+ Note that the action you specify to the
+ &Command; &Builder; can be any legal &SCons; &Action;,
+ such as a Python function:
+
+ </para>
+
+ <programlisting>
+ env = Environment()
+ def build(target, source, env):
+ # Whatever it takes to build
+ return None
+ env.Command('foo.out', 'foo.in', build)
+ </programlisting>
+
+ <para>
+
+ Which executes as follows:
+
+ </para>
+
+ <screen>
+ % <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>
+