diff options
Diffstat (limited to 'doc/user/alias.xml')
-rw-r--r-- | doc/user/alias.xml | 112 |
1 files changed, 63 insertions, 49 deletions
diff --git a/doc/user/alias.xml b/doc/user/alias.xml index 47b1da9..883ebef 100644 --- a/doc/user/alias.xml +++ b/doc/user/alias.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-alias" + 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>Alias Targets</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 @@ -30,12 +52,17 @@ </para> - <programlisting> - env = Environment() - hello = env.Program('hello.c') - env.Install('/usr/bin', hello) - env.Alias('install', '/usr/bin') - </programlisting> + <scons_example name="alias_ex1"> + <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> @@ -44,12 +71,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" - </screen> + <scons_output example="alias_ex1" os="posix" suffix="1"> + <scons_output_command>scons -Q install</scons_output_command> + </scons_output> <para> @@ -64,16 +88,24 @@ </para> - <programlisting> - env = Environment() - p = env.Program('foo.c') - l = env.Library('bar.c') - env.Install('/usr/bin', p) - env.Install('/usr/lib', l) - ib = env.Alias('install-bin', '/usr/bin') - il = env.Alias('install-lib', '/usr/lib') - env.Alias('install', [ib, il]) - </programlisting> + <scons_example name="alias_ex2"> + <file name="SConstruct" printme="1"> +env = Environment() +p = env.Program('foo.c') +l = env.Library('bar.c') +env.Install('__ROOT__/usr/bin', p) +env.Install('__ROOT__/usr/lib', l) +ib = env.Alias('install-bin', '__ROOT__/usr/bin') +il = env.Alias('install-lib', '__ROOT__/usr/lib') +env.Alias('install', [ib, il]) + </file> + <file name="foo.c"> +int main() { printf("foo.c\n"); } + </file> + <file name="bar.c"> +void bar() { printf("bar.c\n"); } + </file> + </scons_example> <para> @@ -84,29 +116,11 @@ </para> - <screen> - % <userinput>scons -Q install-bin</userinput> - cc -o foo.o -c foo.c - cc -o foo foo.o - Install file: "foo" as "/usr/bin/foo" - % <userinput>scons -Q install-lib</userinput> - cc -o bar.o -c bar.c - ar rc libbar.a bar.o - ranlib libbar.a - Install file: "libbar.a" as "/usr/lib/libbar.a" - % <userinput>scons -Q -c /</userinput> - Removed foo.o - Removed foo - Removed /usr/bin/foo - Removed bar.o - Removed libbar.a - Removed /usr/lib/libbar.a - % <userinput>scons -Q install</userinput> - cc -o foo.o -c foo.c - cc -o foo foo.o - Install file: "foo" as "/usr/bin/foo" - cc -o bar.o -c bar.c - ar rc libbar.a bar.o - ranlib libbar.a - Install file: "libbar.a" as "/usr/lib/libbar.a" - </screen> + <scons_output example="alias_ex2" os="posix" suffix="1"> + <scons_output_command>scons -Q install-bin</scons_output_command> + <scons_output_command>scons -Q install-lib</scons_output_command> + <scons_output_command>scons -Q -c __ROOT__/</scons_output_command> + <scons_output_command>scons -Q install</scons_output_command> + </scons_output> + +</chapter> |