summaryrefslogtreecommitdiff
path: root/doc/user/install.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/user/install.xml')
-rw-r--r--doc/user/install.xml194
1 files changed, 114 insertions, 80 deletions
diff --git a/doc/user/install.xml b/doc/user/install.xml
index 37a508f..e229268 100644
--- a/doc/user/install.xml
+++ b/doc/user/install.xml
@@ -1,6 +1,28 @@
+<?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;
+
+]>
+
+<chapter id="chap-install"
+ 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>Installing Files in Other Directories: the &Install; Builder</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
@@ -34,11 +56,16 @@
</para>
- <programlisting>
- env = Environment()
- hello = env.Program('hello.c')
- env.Install('/usr/bin', hello)
- </programlisting>
+ <scons_example name="install_ex1">
+ <file name="SConstruct" printme="1">
+env = Environment()
+hello = env.Program('hello.c')
+env.Install('__ROOT__/usr/bin', hello)
+ </file>
+ <file name="hello.c">
+int main() { printf("Hello, world!\n"); }
+ </file>
+ </scons_example>
<para>
@@ -56,13 +83,10 @@
</para>
- <screen>
- % <userinput>scons -Q</userinput>
- cc -o hello.o -c hello.c
- cc -o hello hello.o
- % <userinput>scons -Q /usr/bin</userinput>
- Install file: "hello" as "/usr/bin/hello"
- </screen>
+ <scons_output example="install_ex1" suffix="1">
+ <scons_output_command>scons -Q</scons_output_command>
+ <scons_output_command>scons -Q __ROOT__/usr/bin</scons_output_command>
+ </scons_output>
<para>
@@ -78,12 +102,17 @@
</para>
- <programlisting>
- env = Environment()
- hello = env.Program('hello.c')
- env.Install('/usr/bin', hello)
- env.Alias('install', '/usr/bin')
- </programlisting>
+ <scons_example name="install_ex2">
+ <file name="SConstruct" printme="1">
+env = Environment()
+hello = env.Program('hello.c')
+env.Install('__ROOT__/usr/bin', hello)
+env.Alias('install', '__ROOT__/usr/bin')
+ </file>
+ <file name="hello.c">
+int main() { printf("Hello, world!\n"); }
+ </file>
+ </scons_example>
<para>
@@ -93,13 +122,10 @@
</para>
- <screen>
- % <userinput>scons -Q</userinput>
- cc -o hello.o -c hello.c
- cc -o hello hello.o
- % <userinput>scons -Q install</userinput>
- Install file: "hello" as "/usr/bin/hello"
- </screen>
+ <scons_output example="install_ex2" suffix="1">
+ <scons_output_command>scons -Q</scons_output_command>
+ <scons_output_command>scons -Q install</scons_output_command>
+ </scons_output>
<section>
<title>Installing Multiple Files in a Directory</title>
@@ -111,14 +137,22 @@
</para>
- <programlisting>
- env = Environment()
- hello = env.Program('hello.c')
- goodbye = env.Program('goodbye.c')
- env.Install('/usr/bin', hello)
- env.Install('/usr/bin', goodbye)
- env.Alias('install', '/usr/bin')
- </programlisting>
+ <scons_example name="install_ex3">
+ <file name="SConstruct" printme="1">
+env = Environment()
+hello = env.Program('hello.c')
+goodbye = env.Program('goodbye.c')
+env.Install('__ROOT__/usr/bin', hello)
+env.Install('__ROOT__/usr/bin', goodbye)
+env.Alias('install', '__ROOT__/usr/bin')
+ </file>
+ <file name="hello.c">
+int main() { printf("Hello, world!\n"); }
+ </file>
+ <file name="goodbye.c">
+int main() { printf("Goodbye, world!\n"); }
+ </file>
+ </scons_example>
<para>
@@ -128,13 +162,13 @@
</para>
- <programlisting>
- env = Environment()
- hello = env.Program('hello.c')
- goodbye = env.Program('goodbye.c')
- env.Install('/usr/bin', [hello, goodbye])
- env.Alias('install', '/usr/bin')
- </programlisting>
+ <sconstruct>
+env = Environment()
+hello = env.Program('hello.c')
+goodbye = env.Program('goodbye.c')
+env.Install('__ROOT__/usr/bin', [hello, goodbye])
+env.Alias('install', '__ROOT__/usr/bin')
+ </sconstruct>
<para>
@@ -142,15 +176,9 @@
</para>
- <screen>
- % <userinput>scons -Q install</userinput>
- cc -o goodbye.o -c goodbye.c
- cc -o goodbye goodbye.o
- Install file: "goodbye" as "/usr/bin/goodbye"
- cc -o hello.o -c hello.c
- cc -o hello hello.o
- Install file: "hello" as "/usr/bin/hello"
- </screen>
+ <scons_output example="install_ex3" suffix="1">
+ <scons_output_command>scons -Q install</scons_output_command>
+ </scons_output>
</section>
@@ -167,12 +195,17 @@
</para>
- <programlisting>
- env = Environment()
- hello = env.Program('hello.c')
- env.InstallAs('/usr/bin/hello-new', hello)
- env.Alias('install', '/usr/bin')
- </programlisting>
+ <scons_example name="install_ex4">
+ <file name="SConstruct" printme="1">
+env = Environment()
+hello = env.Program('hello.c')
+env.InstallAs('__ROOT__/usr/bin/hello-new', hello)
+env.Alias('install', '__ROOT__/usr/bin')
+ </file>
+ <file name="hello.c">
+int main() { printf("Hello, world!\n"); }
+ </file>
+ </scons_example>
<para>
@@ -182,12 +215,9 @@
</para>
- <screen>
- % <userinput>scons -Q install</userinput>
- cc -o hello.o -c hello.c
- cc -o hello hello.o
- Install file: "hello" as "/usr/bin/hello-new"
- </screen>
+ <scons_output example="install_ex4" suffix="1">
+ <scons_output_command>scons -Q install</scons_output_command>
+ </scons_output>
</section>
@@ -205,15 +235,23 @@
</para>
- <programlisting>
- env = Environment()
- hello = env.Program('hello.c')
- goodbye = env.Program('goodbye.c')
- env.InstallAs(['/usr/bin/hello-new',
- '/usr/bin/goodbye-new'],
- [hello, goodbye])
- env.Alias('install', '/usr/bin')
- </programlisting>
+ <scons_example name="install_ex5">
+ <file name="SConstruct" printme="1">
+env = Environment()
+hello = env.Program('hello.c')
+goodbye = env.Program('goodbye.c')
+env.InstallAs(['__ROOT__/usr/bin/hello-new',
+ '__ROOT__/usr/bin/goodbye-new'],
+ [hello, goodbye])
+env.Alias('install', '__ROOT__/usr/bin')
+ </file>
+ <file name="hello.c">
+int main() { printf("Hello, world!\n"); }
+ </file>
+ <file name="goodbye.c">
+int main() { printf("Goodbye, world!\n"); }
+ </file>
+ </scons_example>
<para>
@@ -224,14 +262,10 @@
</para>
- <screen>
- % <userinput>scons -Q install</userinput>
- cc -o goodbye.o -c goodbye.c
- cc -o goodbye goodbye.o
- Install file: "goodbye" as "/usr/bin/goodbye-new"
- cc -o hello.o -c hello.c
- cc -o hello hello.o
- Install file: "hello" as "/usr/bin/hello-new"
- </screen>
+ <scons_output example="install_ex5" suffix="1">
+ <scons_output_command>scons -Q install</scons_output_command>
+ </scons_output>
</section>
+
+</chapter>