summaryrefslogtreecommitdiffstats
path: root/doc/user
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2008-08-24 22:37:45 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2008-08-24 22:37:45 (GMT)
commit971d0847a90af1327b9001501731f6720f056774 (patch)
tree3671e52d55bbac0d9f44a620b0dd6f5201bc552b /doc/user
parent539362c833c966a5f55aac4a222fce6313bccec5 (diff)
downloadSCons-971d0847a90af1327b9001501731f6720f056774.zip
SCons-971d0847a90af1327b9001501731f6720f056774.tar.gz
SCons-971d0847a90af1327b9001501731f6720f056774.tar.bz2
Fix for bug #243 - document how to use Ignore() to remove a target from
being built as default.
Diffstat (limited to 'doc/user')
-rw-r--r--doc/user/depends.in28
-rw-r--r--doc/user/depends.xml28
2 files changed, 55 insertions, 1 deletions
diff --git a/doc/user/depends.in b/doc/user/depends.in
index 1309807..8cd9970 100644
--- a/doc/user/depends.in
+++ b/doc/user/depends.in
@@ -1520,6 +1520,34 @@
Ignore(hello, '/usr/include/stdio.h')
</programlisting>
+ <para>
+ &Ignore; can also be used to prevent a generated file from being built
+ by default. This is due to the fact that directories depend on
+ their contents. So to ignore a generated file from the default build,
+ you specify that the directory should ignore the generated file.
+ Note that the file will still be built if the user specifically
+ requests the target on scons command line, or if the file is
+ a dependency of another file which is requested and/or is built
+ by default.
+ </para>
+
+ <scons_example name="ignore_explicit">
+ <file name="SConstruct" printme="1">
+ hello_obj=Object('hello.c')
+ hello = Program(hello_obj)
+ Ignore('.',[hello,hello_obj])
+ </file>
+ <file name="hello.c">
+ #include "stdio.h"
+ int main() { printf("Hello!\n"); }
+ </file>
+ </scons_example>
+
+ <scons_output example="ignore_explicit" os="posix">
+ <scons_output_command>scons -Q</scons_output_command>
+ <scons_output_command>scons -Q hello</scons_output_command>
+ <scons_output_command>scons -Q hello</scons_output_command>
+ </scons_output>
</section>
<section>
diff --git a/doc/user/depends.xml b/doc/user/depends.xml
index 61d2579..39866e2 100644
--- a/doc/user/depends.xml
+++ b/doc/user/depends.xml
@@ -1478,6 +1478,32 @@
Ignore(hello, '/usr/include/stdio.h')
</programlisting>
+ <para>
+ &Ignore; can also be used to prevent a generated file from being built
+ by default. This is due to the fact that directories depend on
+ their contents. So to ignore a generated file from the default build,
+ you specify that the directory should ignore the generated file.
+ Note that the file will still be built if the user specifically
+ requests the target on scons command line, or if the file is
+ a dependency of another file which is requested and/or is built
+ by default.
+ </para>
+
+ <programlisting>
+ hello_obj=Object('hello.c')
+ hello = Program(hello_obj)
+ Ignore('.',[hello,hello_obj])
+ </programlisting>
+
+ <screen>
+ % <userinput>scons -Q</userinput>
+ scons: `.' is up to date.
+ % <userinput>scons -Q hello</userinput>
+ cc -o hello.o -c hello.c
+ cc -o hello hello.o
+ % <userinput>scons -Q hello</userinput>
+ scons: `hello' is up to date.
+ </screen>
</section>
<section>
@@ -1632,7 +1658,7 @@
cc -o hello.o -c hello.c
cc -o hello version.o hello.o
% <userinput>scons -Q</userinput>
- cc -o version.o -c version.c
+ scons: `.' is up to date.
</screen>
</section>