Add Users Guide example of using $SOURCE substitution in a target name in a Command...
authorgaryo <garyo@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 2 Oct 2008 01:43:53 +0000 (01:43 +0000)
committergaryo <garyo@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 2 Oct 2008 01:43:53 +0000 (01:43 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@3528 fdb21ef1-2011-0410-befe-b5e4ea1792b1

doc/user/builders-commands.in
doc/user/builders-commands.xml

index 7265a233cbe4263a21c880b29388fc7e8af2fa82..d8240522fb289b6ee843637cca2f56c0d0cef1d0 100644 (file)
   <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>
+
index 15a6015cc24ad37407eda3f5eb66aff64fe65afd..fcb2a96d69ca5d43e0304f836077e895317e9ea1 100644 (file)
     % <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>
+