5 Permission is hereby granted, free of charge, to any person obtaining
6 a copy of this software and associated documentation files (the
7 "Software"), to deal in the Software without restriction, including
8 without limitation the rights to use, copy, modify, merge, publish,
9 distribute, sublicense, and/or sell copies of the Software, and to
10 permit persons to whom the Software is furnished to do so, subject to
11 the following conditions:
13 The above copyright notice and this permission notice shall be included
14 in all copies or substantial portions of the Software.
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
17 KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
18 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 We've already seen how you can use the &Alias;
29 function to create a target named <literal>install</literal>:
35 hello = env.Program('hello.c')
36 env.Install('/usr/bin', hello)
37 env.Alias('install', '/usr/bin')
42 You can then use this alias on the command line
43 to tell &SCons; more naturally that you want to install files:
48 % <userinput>scons -Q install</userinput>
49 cc -o hello.o -c hello.c
51 Install file: "hello" as "/usr/bin/hello"
56 Like other &Builder; methods, though,
57 the &Alias; method returns an object
58 representing the alias being built.
59 You can then use this object as input to anothother &Builder;.
60 This is especially useful if you use such an object
61 as input to another call to the &Alias; &Builder;,
62 allowing you to create a hierarchy
69 p = env.Program('foo.c')
70 l = env.Library('bar.c')
71 env.Install('/usr/bin', p)
72 env.Install('/usr/lib', l)
73 ib = env.Alias('install-bin', '/usr/bin')
74 il = env.Alias('install-lib', '/usr/lib')
75 env.Alias('install', [ib, il])
80 This example defines separate <literal>install</literal>,
81 <literal>install-bin</literal>,
82 and <literal>install-lib</literal> aliases,
83 allowing you finer control over what gets installed:
88 % <userinput>scons -Q install-bin</userinput>
91 Install file: "foo" as "/usr/bin/foo"
92 % <userinput>scons -Q install-lib</userinput>
96 Install file: "libbar.a" as "/usr/lib/libbar.a"
97 % <userinput>scons -Q -c /</userinput>
103 Removed /usr/lib/libbar.a
104 % <userinput>scons -Q install</userinput>
107 Install file: "foo" as "/usr/bin/foo"
111 Install file: "libbar.a" as "/usr/lib/libbar.a"