summaryrefslogtreecommitdiff
path: root/doc/user/tasks.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/user/tasks.xml')
-rw-r--r--doc/user/tasks.xml64
1 files changed, 48 insertions, 16 deletions
diff --git a/doc/user/tasks.xml b/doc/user/tasks.xml
index b51b3b1..68112a1 100644
--- a/doc/user/tasks.xml
+++ b/doc/user/tasks.xml
@@ -1,6 +1,27 @@
+<?xml version='1.0'?>
+<!DOCTYPE sconsdoc [
+ <!ENTITY % scons SYSTEM "../scons.mod">
+ %scons;
+
+ <!ENTITY % builders-mod SYSTEM "../generated/builders.mod">
+ %builders-mod;
+ <!ENTITY % functions-mod SYSTEM "../generated/functions.mod">
+ %functions-mod;
+ <!ENTITY % tools-mod SYSTEM "../generated/tools.mod">
+ %tools-mod;
+ <!ENTITY % variables-mod SYSTEM "../generated/variables.mod">
+ %variables-mod;
+]>
+
+<appendix id="app-tasks"
+ xmlns="http://www.scons.org/dbxsd/v1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0/scons.xsd scons.xsd">
+<title>Handling Common Tasks</title>
+
<!--
- Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation
+ Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 The SCons Foundation
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -91,25 +112,40 @@ those files and use them in &SCons;.
</para>
-<programlisting>
+<scons_example name="tasks_ex1">
+<file name="SConstruct" printme="1">
#### SConstruct
env = Environment()
env.Append(CPPPATH = "#")
## Header example
env.Append(BUILDERS =
- {'Copy1' : Builder(action = 'cat &lt; $SOURCE &gt; $TARGET',
+ {'Copy1' : Builder(action = 'cat &lt; $SOURCE > $TARGET',
suffix='.h', src_suffix='.bar')})
env.Copy1('test.bar') # produces test.h from test.bar.
env.Program('app','main.cpp') # indirectly depends on test.bar
## Source file example
env.Append(BUILDERS =
- {'Copy2' : Builder(action = 'cat &lt; $SOURCE &gt; $TARGET',
+ {'Copy2' : Builder(action = 'cat &lt; $SOURCE > $TARGET',
suffix='.cpp', src_suffix='.bar2')})
foo = env.Copy2('foo.bar2') # produces foo.cpp from foo.bar2.
env.Program('app2',['main2.cpp'] + foo) # compiles main2.cpp and foo.cpp into app2.
-</programlisting>
+</file>
+
+<file name="main.cpp">
+#include "test.h"
+</file>
+<file name="test.bar">
+// nothing here
+</file>
+<file name="main2.cpp">
+//// main2.cpp
+</file>
+<file name="foo.bar2">
+// nothing here
+</file>
+</scons_example>
<para>
@@ -117,21 +153,17 @@ Where main.cpp looks like this:
</para>
-
- <programlisting>
-#include "test.h"
-</programlisting>
+ <scons_example_file example="tasks_ex1" name="main.cpp">
+ </scons_example_file>
<para>
produces this:
</para>
- <screen>
- % <userinput>scons -Q</userinput>
- cc -o app main.cpp
- cat &lt; foo.bar2 &gt; foo.cpp
- cc -o app2 main2.cpp foo.cpp
- cat &lt; test.bar &gt; test.h
- </screen>
+ <scons_output example="tasks_ex1" suffix="1">
+ <scons_output_command>scons -Q</scons_output_command>
+ </scons_output>
</example>
+
+</appendix>