3 SPDX-FileCopyrightText: Copyright The SCons Foundation (https://scons.org)
4 SPDX-License-Identifier: MIT
5 SPDX-FileType: DOCUMENTATION
7 This file is processed by the bin/SConsDoc.py module.
11 <!ENTITY % scons SYSTEM '../../doc/scons.mod'>
13 <!ENTITY % builders-mod SYSTEM '../../doc/generated/builders.mod'>
15 <!ENTITY % functions-mod SYSTEM '../../doc/generated/functions.mod'>
17 <!ENTITY % tools-mod SYSTEM '../../doc/generated/tools.mod'>
19 <!ENTITY % variables-mod SYSTEM '../../doc/generated/variables.mod'>
23 <sconsdoc xmlns="http://www.scons.org/dbxsd/v1.0"
24 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
25 xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">
31 Sets construction variables for file
32 and directory installation.
37 <item>INSTALLSTR</item>
41 <builder name="Install">
44 Installs one or more source files or directories
45 in the specified target,
46 which must be a directory.
47 The names of the specified source files or directories
48 remain the same within the destination directory. The
49 sources may be given as a string or as a node returned by
54 env.Install(target='/usr/local/bin', source=['foo', 'bar'])
58 Note that if target paths chosen for the
59 &Install; builder (and the related &InstallAs; and
60 &InstallVersionedLib; builders) are outside the
61 project tree, such as in the example above,
62 they may not be selected for "building" by default,
63 since in the absence of other instructions
64 &scons; builds targets that are underneath the top directory
65 (the directory that contains the &SConstruct; file,
66 usually the current directory).
67 Use command line targets or the &Default; function
72 If the <option>--install-sandbox</option> command line
73 option is given, the target directory will be prefixed
74 by the directory path specified.
75 This is useful to test installation behavior without installing to
76 a "live" location in the system.
80 See also &FindInstalledFiles;.
81 For more thoughts on installation, see the User Guide
82 (particularly the section on Command-Line Targets
83 and the chapters on Installing Files and on Alias Targets).
89 <builder name="InstallAs">
92 Installs one or more source files or directories
94 allowing changing a file or directory name
95 as part of the installation.
100 arguments list different numbers of files or directories.
104 env.InstallAs(target='/usr/local/bin/foo',
106 env.InstallAs(target=['../lib/libfoo.a', '../lib/libbar.a'],
107 source=['libFOO.a', 'libBAR.a'])
111 See the note under &Install;.
117 <builder name="InstallVersionedLib">
120 Installs a versioned shared library. The symlinks appropriate to the
121 architecture will be generated based on symlinks of the source library.
125 env.InstallVersionedLib(target='/usr/local/bin/foo',
126 source='libxyz.1.5.2.so')
130 See the note under &Install;.