more NBUILDJOBS deprecation The NBUILDJOBS option was deprecated in 2002; there's no need to keep warning about it, remove from params / show-params, and only document as obsolete.diff -r1.152 -r1.153 src/BUILDING
(lukem)
--- src/BUILDING 2023/06/05 22:36:17 1.152
+++ src/BUILDING 2023/06/11 10:43:51 1.153
@@ -1,1319 +1,1314 @@ | @@ -1,1319 +1,1314 @@ | |||
1 | BUILDING(8) System Manager's Manual BUILDING(8) | 1 | BUILDING(8) System Manager's Manual BUILDING(8) | |
2 | 2 | |||
3 | NAME | 3 | NAME | |
4 | BUILDING - Procedure for building NetBSD from source code | 4 | BUILDING - Procedure for building NetBSD from source code | |
5 | 5 | |||
6 | REQUIREMENTS | 6 | REQUIREMENTS | |
7 | NetBSD is designed to be buildable on most POSIX-compliant host systems. | 7 | NetBSD is designed to be buildable on most POSIX-compliant host systems. | |
8 | The basic build procedure is the same whether compiling natively (on the | 8 | The basic build procedure is the same whether compiling natively (on the | |
9 | same NetBSD architecture) or cross compiling (on another architecture or | 9 | same NetBSD architecture) or cross compiling (on another architecture or | |
10 | OS). | 10 | OS). | |
11 | 11 | |||
12 | This source tree contains a special subtree, "tools", which uses the host | 12 | This source tree contains a special subtree, "tools", which uses the host | |
13 | system to create a build toolchain for the target architecture. The host | 13 | system to create a build toolchain for the target architecture. The host | |
14 | system must have at least C and C++ compilers in order to create the | 14 | system must have at least C and C++ compilers in order to create the | |
15 | toolchain (make is not required); all other tools are created as part of | 15 | toolchain (make is not required); all other tools are created as part of | |
16 | the NetBSD build process. (See the Environment variables section below | 16 | the NetBSD build process. (See the Environment variables section below | |
17 | if you need to override or manually select your compilers.) | 17 | if you need to override or manually select your compilers.) | |
18 | 18 | |||
19 | FILES | 19 | FILES | |
20 | Source tree layout | 20 | Source tree layout | |
21 | BUILDING This document (in plaintext). Generated from | 21 | BUILDING This document (in plaintext). Generated from | |
22 | doc/BUILDING.mdoc. | 22 | doc/BUILDING.mdoc. | |
23 | 23 | |||
24 | Makefile The main Makefile for NetBSD; should only be run for | 24 | Makefile The main Makefile for NetBSD; should only be run for | |
25 | native builds with an appropriately up-to-date version of | 25 | native builds with an appropriately up-to-date version of | |
26 | NetBSD make(1). Intended for expert use with knowledge of | 26 | NetBSD make(1). Intended for expert use with knowledge of | |
27 | its shortcomings, it has been superseded by the build.sh | 27 | its shortcomings, it has been superseded by the build.sh | |
28 | shell script as the recommended means for building NetBSD. | 28 | shell script as the recommended means for building NetBSD. | |
29 | 29 | |||
30 | UPDATING Special notes for updating from an earlier revision of | 30 | UPDATING Special notes for updating from an earlier revision of | |
31 | NetBSD. It is important to read this file before every | 31 | NetBSD. It is important to read this file before every | |
32 | build of an updated source tree. | 32 | build of an updated source tree. | |
33 | 33 | |||
34 | build.sh Bourne-compatible shell script used for building the host | 34 | build.sh Bourne-compatible shell script used for building the host | |
35 | build tools and the NetBSD system from scratch. Can be | 35 | build tools and the NetBSD system from scratch. Can be | |
36 | used for both native and cross builds, and should be used | 36 | used for both native and cross builds, and should be used | |
37 | instead of make(1) as it performs additional checks to | 37 | instead of make(1) as it performs additional checks to | |
38 | prevent common issues going undetected, such as building | 38 | prevent common issues going undetected, such as building | |
39 | with an outdated version of make(1). | 39 | with an outdated version of make(1). | |
40 | 40 | |||
41 | crypto/dist/, dist/, gnu/dist/ | 41 | crypto/dist/, dist/, gnu/dist/ | |
42 | Sources imported verbatim from third parties, without | 42 | Sources imported verbatim from third parties, without | |
43 | mangling the existing build structure. Other source trees | 43 | mangling the existing build structure. Other source trees | |
44 | in bin through usr.sbin use the NetBSD make(1) "reachover" | 44 | in bin through usr.sbin use the NetBSD make(1) "reachover" | |
45 | Makefile semantics when building these programs for a | 45 | Makefile semantics when building these programs for a | |
46 | native host. | 46 | native host. | |
47 | 47 | |||
48 | distrib/, etc/ | 48 | distrib/, etc/ | |
49 | Sources for items used when making a full release | 49 | Sources for items used when making a full release | |
50 | snapshot, such as files installed in DESTDIR/etc on the | 50 | snapshot, such as files installed in DESTDIR/etc on the | |
51 | destination system, boot media, and release notes. | 51 | destination system, boot media, and release notes. | |
52 | 52 | |||
53 | doc/BUILDING.mdoc | 53 | doc/BUILDING.mdoc | |
54 | This document, in -mdoc troff format; the original copy. | 54 | This document, in -mdoc troff format; the original copy. | |
55 | Used to generate BUILDING. | 55 | Used to generate BUILDING. | |
56 | 56 | |||
57 | external, sys/external | 57 | external, sys/external | |
58 | Sources and build infrastructure for components imported | 58 | Sources and build infrastructure for components imported | |
59 | (mostly) unchanged from upstream maintainers, sorted by | 59 | (mostly) unchanged from upstream maintainers, sorted by | |
60 | applicable license. This is (slowly) replacing the | 60 | applicable license. This is (slowly) replacing the | |
61 | crypto/dist, dist, and gnu/dist directories. | 61 | crypto/dist, dist, and gnu/dist directories. | |
62 | 62 | |||
63 | external/mit/xorg/ | 63 | external/mit/xorg/ | |
64 | "Reachover" build structure for modular Xorg; the source | 64 | "Reachover" build structure for modular Xorg; the source | |
65 | is in X11SRCDIR. | 65 | is in X11SRCDIR. | |
66 | 66 | |||
67 | regress/, tests/ | 67 | regress/, tests/ | |
68 | Regression test harness. Can be cross-compiled, but only | 68 | Regression test harness. Can be cross-compiled, but only | |
69 | run natively. tests/ uses the atf(7) test framework; | 69 | run natively. tests/ uses the atf(7) test framework; | |
70 | regress/ contains older tests that have not yet been | 70 | regress/ contains older tests that have not yet been | |
71 | migrated to atf(7). | 71 | migrated to atf(7). | |
72 | 72 | |||
73 | sys/ NetBSD kernel sources. | 73 | sys/ NetBSD kernel sources. | |
74 | 74 | |||
75 | tools/ "Reachover" build structure for the host build tools. | 75 | tools/ "Reachover" build structure for the host build tools. | |
76 | This has a special method of determining out-of-date | 76 | This has a special method of determining out-of-date | |
77 | status. | 77 | status. | |
78 | 78 | |||
79 | tools/compat/README | 79 | tools/compat/README | |
80 | Special notes for cross-hosting a NetBSD build on non- | 80 | Special notes for cross-hosting a NetBSD build on non- | |
81 | NetBSD platforms. | 81 | NetBSD platforms. | |
82 | 82 | |||
83 | Other directories including bin/ ... usr.sbin/ | 83 | Other directories including bin/ ... usr.sbin/ | |
84 | Sources to the NetBSD userland (non-kernel) programs. If | 84 | Sources to the NetBSD userland (non-kernel) programs. If | |
85 | any of these directories are missing, they will be skipped | 85 | any of these directories are missing, they will be skipped | |
86 | during the build. | 86 | during the build. | |
87 | 87 | |||
88 | Build tree layout | 88 | Build tree layout | |
89 | The NetBSD build tree is described in hier(7), and the release layout is | 89 | The NetBSD build tree is described in hier(7), and the release layout is | |
90 | described in release(7). | 90 | described in release(7). | |
91 | 91 | |||
92 | CONFIGURATION | 92 | CONFIGURATION | |
93 | Environment variables | 93 | Environment variables | |
94 | Several environment variables control the behaviour of NetBSD builds. | 94 | Several environment variables control the behaviour of NetBSD builds. | |
95 | 95 | |||
96 | HOST_CC Path name to C compiler used to create the toolchain. | 96 | HOST_CC Path name to C compiler used to create the toolchain. | |
97 | 97 | |||
98 | HOST_CFLAGS Flags passed to the host C compiler. | 98 | HOST_CFLAGS Flags passed to the host C compiler. | |
99 | 99 | |||
100 | HOST_CXX Path name to C++ compiler used to create the toolchain. | 100 | HOST_CXX Path name to C++ compiler used to create the toolchain. | |
101 | 101 | |||
102 | HOST_CXXFLAGS Flags passed to the host C++ compiler. | 102 | HOST_CXXFLAGS Flags passed to the host C++ compiler. | |
103 | 103 | |||
104 | HOST_SH Path name to a shell available on the host system and | 104 | HOST_SH Path name to a shell available on the host system and | |
105 | suitable for use during the build. The NetBSD build | 105 | suitable for use during the build. The NetBSD build | |
106 | system requires a modern Bourne-like shell with POSIX- | 106 | system requires a modern Bourne-like shell with POSIX- | |
107 | compliant features, and also requires support for the | 107 | compliant features, and also requires support for the | |
108 | "local" keyword to declare local variables in shell | 108 | "local" keyword to declare local variables in shell | |
109 | functions (which is a widely-implemented but non- | 109 | functions (which is a widely-implemented but non- | |
110 | standardised feature). | 110 | standardised feature). | |
111 | 111 | |||
112 | Depending on the host system, a suitable shell may be | 112 | Depending on the host system, a suitable shell may be | |
113 | /bin/sh, /usr/xpg4/bin/sh, /bin/ksh (provided it is a | 113 | /bin/sh, /usr/xpg4/bin/sh, /bin/ksh (provided it is a | |
114 | variant of ksh that supports the "local" keyword, such as | 114 | variant of ksh that supports the "local" keyword, such as | |
115 | ksh88, but not ksh93), or /usr/local/bin/bash. | 115 | ksh88, but not ksh93), or /usr/local/bin/bash. | |
116 | 116 | |||
117 | Most parts of the build require HOST_SH to be an absolute | 117 | Most parts of the build require HOST_SH to be an absolute | |
118 | path; however, build.sh allows it to be a simple command | 118 | path; however, build.sh allows it to be a simple command | |
119 | name, which will be converted to an absolute path by | 119 | name, which will be converted to an absolute path by | |
120 | searching the PATH. | 120 | searching the PATH. | |
121 | 121 | |||
122 | INSTALLBOOT_UBOOT_PATHS | 122 | INSTALLBOOT_UBOOT_PATHS | |
123 | A colon-separated list of search paths used by | 123 | A colon-separated list of search paths used by | |
124 | installboot(8) to find U-Boot packages. | 124 | installboot(8) to find U-Boot packages. | |
125 | 125 | |||
126 | MACHINE Machine type, e.g., "macppc". | 126 | MACHINE Machine type, e.g., "macppc". | |
127 | 127 | |||
128 | MACHINE_ARCH Machine architecture, e.g., "powerpc". | 128 | MACHINE_ARCH Machine architecture, e.g., "powerpc". | |
129 | 129 | |||
130 | MAKE Path name to invoke make(1) as. | 130 | MAKE Path name to invoke make(1) as. | |
131 | 131 | |||
132 | MAKECONF The name of the make(1) configuration file. See "make" | 132 | MAKECONF The name of the make(1) configuration file. See "make" | |
133 | variables and mk.conf(5). | 133 | variables and mk.conf(5). | |
134 | 134 | |||
135 | Note: Only settable in the process environment. | 135 | Note: Only settable in the process environment. | |
136 | 136 | |||
137 | Default: "/etc/mk.conf" | 137 | Default: "/etc/mk.conf" | |
138 | 138 | |||
139 | MAKEFLAGS Flags to invoke make(1) with. | 139 | MAKEFLAGS Flags to invoke make(1) with. | |
140 | 140 | |||
141 | Note: build.sh ignores the value of MAKEFLAGS passed in | 141 | Note: build.sh ignores the value of MAKEFLAGS passed in | |
142 | the environment, but allows MAKEFLAGS to be set via the | 142 | the environment, but allows MAKEFLAGS to be set via the | |
143 | -V option. | 143 | -V option. | |
144 | 144 | |||
145 | MAKEOBJDIR Directory to use as the .OBJDIR for the current | 145 | MAKEOBJDIR Directory to use as the .OBJDIR for the current | |
146 | directory. The value is subjected to variable expansion | 146 | directory. The value is subjected to variable expansion | |
147 | by make(1). Typical usage is to set this variable to a | 147 | by make(1). Typical usage is to set this variable to a | |
148 | value involving the use of `${.CURDIR:S...}' or | 148 | value involving the use of `${.CURDIR:S...}' or | |
149 | `${.CURDIR:C...}', to derive the value of .OBJDIR from | 149 | `${.CURDIR:C...}', to derive the value of .OBJDIR from | |
150 | the value of .CURDIR. Used only if MAKEOBJDIRPREFIX is | 150 | the value of .CURDIR. Used only if MAKEOBJDIRPREFIX is | |
151 | not defined. | 151 | not defined. | |
152 | 152 | |||
153 | Note: MAKEOBJDIR can be provided only in the environment | 153 | Note: MAKEOBJDIR can be provided only in the environment | |
154 | or via the -O flag of build.sh; it cannot usefully be set | 154 | or via the -O flag of build.sh; it cannot usefully be set | |
155 | inside a Makefile, including in mk.conf(5) or MAKECONF. | 155 | inside a Makefile, including in mk.conf(5) or MAKECONF. | |
156 | 156 | |||
157 | MAKEOBJDIRPREFIX | 157 | MAKEOBJDIRPREFIX | |
158 | Top level directory of the object directory tree. The | 158 | Top level directory of the object directory tree. The | |
159 | value is subjected to variable expansion by make(1). | 159 | value is subjected to variable expansion by make(1). | |
160 | build.sh will create the ${MAKEOBJDIRPREFIX} directory if | 160 | build.sh will create the ${MAKEOBJDIRPREFIX} directory if | |
161 | necessary, but if make(1) is used without build.sh, then | 161 | necessary, but if make(1) is used without build.sh, then | |
162 | rules in <bsd.obj.mk> will abort the build if the | 162 | rules in <bsd.obj.mk> will abort the build if the | |
163 | ${MAKEOBJDIRPREFIX} directory does not exist. If the | 163 | ${MAKEOBJDIRPREFIX} directory does not exist. If the | |
164 | value is defined and valid, then | 164 | value is defined and valid, then | |
165 | ${MAKEOBJDIRPREFIX}/${.CURDIR} is used as the .OBJDIR for | 165 | ${MAKEOBJDIRPREFIX}/${.CURDIR} is used as the .OBJDIR for | |
166 | the current directory. The current directory may be read | 166 | the current directory. The current directory may be read | |
167 | only. | 167 | only. | |
168 | 168 | |||
169 | Note: MAKEOBJDIRPREFIX can be provided only in the | 169 | Note: MAKEOBJDIRPREFIX can be provided only in the | |
170 | environment or via the -M flag of build.sh; it cannot | 170 | environment or via the -M flag of build.sh; it cannot | |
171 | usefully be set inside a Makefile, including in | 171 | usefully be set inside a Makefile, including in | |
172 | mk.conf(5) or MAKECONF. | 172 | mk.conf(5) or MAKECONF. | |
173 | 173 | |||
174 | TMPDIR Top-level directory to store temporary directories used | 174 | TMPDIR Top-level directory to store temporary directories used | |
175 | by build.sh before paths to other directories such as | 175 | by build.sh before paths to other directories such as | |
176 | .OBJDIR can be determined. | 176 | .OBJDIR can be determined. | |
177 | 177 | |||
178 | Note: Must support execution of binaries. I.e., without | 178 | Note: Must support execution of binaries. I.e., without | |
179 | mount(8)'s -o noexec option. | 179 | mount(8)'s -o noexec option. | |
180 | 180 | |||
181 | Default: "/tmp". | 181 | Default: "/tmp". | |
182 | 182 | |||
183 | "make" variables | 183 | "make" variables | |
184 | Several variables control the behavior of NetBSD builds. Unless | 184 | Several variables control the behavior of NetBSD builds. Unless | |
185 | otherwise specified, these variables may be set in either the process | 185 | otherwise specified, these variables may be set in either the process | |
186 | environment or the make(1) configuration file mk.conf(5) specified by | 186 | environment or the make(1) configuration file mk.conf(5) specified by | |
187 | MAKECONF. | 187 | MAKECONF. | |
188 | 188 | |||
189 | This list is not comprehensive; all supported variables and their | 189 | This list is not comprehensive; all supported variables and their | |
190 | defaults are documented in mk.conf(5). | 190 | defaults are documented in mk.conf(5). | |
191 | 191 | |||
192 | BSDOBJDIR The real path to the object directory tree for the NetBSD | 192 | BSDOBJDIR The real path to the object directory tree for the NetBSD | |
193 | source tree. | 193 | source tree. | |
194 | 194 | |||
195 | Default: "/usr/obj" | 195 | Default: "/usr/obj" | |
196 | 196 | |||
197 | BSDSRCDIR The real path to the NetBSD source tree, if NETBSDSRCDIR | 197 | BSDSRCDIR The real path to the NetBSD source tree, if NETBSDSRCDIR | |
198 | isn't defined. | 198 | isn't defined. | |
199 | 199 | |||
200 | Default: "/usr/src" | 200 | Default: "/usr/src" | |
201 | 201 | |||
202 | BUILDID Identifier for the build. If set, this should be a short | 202 | BUILDID Identifier for the build. If set, this should be a short | |
203 | string that is suitable for use as part of a file or | 203 | string that is suitable for use as part of a file or | |
204 | directory name. The identifier will be appended to | 204 | directory name. The identifier will be appended to | |
205 | object directory names, and can be consulted in the | 205 | object directory names, and can be consulted in the | |
206 | make(1) configuration file in order to set additional | 206 | make(1) configuration file in order to set additional | |
207 | build parameters, such as compiler flags. It will also | 207 | build parameters, such as compiler flags. It will also | |
208 | be used as part of the kernel version string, which can | 208 | be used as part of the kernel version string, which can | |
209 | be shown by "uname -v". | 209 | be shown by "uname -v". | |
210 | 210 | |||
211 | Default: Unset. | 211 | Default: Unset. | |
212 | 212 | |||
213 | BUILDINFO Optional multi-line string containing information about | 213 | BUILDINFO Optional multi-line string containing information about | |
214 | the build. This will appear in DESTDIR/etc/release, and | 214 | the build. This will appear in DESTDIR/etc/release, and | |
215 | it will be stored in the buildinfo variable in any | 215 | it will be stored in the buildinfo variable in any | |
216 | kernels that are built. When such kernels are booted, | 216 | kernels that are built. When such kernels are booted, | |
217 | the sysctl(7) kern.buildinfo variable will report this | 217 | the sysctl(7) kern.buildinfo variable will report this | |
218 | value. The string may contain backslash escape | 218 | value. The string may contain backslash escape | |
219 | sequences, such as "\\" (representing a backslash | 219 | sequences, such as "\\" (representing a backslash | |
220 | character) and "\n" (representing a newline). | 220 | character) and "\n" (representing a newline). | |
221 | 221 | |||
222 | Default: Unset. | 222 | Default: Unset. | |
223 | 223 | |||
224 | BUILDSEED g++(1) uses random numbers when compiling C++ code. This | 224 | BUILDSEED g++(1) uses random numbers when compiling C++ code. This | |
225 | variable seeds the g++(1) random number generator using | 225 | variable seeds the g++(1) random number generator using | |
226 | -frandom-seed with this value. By default, it is set to | 226 | -frandom-seed with this value. By default, it is set to | |
227 | "NetBSD-(majorversion)". Using a fixed value causes C++ | 227 | "NetBSD-(majorversion)". Using a fixed value causes C++ | |
228 | binaries to be the same when built from the same sources, | 228 | binaries to be the same when built from the same sources, | |
229 | resulting in identical (reproducible) builds. Additional | 229 | resulting in identical (reproducible) builds. Additional | |
230 | information is available in the g++(1) documentation of | 230 | information is available in the g++(1) documentation of | |
231 | -frandom-seed. | 231 | -frandom-seed. | |
232 | 232 | |||
233 | Default: Unset. | 233 | Default: Unset. | |
234 | 234 | |||
235 | CPUFLAGS Additional flags to the compiler/assembler to select CPU | 235 | CPUFLAGS Additional flags to the compiler/assembler to select CPU | |
236 | instruction set options, CPU tuning options, etc. | 236 | instruction set options, CPU tuning options, etc. | |
237 | 237 | |||
238 | Default: Unset. | 238 | Default: Unset. | |
239 | 239 | |||
240 | DESTDIR Directory to contain the built NetBSD system. If set, | 240 | DESTDIR Directory to contain the built NetBSD system. If set, | |
241 | special options are passed to the compilation tools to | 241 | special options are passed to the compilation tools to | |
242 | prevent their default use of the host system's | 242 | prevent their default use of the host system's | |
243 | /usr/include, /usr/lib, and so forth. This pathname must | 243 | /usr/include, /usr/lib, and so forth. This pathname must | |
244 | be an absolute path, and should not end with a slash (/) | 244 | be an absolute path, and should not end with a slash (/) | |
245 | character. (For installation into the system's root | 245 | character. (For installation into the system's root | |
246 | directory, set DESTDIR to an empty string, not to "/"). | 246 | directory, set DESTDIR to an empty string, not to "/"). | |
247 | The directory must reside on a file system which supports | 247 | The directory must reside on a file system which supports | |
248 | long file names and hard links. | 248 | long file names and hard links. | |
249 | 249 | |||
250 | Note: build.sh will provide a default of destdir.MACHINE | 250 | Note: build.sh will provide a default of destdir.MACHINE | |
251 | (in the top-level .OBJDIR) unless run in `expert' mode. | 251 | (in the top-level .OBJDIR) unless run in `expert' mode. | |
252 | 252 | |||
253 | Default: Empty string if USETOOLS is "yes"; unset | 253 | Default: Empty string if USETOOLS is "yes"; unset | |
254 | otherwise. | 254 | otherwise. | |
255 | 255 | |||
256 | EXTERNAL_TOOLCHAIN | 256 | EXTERNAL_TOOLCHAIN | |
257 | If defined, this variable indicates the root directory of | 257 | If defined, this variable indicates the root directory of | |
258 | an external toolchain which will be used to build the | 258 | an external toolchain which will be used to build the | |
259 | tree. For example, if a platform is a TOOLCHAIN_MISSING | 259 | tree. For example, if a platform is a TOOLCHAIN_MISSING | |
260 | platform, EXTERNAL_TOOLCHAIN can be used to re-enable the | 260 | platform, EXTERNAL_TOOLCHAIN can be used to re-enable the | |
261 | cross-compile framework. | 261 | cross-compile framework. | |
262 | 262 | |||
263 | If EXTERNAL_TOOLCHAIN is defined, act as MKGCC=no, since | 263 | If EXTERNAL_TOOLCHAIN is defined, act as MKGCC=no, since | |
264 | the external version of the compiler may not be able to | 264 | the external version of the compiler may not be able to | |
265 | build the library components of the in-tree compiler. | 265 | build the library components of the in-tree compiler. | |
266 | 266 | |||
267 | This variable should be used in conjunction with an | 267 | This variable should be used in conjunction with an | |
268 | appropriate HAVE_GCC or HAVE_LLVM setting to control the | 268 | appropriate HAVE_GCC or HAVE_LLVM setting to control the | |
269 | compiler flags. | 269 | compiler flags. | |
270 | 270 | |||
271 | Note: This variable is not yet used in as many places as | 271 | Note: This variable is not yet used in as many places as | |
272 | it should be. Expect the exact semantics of this | 272 | it should be. Expect the exact semantics of this | |
273 | variable to change in the short term as parts of the | 273 | variable to change in the short term as parts of the | |
274 | cross-compile framework continue to be cleaned up. | 274 | cross-compile framework continue to be cleaned up. | |
275 | 275 | |||
276 | Default: Unset. | 276 | Default: Unset. | |
277 | 277 | |||
278 | MAKEVERBOSE Level of verbosity of status messages. Supported values: | 278 | MAKEVERBOSE Level of verbosity of status messages. Supported values: | |
279 | 279 | |||
280 | 0 No descriptive messages or commands executed by | 280 | 0 No descriptive messages or commands executed by | |
281 | make(1) are shown. | 281 | make(1) are shown. | |
282 | 282 | |||
283 | 1 Brief messages are shown describing what is being | 283 | 1 Brief messages are shown describing what is being | |
284 | done, but the actual commands executed by make(1) are | 284 | done, but the actual commands executed by make(1) are | |
285 | not shown. | 285 | not shown. | |
286 | 286 | |||
287 | 2 Descriptive messages are shown as above (prefixed | 287 | 2 Descriptive messages are shown as above (prefixed | |
288 | with a `#'), and ordinary commands performed by | 288 | with a `#'), and ordinary commands performed by | |
289 | make(1) are shown. | 289 | make(1) are shown. | |
290 | 290 | |||
291 | 3 In addition to the above, all commands performed by | 291 | 3 In addition to the above, all commands performed by | |
292 | make(1) are shown, even if they would ordinarily have | 292 | make(1) are shown, even if they would ordinarily have | |
293 | been hidden through use of the "@" prefix in the | 293 | been hidden through use of the "@" prefix in the | |
294 | relevant makefile. | 294 | relevant makefile. | |
295 | 295 | |||
296 | 4 In addition to the above, commands executed by | 296 | 4 In addition to the above, commands executed by | |
297 | make(1) are traced through use of the sh(1) "-x" | 297 | make(1) are traced through use of the sh(1) "-x" | |
298 | flag. | 298 | flag. | |
299 | 299 | |||
300 | Default: 2 | 300 | Default: 2 | |
301 | 301 | |||
302 | MKCATPAGES Can be set to "yes" or "no". Indicates whether | 302 | MKCATPAGES Can be set to "yes" or "no". Indicates whether | |
303 | preformatted plaintext manual pages will be created and | 303 | preformatted plaintext manual pages will be created and | |
304 | installed. | 304 | installed. | |
305 | 305 | |||
306 | Forced to "no" if MKMAN=no or MKSHARE=no. | 306 | Forced to "no" if MKMAN=no or MKSHARE=no. | |
307 | 307 | |||
308 | Default: "no" | 308 | Default: "no" | |
309 | 309 | |||
310 | MKCROSSGDB Can be set to "yes" or "no". Create a cross-gdb as a | 310 | MKCROSSGDB Can be set to "yes" or "no". Create a cross-gdb as a | |
311 | host tool. | 311 | host tool. | |
312 | 312 | |||
313 | Default: "no" | 313 | Default: "no" | |
314 | 314 | |||
315 | MKDEBUG Can be set to "yes" or "no". Indicates whether debug | 315 | MKDEBUG Can be set to "yes" or "no". Indicates whether debug | |
316 | information should be generated for all userland | 316 | information should be generated for all userland | |
317 | binaries. The result is collected as an additional | 317 | binaries. The result is collected as an additional | |
318 | debug.tgz and xdebug.tgz set and installed in | 318 | debug.tgz and xdebug.tgz set and installed in | |
319 | DESTDIR/usr/libdata/debug. | 319 | DESTDIR/usr/libdata/debug. | |
320 | 320 | |||
321 | Forced to "no" if NODEBUG is defined, usually in the | 321 | Forced to "no" if NODEBUG is defined, usually in the | |
322 | Makefile before any make(1) .include directives. | 322 | Makefile before any make(1) .include directives. | |
323 | 323 | |||
324 | Default: "no" | 324 | Default: "no" | |
325 | 325 | |||
326 | MKDEBUGKERNEL Can be set to "yes" or "no". Indicates whether debugging | 326 | MKDEBUGKERNEL Can be set to "yes" or "no". Indicates whether debugging | |
327 | symbols will be built for kernels by default; pretend as | 327 | symbols will be built for kernels by default; pretend as | |
328 | if makeoptions DEBUG="-g" is specified in kernel | 328 | if makeoptions DEBUG="-g" is specified in kernel | |
329 | configuration files. This will also put the debug kernel | 329 | configuration files. This will also put the debug kernel | |
330 | netbsd.gdb in the kernel sets. See options(4) for | 330 | netbsd.gdb in the kernel sets. See options(4) for | |
331 | details. This is useful if a cross-gdb is built as well | 331 | details. This is useful if a cross-gdb is built as well | |
332 | (see MKCROSSGDB). | 332 | (see MKCROSSGDB). | |
333 | 333 | |||
334 | Default: "no" | 334 | Default: "no" | |
335 | 335 | |||
336 | MKDEBUGLIB Can be set to "yes" or "no". Indicates whether debug | 336 | MKDEBUGLIB Can be set to "yes" or "no". Indicates whether debug | |
337 | libraries (lib*_g.a) will be built and installed. Debug | 337 | libraries (lib*_g.a) will be built and installed. Debug | |
338 | libraries are compiled with "-g -DDEBUG". | 338 | libraries are compiled with "-g -DDEBUG". | |
339 | 339 | |||
340 | Forced to "no" if NODEBUGLIB is defined, usually in the | 340 | Forced to "no" if NODEBUGLIB is defined, usually in the | |
341 | Makefile before any make(1) .include directives. | 341 | Makefile before any make(1) .include directives. | |
342 | 342 | |||
343 | Default: "no" | 343 | Default: "no" | |
344 | 344 | |||
345 | MKDEBUGTOOLS Can be set to "yes" or "no". Indicates whether debug | 345 | MKDEBUGTOOLS Can be set to "yes" or "no". Indicates whether debug | |
346 | information (lib*_g.a) will be included in the build | 346 | information (lib*_g.a) will be included in the build | |
347 | toolchain. | 347 | toolchain. | |
348 | 348 | |||
349 | Default: "no" | 349 | Default: "no" | |
350 | 350 | |||
351 | MKDOC Can be set to "yes" or "no". Indicates whether system | 351 | MKDOC Can be set to "yes" or "no". Indicates whether system | |
352 | documentation destined for DESTDIR/usr/share/doc will be | 352 | documentation destined for DESTDIR/usr/share/doc will be | |
353 | installed. | 353 | installed. | |
354 | 354 | |||
355 | Forced to "no" if NODOC is defined, usually in the | 355 | Forced to "no" if NODOC is defined, usually in the | |
356 | Makefile before any make(1) .include directives. | 356 | Makefile before any make(1) .include directives. | |
357 | 357 | |||
358 | Forced to "no" if MKSHARE=no. | 358 | Forced to "no" if MKSHARE=no. | |
359 | 359 | |||
360 | Default: "yes" | 360 | Default: "yes" | |
361 | 361 | |||
362 | MKHOSTOBJ Can be set to "yes" or "no". If set to "yes", then for | 362 | MKHOSTOBJ Can be set to "yes" or "no". If set to "yes", then for | |
363 | programs intended to be run on the compile host, the | 363 | programs intended to be run on the compile host, the | |
364 | name, release, and architecture of the host operating | 364 | name, release, and architecture of the host operating | |
365 | system will be suffixed to the name of the object | 365 | system will be suffixed to the name of the object | |
366 | directory created by "make obj". (This allows multiple | 366 | directory created by "make obj". (This allows multiple | |
367 | host systems to compile NetBSD for a single target.) If | 367 | host systems to compile NetBSD for a single target.) If | |
368 | set to "no", then programs built to be run on the compile | 368 | set to "no", then programs built to be run on the compile | |
369 | host will use the same object directory names as programs | 369 | host will use the same object directory names as programs | |
370 | built to be run on the target. | 370 | built to be run on the target. | |
371 | 371 | |||
372 | Default: "no" | 372 | Default: "no" | |
373 | 373 | |||
374 | MKHTML Can be set to "yes" or "no". Indicates whether the HTML | 374 | MKHTML Can be set to "yes" or "no". Indicates whether the HTML | |
375 | manual pages are created and installed. and installed | 375 | manual pages are created and installed. and installed | |
376 | 376 | |||
377 | Forced to "no" if NOHTML is defined, usually in the | 377 | Forced to "no" if NOHTML is defined, usually in the | |
378 | Makefile before any make(1) .include directives. | 378 | Makefile before any make(1) .include directives. | |
379 | 379 | |||
380 | Forced to "no" if MKMAN=no or MKSHARE=no. | 380 | Forced to "no" if MKMAN=no or MKSHARE=no. | |
381 | 381 | |||
382 | Default: "yes" | 382 | Default: "yes" | |
383 | 383 | |||
384 | MKINFO Can be set to "yes" or "no". Indicates whether GNU Info | 384 | MKINFO Can be set to "yes" or "no". Indicates whether GNU Info | |
385 | files, used for the documentation for most of the | 385 | files, used for the documentation for most of the | |
386 | compilation tools, will be built and installed. | 386 | compilation tools, will be built and installed. | |
387 | 387 | |||
388 | Forced to "no" if NOINFO is defined, usually in the | 388 | Forced to "no" if NOINFO is defined, usually in the | |
389 | Makefile before any make(1) .include directives. | 389 | Makefile before any make(1) .include directives. | |
390 | 390 | |||
391 | Forced to "no" if MKSHARE=no. | 391 | Forced to "no" if MKSHARE=no. | |
392 | 392 | |||
393 | Default: "yes" | 393 | Default: "yes" | |
394 | 394 | |||
395 | MKKDEBUG Deprecated, use MKDEBUGKERNEL. | 395 | MKKDEBUG Deprecated, use MKDEBUGKERNEL. | |
396 | 396 | |||
397 | MKKMOD Can be set to "yes" or "no". Indicates whether kernel | 397 | MKKMOD Can be set to "yes" or "no". Indicates whether kernel | |
398 | modules are built and installed. | 398 | modules are built and installed. | |
399 | 399 | |||
400 | Default: "no" on or1k; "yes" on other platforms. | 400 | Default: "no" on or1k; "yes" on other platforms. | |
401 | 401 | |||
402 | MKLINKLIB Can be set to "yes" or "no". Indicates whether all of | 402 | MKLINKLIB Can be set to "yes" or "no". Indicates whether all of | |
403 | the shared library infrastructure will be built and | 403 | the shared library infrastructure will be built and | |
404 | installed. If "no", prevents: installation of the *.a | 404 | installed. If "no", prevents: installation of the *.a | |
405 | libraries, installation of the *_pic.a libraries on PIC | 405 | libraries, installation of the *_pic.a libraries on PIC | |
406 | systems, building of *.a libraries on PIC systems, or | 406 | systems, building of *.a libraries on PIC systems, or | |
407 | installation of .so symlinks on ELF systems. | 407 | installation of .so symlinks on ELF systems. | |
408 | 408 | |||
409 | Forced to "no" if NOLINKLIB is defined, usually in the | 409 | Forced to "no" if NOLINKLIB is defined, usually in the | |
410 | Makefile before any make(1) .include directives. | 410 | Makefile before any make(1) .include directives. | |
411 | 411 | |||
412 | If "no", acts as MKLINT=no MKPICINSTALL=no MKPROFILE=no. | 412 | If "no", acts as MKLINT=no MKPICINSTALL=no MKPROFILE=no. | |
413 | 413 | |||
414 | Default: "yes" | 414 | Default: "yes" | |
415 | 415 | |||
416 | MKLINT Can be set to "yes" or "no". Indicates whether lint(1) | 416 | MKLINT Can be set to "yes" or "no". Indicates whether lint(1) | |
417 | will be run against portions of the NetBSD source code | 417 | will be run against portions of the NetBSD source code | |
418 | during the build, and whether lint libraries will be | 418 | during the build, and whether lint libraries will be | |
419 | installed into DESTDIR/usr/libdata/lint. | 419 | installed into DESTDIR/usr/libdata/lint. | |
420 | 420 | |||
421 | Forced to "no" if NOLINT is defined, usually in the | 421 | Forced to "no" if NOLINT is defined, usually in the | |
422 | Makefile before any make(1) .include directives. | 422 | Makefile before any make(1) .include directives. | |
423 | 423 | |||
424 | Forced to "no" if MKLINKLIB=no. | 424 | Forced to "no" if MKLINKLIB=no. | |
425 | 425 | |||
426 | Default: "no" | 426 | Default: "no" | |
427 | 427 | |||
428 | MKMAN Can be set to "yes" or "no". Indicates whether manual | 428 | MKMAN Can be set to "yes" or "no". Indicates whether manual | |
429 | pages will be installed. | 429 | pages will be installed. | |
430 | 430 | |||
431 | Forced to "no" if NOMAN is defined, usually in the | 431 | Forced to "no" if NOMAN is defined, usually in the | |
432 | Makefile before any make(1) .include directives. | 432 | Makefile before any make(1) .include directives. | |
433 | 433 | |||
434 | Forced to "no" if MKSHARE=no. | 434 | Forced to "no" if MKSHARE=no. | |
435 | 435 | |||
436 | If "no", acts as MKCATPAGES=no MKHTML=no. | 436 | If "no", acts as MKCATPAGES=no MKHTML=no. | |
437 | 437 | |||
438 | Default: "yes" | 438 | Default: "yes" | |
439 | 439 | |||
440 | MKNLS Can be set to "yes" or "no". Indicates whether Native | 440 | MKNLS Can be set to "yes" or "no". Indicates whether Native | |
441 | Language System (NLS) locale zone files will be built and | 441 | Language System (NLS) locale zone files will be built and | |
442 | installed. | 442 | installed. | |
443 | 443 | |||
444 | Forced to "no" if NONLS is defined, usually in the | 444 | Forced to "no" if NONLS is defined, usually in the | |
445 | Makefile before any make(1) .include directives. | 445 | Makefile before any make(1) .include directives. | |
446 | 446 | |||
447 | Forced to "no" if MKSHARE=no. | 447 | Forced to "no" if MKSHARE=no. | |
448 | 448 | |||
449 | Default: "yes" | 449 | Default: "yes" | |
450 | 450 | |||
451 | MKOBJ Can be set to "yes" or "no". Indicates whether object | 451 | MKOBJ Can be set to "yes" or "no". Indicates whether object | |
452 | directories will be created when running "make obj". If | 452 | directories will be created when running "make obj". If | |
453 | set to "no", then all built files will be located inside | 453 | set to "no", then all built files will be located inside | |
454 | the regular source tree. | 454 | the regular source tree. | |
455 | 455 | |||
456 | Forced to "no" if NOOBJ is defined, usually in the | 456 | Forced to "no" if NOOBJ is defined, usually in the | |
457 | Makefile before any make(1) .include directives. | 457 | Makefile before any make(1) .include directives. | |
458 | 458 | |||
459 | If "no", acts as MKOBJDIRS=no. | 459 | If "no", acts as MKOBJDIRS=no. | |
460 | 460 | |||
461 | Note: Setting MKOBJ to "no" is not recommended and may | 461 | Note: Setting MKOBJ to "no" is not recommended and may | |
462 | cause problems when updating the tree with cvs(1). | 462 | cause problems when updating the tree with cvs(1). | |
463 | 463 | |||
464 | Default: "yes" | 464 | Default: "yes" | |
465 | 465 | |||
466 | MKOBJDIRS Can be set to "yes" or "no". Indicates whether object | 466 | MKOBJDIRS Can be set to "yes" or "no". Indicates whether object | |
467 | directories will be created automatically (via a "make | 467 | directories will be created automatically (via a "make | |
468 | obj" pass) at the start of a build. | 468 | obj" pass) at the start of a build. | |
469 | 469 | |||
470 | Forced to "no" if MKOBJ=no. | 470 | Forced to "no" if MKOBJ=no. | |
471 | 471 | |||
472 | Default: "no" | 472 | Default: "no" | |
473 | 473 | |||
474 | MKPIC Can be set to "yes" or "no". Indicates whether shared | 474 | MKPIC Can be set to "yes" or "no". Indicates whether shared | |
475 | objects and libraries will be created and installed. If | 475 | objects and libraries will be created and installed. If | |
476 | "no", the entire built system will be statically linked. | 476 | "no", the entire built system will be statically linked. | |
477 | 477 | |||
478 | Forced to "no" if NOPIC is defined, usually in the | 478 | Forced to "no" if NOPIC is defined, usually in the | |
479 | Makefile before any make(1) .include directives. | 479 | Makefile before any make(1) .include directives. | |
480 | 480 | |||
481 | If "no", acts as MKPICLIB=no. | 481 | If "no", acts as MKPICLIB=no. | |
482 | 482 | |||
483 | Default: "no" on m68000; "yes" on other platforms. | 483 | Default: "no" on m68000; "yes" on other platforms. | |
484 | 484 | |||
485 | MKPICINSTALL Can be set to "yes" or "no". Indicates whether the ar(1) | 485 | MKPICINSTALL Can be set to "yes" or "no". Indicates whether the ar(1) | |
486 | format libraries (lib*_pic.a), used to generate shared | 486 | format libraries (lib*_pic.a), used to generate shared | |
487 | libraries, are installed. | 487 | libraries, are installed. | |
488 | 488 | |||
489 | Forced to "no" if NOPICINSTALL is defined, usually in the | 489 | Forced to "no" if NOPICINSTALL is defined, usually in the | |
490 | Makefile before any make(1) .include directives. | 490 | Makefile before any make(1) .include directives. | |
491 | 491 | |||
492 | Forced to "no" if MKLINKLIB=no. | 492 | Forced to "no" if MKLINKLIB=no. | |
493 | 493 | |||
494 | Default: "no" | 494 | Default: "no" | |
495 | 495 | |||
496 | MKPROFILE Can be set to "yes" or "no". Indicates whether profiled | 496 | MKPROFILE Can be set to "yes" or "no". Indicates whether profiled | |
497 | libraries (lib*_p.a) will be built and installed. | 497 | libraries (lib*_p.a) will be built and installed. | |
498 | 498 | |||
499 | Forced to "no" if NOPROFILE is defined, usually in the | 499 | Forced to "no" if NOPROFILE is defined, usually in the | |
500 | Makefile before any make(1) .include directives. | 500 | Makefile before any make(1) .include directives. | |
501 | 501 | |||
502 | Forced to "no" if MKLINKLIB=no. | 502 | Forced to "no" if MKLINKLIB=no. | |
503 | 503 | |||
504 | Default: "no" on or1k, riscv32, and riscv64 (due to | 504 | Default: "no" on or1k, riscv32, and riscv64 (due to | |
505 | toolchain problems with profiled code); "yes" on other | 505 | toolchain problems with profiled code); "yes" on other | |
506 | platforms. | 506 | platforms. | |
507 | 507 | |||
508 | MKREPRO Can be set to "yes" or "no". Indicates whether builds | 508 | MKREPRO Can be set to "yes" or "no". Indicates whether builds | |
509 | are to be reproducible. If "yes", two builds from the | 509 | are to be reproducible. If "yes", two builds from the | |
510 | same source tree will produce the same build results. | 510 | same source tree will produce the same build results. | |
511 | 511 | |||
512 | Used as the default for MKARZERO. | 512 | Used as the default for MKARZERO. | |
513 | 513 | |||
514 | This may be set to "yes" by giving build.sh the -P | 514 | This may be set to "yes" by giving build.sh the -P | |
515 | option. | 515 | option. | |
516 | 516 | |||
517 | Default: "no" Can be set to "yes" or "no". | 517 | Default: "no" Can be set to "yes" or "no". | |
518 | 518 | |||
519 | MKREPRO_TIMESTAMP | 519 | MKREPRO_TIMESTAMP | |
520 | Unix timestamp. When MKREPRO is set, the timestamp of | 520 | Unix timestamp. When MKREPRO is set, the timestamp of | |
521 | all files in the sets will be set to this value. | 521 | all files in the sets will be set to this value. | |
522 | 522 | |||
523 | This may be set automatically to the latest source tree | 523 | This may be set automatically to the latest source tree | |
524 | timestamp using cvslatest(1) by giving build.sh the -P | 524 | timestamp using cvslatest(1) by giving build.sh the -P | |
525 | option. | 525 | option. | |
526 | 526 | |||
527 | Default: Unset. | 527 | Default: Unset. | |
528 | 528 | |||
529 | MKSHARE Can be set to "yes" or "no". Indicates whether files | 529 | MKSHARE Can be set to "yes" or "no". Indicates whether files | |
530 | destined to reside in DESTDIR/usr/share will be built and | 530 | destined to reside in DESTDIR/usr/share will be built and | |
531 | installed. | 531 | installed. | |
532 | 532 | |||
533 | Forced to "no" if NOSHARE is defined, usually in the | 533 | Forced to "no" if NOSHARE is defined, usually in the | |
534 | Makefile before any make(1) .include directives. | 534 | Makefile before any make(1) .include directives. | |
535 | 535 | |||
536 | If "no", acts as MKCATPAGES=no MKDOC=no MKINFO=no | 536 | If "no", acts as MKCATPAGES=no MKDOC=no MKINFO=no | |
537 | MKHTML=no MKMAN=no MKNLS=no. | 537 | MKHTML=no MKMAN=no MKNLS=no. | |
538 | 538 | |||
539 | Default: "yes" | 539 | Default: "yes" | |
540 | 540 | |||
541 | MKSTRIPIDENT Can be set to "yes" or "no". Indicates whether RCS IDs, | 541 | MKSTRIPIDENT Can be set to "yes" or "no". Indicates whether RCS IDs, | |
542 | for use with ident(1), should be stripped from program | 542 | for use with ident(1), should be stripped from program | |
543 | binaries and shared libraries. | 543 | binaries and shared libraries. | |
544 | 544 | |||
545 | Default: "no" | 545 | Default: "no" | |
546 | 546 | |||
547 | MKSTRIPSYM Can be set to "yes" or "no". Indicates whether all local | 547 | MKSTRIPSYM Can be set to "yes" or "no". Indicates whether all local | |
548 | symbols should be stripped from shared libraries. If | 548 | symbols should be stripped from shared libraries. If | |
549 | "yes", strip all local symbols from shared libraries; the | 549 | "yes", strip all local symbols from shared libraries; the | |
550 | affect is equivalent to the -x option of ld(1). If "no", | 550 | affect is equivalent to the -x option of ld(1). If "no", | |
551 | strip only temporary local symbols; the affect is | 551 | strip only temporary local symbols; the affect is | |
552 | equivalent to the -X option of ld(1). Keeping non- | 552 | equivalent to the -X option of ld(1). Keeping non- | |
553 | temporary local symbols such as static function names is | 553 | temporary local symbols such as static function names is | |
554 | useful on using DTrace for userland libraries and getting | 554 | useful on using DTrace for userland libraries and getting | |
555 | a backtrace from a rump kernel loading shared libraries. | 555 | a backtrace from a rump kernel loading shared libraries. | |
556 | 556 | |||
557 | Default: "yes" | 557 | Default: "yes" | |
558 | 558 | |||
559 | MKUNPRIVED Can be set to "yes" or "no". Indicates whether an | 559 | MKUNPRIVED Can be set to "yes" or "no". Indicates whether an | |
560 | unprivileged install will occur. The user, group, | 560 | unprivileged install will occur. The user, group, | |
561 | permissions, and file flags, will not be set on the | 561 | permissions, and file flags, will not be set on the | |
562 | installed items; instead the information will be appended | 562 | installed items; instead the information will be appended | |
563 | to a file called METALOG in DESTDIR. The contents of | 563 | to a file called METALOG in DESTDIR. The contents of | |
564 | METALOG are used during the generation of the | 564 | METALOG are used during the generation of the | |
565 | distribution tar files to ensure that the appropriate | 565 | distribution tar files to ensure that the appropriate | |
566 | file ownership is stored. | 566 | file ownership is stored. | |
567 | 567 | |||
568 | Default: "no" | 568 | Default: "no" | |
569 | 569 | |||
570 | MKUPDATE Can be set to "yes" or "no". Indicates whether all | 570 | MKUPDATE Can be set to "yes" or "no". Indicates whether all | |
571 | install operations intended to write to DESTDIR will | 571 | install operations intended to write to DESTDIR will | |
572 | compare file timestamps before installing, and skip the | 572 | compare file timestamps before installing, and skip the | |
573 | install phase if the destination files are up-to-date. | 573 | install phase if the destination files are up-to-date. | |
574 | 574 | |||
575 | Note: This also has implications on full builds (see next | 575 | Note: This also has implications on full builds (see next | |
576 | subsection). | 576 | subsection). | |
577 | 577 | |||
578 | Default: "no" | 578 | Default: "no" | |
579 | 579 | |||
580 | MKX11 Can be set to "yes" or "no". Indicates whether X11 is | 580 | MKX11 Can be set to "yes" or "no". Indicates whether X11 is | |
581 | built and installed from X11SRCDIR, and whether the X | 581 | built and installed from X11SRCDIR, and whether the X | |
582 | sets will be created. | 582 | sets will be created. | |
583 | 583 | |||
584 | Note: If "yes", requires MKINET6=yes. | 584 | Note: If "yes", requires MKINET6=yes. | |
585 | 585 | |||
586 | Default: "no" | 586 | Default: "no" | |
587 | 587 | |||
588 | NETBSDSRCDIR The path to the top level of the NetBSD sources. | 588 | NETBSDSRCDIR The path to the top level of the NetBSD sources. | |
589 | 589 | |||
590 | Default: Top level of the NetBSD source tree (as | 590 | Default: Top level of the NetBSD source tree (as | |
591 | determined by the presence of build.sh and tools/) if | 591 | determined by the presence of build.sh and tools/) if | |
592 | make(1) is run from within that tree; otherwise BSDSRCDIR | 592 | make(1) is run from within that tree; otherwise BSDSRCDIR | |
593 | will be used. | 593 | will be used. | |
594 | 594 | |||
595 | TOOLCHAIN_MISSING | 595 | TOOLCHAIN_MISSING | |
596 | Can be set to "yes" or "no". If not "no", this indicates | 596 | Can be set to "yes" or "no". If not "no", this indicates | |
597 | that the platform "MACHINE_ARCH" being built does not | 597 | that the platform "MACHINE_ARCH" being built does not | |
598 | have a working in-tree toolchain. | 598 | have a working in-tree toolchain. | |
599 | 599 | |||
600 | If not "no", acts as MKBINUTILS=no MKGCC=no MKGDB=no. | 600 | If not "no", acts as MKBINUTILS=no MKGCC=no MKGDB=no. | |
601 | 601 | |||
602 | Default: "no" | 602 | Default: "no" | |
603 | 603 | |||
604 | TOOLDIR Directory to hold the host tools, once built. If | 604 | TOOLDIR Directory to hold the host tools, once built. If | |
605 | specified, must be an absolute path. This directory | 605 | specified, must be an absolute path. This directory | |
606 | should be unique to a given host system and NetBSD source | 606 | should be unique to a given host system and NetBSD source | |
607 | tree. (However, multiple targets may share the same | 607 | tree. (However, multiple targets may share the same | |
608 | TOOLDIR; the target-dependent files have unique names.) | 608 | TOOLDIR; the target-dependent files have unique names.) | |
609 | If unset, a default based on the uname(1) information of | 609 | If unset, a default based on the uname(1) information of | |
610 | the host platform will be created in the .OBJDIR of src. | 610 | the host platform will be created in the .OBJDIR of src. | |
611 | 611 | |||
612 | Default: Unset. | 612 | Default: Unset. | |
613 | 613 | |||
614 | USETOOLS Can be set to "yes" or "no". Indicates whether the tools | 614 | USETOOLS Can be set to "yes" or "no". Indicates whether the tools | |
615 | specified by TOOLDIR should be used as part of a build in | 615 | specified by TOOLDIR should be used as part of a build in | |
616 | progress. Must be set to "yes" if cross-compiling. | 616 | progress. Must be set to "yes" if cross-compiling. | |
617 | 617 | |||
618 | yes Use the tools from TOOLDIR. | 618 | yes Use the tools from TOOLDIR. | |
619 | 619 | |||
620 | no Do not use the tools from TOOLDIR, but refuse to | 620 | no Do not use the tools from TOOLDIR, but refuse to | |
621 | build native compilation tool components that are | 621 | build native compilation tool components that are | |
622 | version-specific for that tool. | 622 | version-specific for that tool. | |
623 | 623 | |||
624 | never Do not use the tools from TOOLDIR, even when | 624 | never Do not use the tools from TOOLDIR, even when | |
625 | building native tool components. This is similar | 625 | building native tool components. This is similar | |
626 | to the traditional NetBSD build method, but does | 626 | to the traditional NetBSD build method, but does | |
627 | not verify that the compilation tools in use are | 627 | not verify that the compilation tools in use are | |
628 | up-to-date enough in order to build the tree | 628 | up-to-date enough in order to build the tree | |
629 | successfully. This may cause build or runtime | 629 | successfully. This may cause build or runtime | |
630 | problems when building the whole NetBSD source | 630 | problems when building the whole NetBSD source | |
631 | tree. | 631 | tree. | |
632 | 632 | |||
633 | Default: "no" when using <bsd.*.mk> outside the NetBSD | 633 | Default: "no" when using <bsd.*.mk> outside the NetBSD | |
634 | source tree (detected automatically) or if | 634 | source tree (detected automatically) or if | |
635 | TOOLCHAIN_MISSING=yes; "yes" otherwise. | 635 | TOOLCHAIN_MISSING=yes; "yes" otherwise. | |
636 | 636 | |||
637 | X11SRCDIR Directory containing the modular Xorg source. If | 637 | X11SRCDIR Directory containing the modular Xorg source. If | |
638 | specified, must be an absolute path. The main modular | 638 | specified, must be an absolute path. The main modular | |
639 | Xorg source is found in X11SRCDIR/external/mit. | 639 | Xorg source is found in X11SRCDIR/external/mit. | |
640 | 640 | |||
641 | Default: NETBSDSRCDIR/../xsrc, if that exists; otherwise | 641 | Default: NETBSDSRCDIR/../xsrc, if that exists; otherwise | |
642 | /usr/xsrc. | 642 | /usr/xsrc. | |
643 | 643 | |||
644 | "make" variables for full builds | 644 | "make" variables for full builds | |
645 | These variables only affect the top level "Makefile" and do not affect | 645 | These variables only affect the top level "Makefile" and do not affect | |
646 | manually building subtrees of the NetBSD source code. | 646 | manually building subtrees of the NetBSD source code. | |
647 | 647 | |||
648 | INSTALLBOOT_BOARDS | 648 | INSTALLBOOT_BOARDS | |
649 | A list of boards to create bootable images for. If | 649 | A list of boards to create bootable images for. If | |
650 | corresponding U-Boot packages are installed, bootable | 650 | corresponding U-Boot packages are installed, bootable | |
651 | images are created as part of a release. See the | 651 | images are created as part of a release. See the | |
652 | -o board=name option of installboot(8). | 652 | -o board=name option of installboot(8). | |
653 | 653 | |||
654 | INSTALLWORLDDIR | 654 | INSTALLWORLDDIR | |
655 | Location for the "make installworld" target to install | 655 | Location for the "make installworld" target to install | |
656 | to. If specified, must be an absolute path. | 656 | to. If specified, must be an absolute path. | |
657 | 657 | |||
658 | Default: "/" | 658 | Default: "/" | |
659 | 659 | |||
660 | MKOBJDIRS Can be set to "yes" or "no". Indicates whether object | 660 | MKOBJDIRS Can be set to "yes" or "no". Indicates whether object | |
661 | directories will be created automatically (via a "make | 661 | directories will be created automatically (via a "make | |
662 | obj" pass) at the start of a build. | 662 | obj" pass) at the start of a build. | |
663 | 663 | |||
664 | Default: "no" | 664 | Default: "no" | |
665 | 665 | |||
666 | If using build.sh, the default is "yes". This may be set | 666 | If using build.sh, the default is "yes". This may be set | |
667 | back to "no" by giving build.sh the -o option. | 667 | back to "no" by giving build.sh the -o option. | |
668 | 668 | |||
669 | MKUPDATE Can be set to "yes" or "no". If set, then in addition to | 669 | MKUPDATE Can be set to "yes" or "no". If set, then in addition to | |
670 | the effects described for MKUPDATE=yes above, this | 670 | the effects described for MKUPDATE=yes above, this | |
671 | implies the effects of NOCLEANDIR (i.e., "make cleandir" | 671 | implies the effects of NOCLEANDIR (i.e., "make cleandir" | |
672 | is avoided). | 672 | is avoided). | |
673 | 673 | |||
674 | Default: "no" | 674 | Default: "no" | |
675 | 675 | |||
676 | If using build.sh, this may be set by giving the -u | 676 | If using build.sh, this may be set by giving the -u | |
677 | option. | 677 | option. | |
678 | 678 | |||
679 | NBUILDJOBS Now obsolete. Use the make(1) option -j, instead. See | |||
680 | below. | |||
681 | ||||
682 | Default: Unset. | |||
683 | ||||
684 | NOCLEANDIR If set, avoids the "make cleandir" phase of a full build. | 679 | NOCLEANDIR If set, avoids the "make cleandir" phase of a full build. | |
685 | This has the effect of allowing only changed files in a | 680 | This has the effect of allowing only changed files in a | |
686 | source tree to be recompiled. This can speed up builds | 681 | source tree to be recompiled. This can speed up builds | |
687 | when updating only a few files in the tree. | 682 | when updating only a few files in the tree. | |
688 | 683 | |||
689 | Default: Unset. | 684 | Default: Unset. | |
690 | 685 | |||
691 | See also MKUPDATE. | 686 | See also MKUPDATE. | |
692 | 687 | |||
693 | NODISTRIBDIRS If set, avoids the "make distrib-dirs" phase of a full | 688 | NODISTRIBDIRS If set, avoids the "make distrib-dirs" phase of a full | |
694 | build. This skips running mtree(8) on DESTDIR, useful on | 689 | build. This skips running mtree(8) on DESTDIR, useful on | |
695 | systems where building as an unprivileged user, or where | 690 | systems where building as an unprivileged user, or where | |
696 | it is known that the system-wide mtree files have not | 691 | it is known that the system-wide mtree files have not | |
697 | changed. | 692 | changed. | |
698 | 693 | |||
699 | Default: Unset. | 694 | Default: Unset. | |
700 | 695 | |||
701 | NOINCLUDES If set, avoids the "make includes" phase of a full build. | 696 | NOINCLUDES If set, avoids the "make includes" phase of a full build. | |
702 | This has the effect of preventing make(1) from thinking | 697 | This has the effect of preventing make(1) from thinking | |
703 | that some programs are out-of-date simply because the | 698 | that some programs are out-of-date simply because the | |
704 | system include files have changed. However, this option | 699 | system include files have changed. However, this option | |
705 | should not be used when updating the entire NetBSD source | 700 | should not be used when updating the entire NetBSD source | |
706 | tree arbitrarily; it is suggested to use MKUPDATE=yes | 701 | tree arbitrarily; it is suggested to use MKUPDATE=yes | |
707 | instead in that case. | 702 | instead in that case. | |
708 | 703 | |||
709 | Default: Unset. | 704 | Default: Unset. | |
710 | 705 | |||
711 | RELEASEDIR If set, specifies the directory to which a release(7) | 706 | RELEASEDIR If set, specifies the directory to which a release(7) | |
712 | layout will be written at the end of a "make release". | 707 | layout will be written at the end of a "make release". | |
713 | If specified, must be an absolute path. | 708 | If specified, must be an absolute path. | |
714 | 709 | |||
715 | Note: build.sh will provide a default of releasedir (in | 710 | Note: build.sh will provide a default of releasedir (in | |
716 | the top-level .OBJDIR) unless run in `expert' mode. | 711 | the top-level .OBJDIR) unless run in `expert' mode. | |
717 | 712 | |||
718 | Default: Unset. | 713 | Default: Unset. | |
719 | 714 | |||
720 | BUILDING | 715 | BUILDING | |
721 | "make" command line options | 716 | "make" command line options | |
722 | This is not a summary of all the options available to make(1); only the | 717 | This is not a summary of all the options available to make(1); only the | |
723 | options used most frequently with NetBSD builds are listed here. | 718 | options used most frequently with NetBSD builds are listed here. | |
724 | 719 | |||
725 | -j njob Run up to njob make(1) subjobs in parallel. Makefiles should | 720 | -j njob Run up to njob make(1) subjobs in parallel. Makefiles should | |
726 | use .WAIT or have explicit dependencies as necessary to | 721 | use .WAIT or have explicit dependencies as necessary to | |
727 | enforce build ordering. | 722 | enforce build ordering. | |
728 | 723 | |||
729 | -m dir Specify the default directory for searching for system | 724 | -m dir Specify the default directory for searching for system | |
730 | Makefile segments, mainly the <bsd.*.mk> files. When building | 725 | Makefile segments, mainly the <bsd.*.mk> files. When building | |
731 | any full NetBSD source tree, this should be set to the | 726 | any full NetBSD source tree, this should be set to the | |
732 | "share/mk" directory in the source tree. This is set | 727 | "share/mk" directory in the source tree. This is set | |
733 | automatically when building from the top level, or when using | 728 | automatically when building from the top level, or when using | |
734 | build.sh. | 729 | build.sh. | |
735 | 730 | |||
736 | -n Show the commands that would have been executed, but do not | 731 | -n Show the commands that would have been executed, but do not | |
737 | actually execute them. This will still cause recursion to | 732 | actually execute them. This will still cause recursion to | |
738 | take place. | 733 | take place. | |
739 | 734 | |||
740 | -V var Show make(1)'s idea of the value of var. Does not build any | 735 | -V var Show make(1)'s idea of the value of var. Does not build any | |
741 | targets. | 736 | targets. | |
742 | 737 | |||
743 | var=value Set the variable var to value, overriding any setting | 738 | var=value Set the variable var to value, overriding any setting | |
744 | specified by the process environment, the MAKECONF | 739 | specified by the process environment, the MAKECONF | |
745 | configuration file, or the system Makefile segments. | 740 | configuration file, or the system Makefile segments. | |
746 | 741 | |||
747 | "make" targets | 742 | "make" targets | |
748 | These default targets may be built by running make(1) in any subtree of | 743 | These default targets may be built by running make(1) in any subtree of | |
749 | the NetBSD source code. It is recommended that none of these be used | 744 | the NetBSD source code. It is recommended that none of these be used | |
750 | from the top level Makefile; as a specific exception, "make obj" and | 745 | from the top level Makefile; as a specific exception, "make obj" and | |
751 | "make cleandir" are useful in that context. | 746 | "make cleandir" are useful in that context. | |
752 | 747 | |||
753 | all Build programs, libraries, and preformatted documentation. | 748 | all Build programs, libraries, and preformatted documentation. | |
754 | 749 | |||
755 | clean Remove program and library object code files. | 750 | clean Remove program and library object code files. | |
756 | 751 | |||
757 | cleandir Same as clean, but also remove preformatted documentation, | 752 | cleandir Same as clean, but also remove preformatted documentation, | |
758 | dependency files generated by "make depend", and any other | 753 | dependency files generated by "make depend", and any other | |
759 | files known to be created at build time. | 754 | files known to be created at build time. | |
760 | 755 | |||
761 | depend Create dependency files (.depend) containing more detailed | 756 | depend Create dependency files (.depend) containing more detailed | |
762 | information about the dependencies of source code on header | 757 | information about the dependencies of source code on header | |
763 | files. Allows programs to be recompiled automatically when a | 758 | files. Allows programs to be recompiled automatically when a | |
764 | dependency changes. | 759 | dependency changes. | |
765 | 760 | |||
766 | dependall Does a "make depend" immediately followed by a "make all". | 761 | dependall Does a "make depend" immediately followed by a "make all". | |
767 | This improves cache locality of the build since both passes | 762 | This improves cache locality of the build since both passes | |
768 | read the source files in their entirety. | 763 | read the source files in their entirety. | |
769 | 764 | |||
770 | distclean Synonym for cleandir. | 765 | distclean Synonym for cleandir. | |
771 | 766 | |||
772 | includes Build and install system header files. Typically needed | 767 | includes Build and install system header files. Typically needed | |
773 | before any system libraries or programs can be built. | 768 | before any system libraries or programs can be built. | |
774 | 769 | |||
775 | install Install programs, libraries, and documentation into DESTDIR. | 770 | install Install programs, libraries, and documentation into DESTDIR. | |
776 | Few files will be installed to DESTDIR/dev, DESTDIR/etc, | 771 | Few files will be installed to DESTDIR/dev, DESTDIR/etc, | |
777 | DESTDIR/root or DESTDIR/var in order to prevent user supplied | 772 | DESTDIR/root or DESTDIR/var in order to prevent user supplied | |
778 | configuration data from being overwritten. | 773 | configuration data from being overwritten. | |
779 | 774 | |||
780 | lint Run lint(1) against the C source code, where appropriate, and | 775 | lint Run lint(1) against the C source code, where appropriate, and | |
781 | generate system-installed lint libraries. | 776 | generate system-installed lint libraries. | |
782 | 777 | |||
783 | obj Create object directories to be used for built files, instead | 778 | obj Create object directories to be used for built files, instead | |
784 | of building directly in the source tree. | 779 | of building directly in the source tree. | |
785 | 780 | |||
786 | tags Create ctags(1) searchable function lists usable by the ex(1) | 781 | tags Create ctags(1) searchable function lists usable by the ex(1) | |
787 | and vi(1) text editors. | 782 | and vi(1) text editors. | |
788 | 783 | |||
789 | "make" targets for the top level | 784 | "make" targets for the top level | |
790 | Additional make(1) targets are usable specifically from the top source | 785 | Additional make(1) targets are usable specifically from the top source | |
791 | level to facilitate building the entire NetBSD source tree. | 786 | level to facilitate building the entire NetBSD source tree. | |
792 | 787 | |||
793 | build Build the entire NetBSD system (except the kernel). This | 788 | build Build the entire NetBSD system (except the kernel). This | |
794 | orders portions of the source tree such that prerequisites | 789 | orders portions of the source tree such that prerequisites | |
795 | will be built in the proper order. | 790 | will be built in the proper order. | |
796 | 791 | |||
797 | distribution Do a "make build", and then install a full distribution | 792 | distribution Do a "make build", and then install a full distribution | |
798 | (which does not include a kernel) into DESTDIR, including | 793 | (which does not include a kernel) into DESTDIR, including | |
799 | files in DESTDIR/dev, DESTDIR/etc, DESTDIR/root and | 794 | files in DESTDIR/dev, DESTDIR/etc, DESTDIR/root and | |
800 | DESTDIR/var. | 795 | DESTDIR/var. | |
801 | 796 | |||
802 | buildworld As per "make distribution", except that it ensures that | 797 | buildworld As per "make distribution", except that it ensures that | |
803 | DESTDIR is not the root directory. | 798 | DESTDIR is not the root directory. | |
804 | 799 | |||
805 | installworld Install the distribution from DESTDIR to INSTALLWORLDDIR, | 800 | installworld Install the distribution from DESTDIR to INSTALLWORLDDIR, | |
806 | which defaults to the root directory. Ensures that | 801 | which defaults to the root directory. Ensures that | |
807 | INSTALLWORLDDIR is not the root directory if cross | 802 | INSTALLWORLDDIR is not the root directory if cross | |
808 | compiling. | 803 | compiling. | |
809 | 804 | |||
810 | The INSTALLSETS environment variable may be set to a space- | 805 | The INSTALLSETS environment variable may be set to a space- | |
811 | separated list of distribution sets to be installed. By | 806 | separated list of distribution sets to be installed. By | |
812 | default, all sets except "etc" and "xetc" are installed, so | 807 | default, all sets except "etc" and "xetc" are installed, so | |
813 | most files in INSTALLWORLDDIR/etc will not be installed or | 808 | most files in INSTALLWORLDDIR/etc will not be installed or | |
814 | modified. | 809 | modified. | |
815 | 810 | |||
816 | Note: Before performing this operation with | 811 | Note: Before performing this operation with | |
817 | INSTALLWORLDDIR=/, it is highly recommended that you | 812 | INSTALLWORLDDIR=/, it is highly recommended that you | |
818 | upgrade your kernel and reboot. After performing this | 813 | upgrade your kernel and reboot. After performing this | |
819 | operation, it is recommended that you use etcupdate(8) to | 814 | operation, it is recommended that you use etcupdate(8) to | |
820 | update files in INSTALLWORLDDIR/etc, and postinstall(8) to | 815 | update files in INSTALLWORLDDIR/etc, and postinstall(8) to | |
821 | check for or fix inconsistencies. | 816 | check for or fix inconsistencies. | |
822 | 817 | |||
823 | sets Create distribution sets from DESTDIR into | 818 | sets Create distribution sets from DESTDIR into | |
824 | RELEASEDIR/RELEASEMACHINEDIR/binary/sets. Should be run | 819 | RELEASEDIR/RELEASEMACHINEDIR/binary/sets. Should be run | |
825 | after "make distribution", as "make build" alone does not | 820 | after "make distribution", as "make build" alone does not | |
826 | install all of the required files. | 821 | install all of the required files. | |
827 | 822 | |||
828 | sourcesets Create source sets of the source tree into | 823 | sourcesets Create source sets of the source tree into | |
829 | RELEASEDIR/source/sets. | 824 | RELEASEDIR/source/sets. | |
830 | 825 | |||
831 | syspkgs Create syspkgs from DESTDIR into | 826 | syspkgs Create syspkgs from DESTDIR into | |
832 | RELEASEDIR/RELEASEMACHINEDIR/binary/syspkgs. Should be run | 827 | RELEASEDIR/RELEASEMACHINEDIR/binary/syspkgs. Should be run | |
833 | after "make distribution", as "make build" alone does not | 828 | after "make distribution", as "make build" alone does not | |
834 | install all of the required files. | 829 | install all of the required files. | |
835 | 830 | |||
836 | release Do a "make distribution", build kernels, distribution | 831 | release Do a "make distribution", build kernels, distribution | |
837 | media, and install sets (this as per "make sets"), and then | 832 | media, and install sets (this as per "make sets"), and then | |
838 | package the system into a standard release layout as | 833 | package the system into a standard release layout as | |
839 | described by release(7). This requires that RELEASEDIR be | 834 | described by release(7). This requires that RELEASEDIR be | |
840 | set (see above). | 835 | set (see above). | |
841 | 836 | |||
842 | iso-image Create a NetBSD installation CD-ROM image in the | 837 | iso-image Create a NetBSD installation CD-ROM image in the | |
843 | RELEASEDIR/images directory. The CD-ROM file system will | 838 | RELEASEDIR/images directory. The CD-ROM file system will | |
844 | have a layout as described in release(7). | 839 | have a layout as described in release(7). | |
845 | 840 | |||
846 | For most machine types, the CD-ROM will be bootable, and | 841 | For most machine types, the CD-ROM will be bootable, and | |
847 | will automatically run the sysinst(8) menu-based | 842 | will automatically run the sysinst(8) menu-based | |
848 | installation program, which can be used to install or | 843 | installation program, which can be used to install or | |
849 | upgrade a NetBSD system. Bootable CD-ROMs also contain | 844 | upgrade a NetBSD system. Bootable CD-ROMs also contain | |
850 | tools that may be useful in repairing a damaged NetBSD | 845 | tools that may be useful in repairing a damaged NetBSD | |
851 | installation. | 846 | installation. | |
852 | 847 | |||
853 | Before "make iso-image" is attempted, RELEASEDIR must be | 848 | Before "make iso-image" is attempted, RELEASEDIR must be | |
854 | populated by "make release" or equivalent. | 849 | populated by "make release" or equivalent. | |
855 | 850 | |||
856 | Note: Other, smaller, CD-ROM images may be created in the | 851 | Note: Other, smaller, CD-ROM images may be created in the | |
857 | RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom directory | 852 | RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom directory | |
858 | by "make release". These smaller images usually contain | 853 | by "make release". These smaller images usually contain | |
859 | the same tools as the larger images in RELEASEDIR/images, | 854 | the same tools as the larger images in RELEASEDIR/images, | |
860 | but do not contain additional content such as the | 855 | but do not contain additional content such as the | |
861 | distribution sets. | 856 | distribution sets. | |
862 | 857 | |||
863 | Note: The mac68k port still uses an older method of | 858 | Note: The mac68k port still uses an older method of | |
864 | creating CD-ROM images. This requires the mkisofs(1) | 859 | creating CD-ROM images. This requires the mkisofs(1) | |
865 | utility, which is not part of NetBSD, but which can be | 860 | utility, which is not part of NetBSD, but which can be | |
866 | installed from pkgsrc/sysutils/cdrtools. | 861 | installed from pkgsrc/sysutils/cdrtools. | |
867 | 862 | |||
868 | iso-image-source | 863 | iso-image-source | |
869 | Create a NetBSD installation CD-ROM image in the | 864 | Create a NetBSD installation CD-ROM image in the | |
870 | RELEASEDIR/images directory. The CD-ROM file system will | 865 | RELEASEDIR/images directory. The CD-ROM file system will | |
871 | have a layout as described in release(7). It will have top | 866 | have a layout as described in release(7). It will have top | |
872 | level directories for the machine type and source. | 867 | level directories for the machine type and source. | |
873 | 868 | |||
874 | For most machine types, the CD-ROM will be bootable, and | 869 | For most machine types, the CD-ROM will be bootable, and | |
875 | will automatically run the sysinst(8) menu-based | 870 | will automatically run the sysinst(8) menu-based | |
876 | installation program, which can be used to install or | 871 | installation program, which can be used to install or | |
877 | upgrade a NetBSD system. Bootable CD-ROMs also contain | 872 | upgrade a NetBSD system. Bootable CD-ROMs also contain | |
878 | tools that may be useful in repairing a damaged NetBSD | 873 | tools that may be useful in repairing a damaged NetBSD | |
879 | installation. | 874 | installation. | |
880 | 875 | |||
881 | Before "make iso-image-source" is attempted, RELEASEDIR | 876 | Before "make iso-image-source" is attempted, RELEASEDIR | |
882 | must be populated by "make sourcesets release" or | 877 | must be populated by "make sourcesets release" or | |
883 | equivalent. | 878 | equivalent. | |
884 | 879 | |||
885 | Note: Other, smaller, CD-ROM images may be created in the | 880 | Note: Other, smaller, CD-ROM images may be created in the | |
886 | RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom directory | 881 | RELEASEDIR/RELEASEMACHINEDIR/installation/cdrom directory | |
887 | by "make release". These smaller images usually contain | 882 | by "make release". These smaller images usually contain | |
888 | the same tools as the larger images in RELEASEDIR/images, | 883 | the same tools as the larger images in RELEASEDIR/images, | |
889 | but do not contain additional content such as the | 884 | but do not contain additional content such as the | |
890 | distribution sets. | 885 | distribution sets. | |
891 | 886 | |||
892 | Note: The mac68k port still uses an older method of | 887 | Note: The mac68k port still uses an older method of | |
893 | creating CD-ROM images. This requires the mkisofs(1) | 888 | creating CD-ROM images. This requires the mkisofs(1) | |
894 | utility, which is not part of NetBSD, but which can be | 889 | utility, which is not part of NetBSD, but which can be | |
895 | installed from pkgsrc/sysutils/cdrtools. | 890 | installed from pkgsrc/sysutils/cdrtools. | |
896 | 891 | |||
897 | install-image | 892 | install-image | |
898 | Create a bootable NetBSD installation disk image in the | 893 | Create a bootable NetBSD installation disk image in the | |
899 | RELEASEDIR/images directory. The installation disk image | 894 | RELEASEDIR/images directory. The installation disk image | |
900 | is suitable for copying to bootable USB flash memory | 895 | is suitable for copying to bootable USB flash memory | |
901 | sticks, etc., for machines which are able to boot from such | 896 | sticks, etc., for machines which are able to boot from such | |
902 | devices. The file system in the bootable disk image will | 897 | devices. The file system in the bootable disk image will | |
903 | have a layout as described in release(7). | 898 | have a layout as described in release(7). | |
904 | 899 | |||
905 | The installation image is bootable, and will automatically | 900 | The installation image is bootable, and will automatically | |
906 | run the sysinst(8) menu-based installation program, which | 901 | run the sysinst(8) menu-based installation program, which | |
907 | can be used to install or upgrade a NetBSD system. The | 902 | can be used to install or upgrade a NetBSD system. The | |
908 | image also contains tools that may be useful in repairing a | 903 | image also contains tools that may be useful in repairing a | |
909 | damaged NetBSD installation. | 904 | damaged NetBSD installation. | |
910 | 905 | |||
911 | Before "make install-image" is attempted, RELEASEDIR must | 906 | Before "make install-image" is attempted, RELEASEDIR must | |
912 | be populated by "make release" or equivalent. The build | 907 | be populated by "make release" or equivalent. The build | |
913 | must have been performed with MKUNPRIVED=yes because "make | 908 | must have been performed with MKUNPRIVED=yes because "make | |
914 | install-image" relies on information in DESTDIR/METALOG. | 909 | install-image" relies on information in DESTDIR/METALOG. | |
915 | 910 | |||
916 | live-image Create NetBSD live images in the RELEASEDIR/images | 911 | live-image Create NetBSD live images in the RELEASEDIR/images | |
917 | directory. The live image contains all necessary files to | 912 | directory. The live image contains all necessary files to | |
918 | boot NetBSD up to multi-user mode, including all files | 913 | boot NetBSD up to multi-user mode, including all files | |
919 | which should be extracted during installation, NetBSD | 914 | which should be extracted during installation, NetBSD | |
920 | disklabel, bootloaders, etc. | 915 | disklabel, bootloaders, etc. | |
921 | 916 | |||
922 | The live image is suitable for use as a disk image in | 917 | The live image is suitable for use as a disk image in | |
923 | virtual machine environments such as QEMU, and also useful | 918 | virtual machine environments such as QEMU, and also useful | |
924 | to boot NetBSD from a USB flash memory stick on a real | 919 | to boot NetBSD from a USB flash memory stick on a real | |
925 | machine, without the need for installation. | 920 | machine, without the need for installation. | |
926 | 921 | |||
927 | Before "make live-image" is attempted, RELEASEDIR must be | 922 | Before "make live-image" is attempted, RELEASEDIR must be | |
928 | populated by "make release" or equivalent. The build must | 923 | populated by "make release" or equivalent. The build must | |
929 | have been performed with MKUNPRIVED=yes because "make | 924 | have been performed with MKUNPRIVED=yes because "make | |
930 | install-image" relies on information in DESTDIR/METALOG. | 925 | install-image" relies on information in DESTDIR/METALOG. | |
931 | 926 | |||
932 | regression-tests | 927 | regression-tests | |
933 | Can only be run after building the regression tests in the | 928 | Can only be run after building the regression tests in the | |
934 | directory "regress". Runs those compiled regression tests | 929 | directory "regress". Runs those compiled regression tests | |
935 | on the local host. | 930 | on the local host. | |
936 | 931 | |||
937 | Note: Most tests are now managed instead using atf(7); this | 932 | Note: Most tests are now managed instead using atf(7); this | |
938 | target should probably run those as well but currently does | 933 | target should probably run those as well but currently does | |
939 | not. | 934 | not. | |
940 | 935 | |||
941 | The "build.sh" script | 936 | The "build.sh" script | |
942 | This script file is a shell script designed to build the entire NetBSD | 937 | This script file is a shell script designed to build the entire NetBSD | |
943 | system on any host with a suitable modern shell and some common | 938 | system on any host with a suitable modern shell and some common | |
944 | utilities. The required shell features are described under the HOST_SH | 939 | utilities. The required shell features are described under the HOST_SH | |
945 | variable. | 940 | variable. | |
946 | 941 | |||
947 | If a host system's default shell does support the required features, then | 942 | If a host system's default shell does support the required features, then | |
948 | we suggest that you explicitly specify a suitable shell using a command | 943 | we suggest that you explicitly specify a suitable shell using a command | |
949 | like | 944 | like | |
950 | 945 | |||
951 | /path/to/suitable/shell build.sh [options] | 946 | /path/to/suitable/shell build.sh [options] | |
952 | 947 | |||
953 | The above command will usually enable build.sh to automatically set | 948 | The above command will usually enable build.sh to automatically set | |
954 | HOST_SH=/path/to/suitable/shell, but if that fails, then the following | 949 | HOST_SH=/path/to/suitable/shell, but if that fails, then the following | |
955 | set of commands may be used instead: | 950 | set of commands may be used instead: | |
956 | 951 | |||
957 | HOST_SH=/path/to/suitable/shell | 952 | HOST_SH=/path/to/suitable/shell | |
958 | export HOST_SH | 953 | export HOST_SH | |
959 | ${HOST_SH} build.sh [options] | 954 | ${HOST_SH} build.sh [options] | |
960 | 955 | |||
961 | If build.sh detects that it is being executed under an unsuitable shell, | 956 | If build.sh detects that it is being executed under an unsuitable shell, | |
962 | it attempts to exec a suitable shell instead, or shows an error message. | 957 | it attempts to exec a suitable shell instead, or shows an error message. | |
963 | If HOST_SH is not set explicitly, then build.sh sets a default using | 958 | If HOST_SH is not set explicitly, then build.sh sets a default using | |
964 | heuristics dependent on the host platform, or from the shell under which | 959 | heuristics dependent on the host platform, or from the shell under which | |
965 | build.sh is executed (if that can be determined), or using the first copy | 960 | build.sh is executed (if that can be determined), or using the first copy | |
966 | of sh found in PATH. | 961 | of sh found in PATH. | |
967 | 962 | |||
968 | All cross-compile builds, and most native builds, of the entire system | 963 | All cross-compile builds, and most native builds, of the entire system | |
969 | should make use of build.sh rather than just running "make". This way, | 964 | should make use of build.sh rather than just running "make". This way, | |
970 | the make(1) program will be bootstrapped properly, in case the host | 965 | the make(1) program will be bootstrapped properly, in case the host | |
971 | system has an older or incompatible "make" program. | 966 | system has an older or incompatible "make" program. | |
972 | 967 | |||
973 | When compiling the entire system via build.sh, many make(1) variables are | 968 | When compiling the entire system via build.sh, many make(1) variables are | |
974 | set for you in order to help encapsulate the build process. In the list | 969 | set for you in order to help encapsulate the build process. In the list | |
975 | of options below, variables that are automatically set by build.sh are | 970 | of options below, variables that are automatically set by build.sh are | |
976 | noted where applicable. | 971 | noted where applicable. | |
977 | 972 | |||
978 | The following operations are supported by build.sh: | 973 | The following operations are supported by build.sh: | |
979 | 974 | |||
980 | build Build the system as per "make build". Before the main part | 975 | build Build the system as per "make build". Before the main part | |
981 | of the build commences, this command runs the obj operation | 976 | of the build commences, this command runs the obj operation | |
982 | (unless the -o option is given), "make cleandir" (unless | 977 | (unless the -o option is given), "make cleandir" (unless | |
983 | the -u option is given), and the tools operation. | 978 | the -u option is given), and the tools operation. | |
984 | 979 | |||
985 | distribution Build a full distribution as per "make distribution". This | 980 | distribution Build a full distribution as per "make distribution". This | |
986 | command first runs the build operation. | 981 | command first runs the build operation. | |
987 | 982 | |||
988 | release Build a full release as per "make release". This command | 983 | release Build a full release as per "make release". This command | |
989 | first runs the distribution operation. | 984 | first runs the distribution operation. | |
990 | 985 | |||
991 | help Show a help message, and exit. | 986 | help Show a help message, and exit. | |
992 | 987 | |||
993 | makewrapper Create the nbmake-MACHINE wrapper. This operation is | 988 | makewrapper Create the nbmake-MACHINE wrapper. This operation is | |
994 | automatically performed for any of the other operations. | 989 | automatically performed for any of the other operations. | |
995 | 990 | |||
996 | cleandir Perform "make cleandir". | 991 | cleandir Perform "make cleandir". | |
997 | 992 | |||
998 | obj Perform "make obj". | 993 | obj Perform "make obj". | |
999 | 994 | |||
1000 | tools Build and install the host tools from src/tools. This | 995 | tools Build and install the host tools from src/tools. This | |
1001 | command will first run "make obj" and "make cleandir" in | 996 | command will first run "make obj" and "make cleandir" in | |
1002 | the tools subdirectory unless the -o or -u options | 997 | the tools subdirectory unless the -o or -u options | |
1003 | (respectively) are given. | 998 | (respectively) are given. | |
1004 | 999 | |||
1005 | install=idir Install the contents of DESTDIR to idir, using "make | 1000 | install=idir Install the contents of DESTDIR to idir, using "make | |
1006 | installworld". | 1001 | installworld". | |
1007 | 1002 | |||
1008 | Note: Files that are part of the "etc" or "xetc" sets will | 1003 | Note: Files that are part of the "etc" or "xetc" sets will | |
1009 | not be installed, unless overridden by the INSTALLSETS | 1004 | not be installed, unless overridden by the INSTALLSETS | |
1010 | environment variable. | 1005 | environment variable. | |
1011 | 1006 | |||
1012 | kernel=kconf Build a new kernel. The kconf argument is the name of a | 1007 | kernel=kconf Build a new kernel. The kconf argument is the name of a | |
1013 | configuration file suitable for use by config(1). If kconf | 1008 | configuration file suitable for use by config(1). If kconf | |
1014 | does not contain any `/' characters, the configuration file | 1009 | does not contain any `/' characters, the configuration file | |
1015 | is expected to be found in the KERNCONFDIR directory, which | 1010 | is expected to be found in the KERNCONFDIR directory, which | |
1016 | is typically sys/arch/MACHINE/conf. The new kernel will be | 1011 | is typically sys/arch/MACHINE/conf. The new kernel will be | |
1017 | built in a subdirectory of KERNOBJDIR, which is typically | 1012 | built in a subdirectory of KERNOBJDIR, which is typically | |
1018 | sys/arch/MACHINE/compile or an associated object directory. | 1013 | sys/arch/MACHINE/compile or an associated object directory. | |
1019 | 1014 | |||
1020 | This command does not imply the tools command; run the | 1015 | This command does not imply the tools command; run the | |
1021 | tools command first unless it is certain that the tools | 1016 | tools command first unless it is certain that the tools | |
1022 | already exist and are up to date. | 1017 | already exist and are up to date. | |
1023 | 1018 | |||
1024 | This command will run "make cleandir" on the kernel in | 1019 | This command will run "make cleandir" on the kernel in | |
1025 | question first unless the -u option is given. | 1020 | question first unless the -u option is given. | |
1026 | 1021 | |||
1027 | kernel.gdb=kconf | 1022 | kernel.gdb=kconf | |
1028 | Build a new kernel with debug information. Similar to the | 1023 | Build a new kernel with debug information. Similar to the | |
1029 | above kernel=kconf operation, but creates a netbsd.gdb file | 1024 | above kernel=kconf operation, but creates a netbsd.gdb file | |
1030 | alongside of the kernel netbsd, which contains a full | 1025 | alongside of the kernel netbsd, which contains a full | |
1031 | symbol table and can be used for debugging (for example | 1026 | symbol table and can be used for debugging (for example | |
1032 | with a cross-gdb built by MKCROSSGDB). | 1027 | with a cross-gdb built by MKCROSSGDB). | |
1033 | 1028 | |||
1034 | kernels This command will build all kernels defined in port | 1029 | kernels This command will build all kernels defined in port | |
1035 | specific release build procedure. | 1030 | specific release build procedure. | |
1036 | 1031 | |||
1037 | This command internally calls the kernel=kconf operation | 1032 | This command internally calls the kernel=kconf operation | |
1038 | for each found kernel configuration file. | 1033 | for each found kernel configuration file. | |
1039 | 1034 | |||
1040 | modules This command will build kernel modules and install them | 1035 | modules This command will build kernel modules and install them | |
1041 | into DESTDIR. | 1036 | into DESTDIR. | |
1042 | 1037 | |||
1043 | releasekernel=kconf | 1038 | releasekernel=kconf | |
1044 | Install a gzip(1)ed copy of the kernel previously built by | 1039 | Install a gzip(1)ed copy of the kernel previously built by | |
1045 | kernel=kconf into | 1040 | kernel=kconf into | |
1046 | RELEASEDIR/RELEASEMACHINEDIR/binary/kernel, usually as | 1041 | RELEASEDIR/RELEASEMACHINEDIR/binary/kernel, usually as | |
1047 | netbsd-kconf.gz, although the "netbsd" prefix is determined | 1042 | netbsd-kconf.gz, although the "netbsd" prefix is determined | |
1048 | from the "config" directives in kconf. | 1043 | from the "config" directives in kconf. | |
1049 | 1044 | |||
1050 | sets Perform "make sets". | 1045 | sets Perform "make sets". | |
1051 | 1046 | |||
1052 | sourcesets Perform "make sourcesets". | 1047 | sourcesets Perform "make sourcesets". | |
1053 | 1048 | |||
1054 | syspkgs Perform "make syspkgs". | 1049 | syspkgs Perform "make syspkgs". | |
1055 | 1050 | |||
1056 | iso-image Perform "make iso-image". | 1051 | iso-image Perform "make iso-image". | |
1057 | 1052 | |||
1058 | iso-image-source | 1053 | iso-image-source | |
1059 | Perform "make iso-image-source". | 1054 | Perform "make iso-image-source". | |
1060 | 1055 | |||
1061 | install-image | 1056 | install-image | |
1062 | Perform "make install-image". | 1057 | Perform "make install-image". | |
1063 | 1058 | |||
1064 | live-image Perform "make live-image". | 1059 | live-image Perform "make live-image". | |
1065 | 1060 | |||
1066 | list-arch Show a list of valid MACHINE and MACHINE_ARCH settings, the | 1061 | list-arch Show a list of valid MACHINE and MACHINE_ARCH settings, the | |
1067 | default MACHINE_ARCH for each MACHINE, and aliases for | 1062 | default MACHINE_ARCH for each MACHINE, and aliases for | |
1068 | MACHINE/MACHINE_ARCH pairs, and then exits. The -m or -a | 1063 | MACHINE/MACHINE_ARCH pairs, and then exits. The -m or -a | |
1069 | options (or both) may be used to specify glob patterns that | 1064 | options (or both) may be used to specify glob patterns that | |
1070 | will be used to narrow the list of results; for example, | 1065 | will be used to narrow the list of results; for example, | |
1071 | "build.sh -m 'evb*' -a '*arm*' list-arch" will list all | 1066 | "build.sh -m 'evb*' -a '*arm*' list-arch" will list all | |
1072 | known MACHINE/MACHINE_ARCH values in which either MACHINE | 1067 | known MACHINE/MACHINE_ARCH values in which either MACHINE | |
1073 | or ALIAS matches the pattern `evb*', and MACHINE_ARCH | 1068 | or ALIAS matches the pattern `evb*', and MACHINE_ARCH | |
1074 | matches the pattern `*arm*'. | 1069 | matches the pattern `*arm*'. | |
1075 | 1070 | |||
1076 | The following command line options alter the behaviour of the build.sh | 1071 | The following command line options alter the behaviour of the build.sh | |
1077 | operations described above: | 1072 | operations described above: | |
1078 | 1073 | |||
1079 | -a arch Set the value of MACHINE_ARCH to arch. See the -m option for | 1074 | -a arch Set the value of MACHINE_ARCH to arch. See the -m option for | |
1080 | more information. | 1075 | more information. | |
1081 | 1076 | |||
1082 | -B buildid | 1077 | -B buildid | |
1083 | Set the value of BUILDID to buildid. This will also append the | 1078 | Set the value of BUILDID to buildid. This will also append the | |
1084 | build identifier to the name of the "make" wrapper script so | 1079 | build identifier to the name of the "make" wrapper script so | |
1085 | that the resulting name is of the form | 1080 | that the resulting name is of the form | |
1086 | "nbmake-MACHINE-BUILDID". | 1081 | "nbmake-MACHINE-BUILDID". | |
1087 | 1082 | |||
1088 | -C cdextras | 1083 | -C cdextras | |
1089 | Append cdextras to the CDEXTRA variable, which is a space- | 1084 | Append cdextras to the CDEXTRA variable, which is a space- | |
1090 | separated list of files or directories that will be added to | 1085 | separated list of files or directories that will be added to | |
1091 | the CD-ROM image that may be create by the "iso-image" or | 1086 | the CD-ROM image that may be create by the "iso-image" or | |
1092 | "iso-image-source" operations. Files will be added to the root | 1087 | "iso-image-source" operations. Files will be added to the root | |
1093 | of the CD-ROM image, whereas directories will be copied | 1088 | of the CD-ROM image, whereas directories will be copied | |
1094 | recursively. If relative paths are specified, they will be | 1089 | recursively. If relative paths are specified, they will be | |
1095 | converted to absolute paths before being used. Multiple paths | 1090 | converted to absolute paths before being used. Multiple paths | |
1096 | may be specified via multiple -C options, or via a single | 1091 | may be specified via multiple -C options, or via a single | |
1097 | option whose argument contains multiple space-separated paths. | 1092 | option whose argument contains multiple space-separated paths. | |
1098 | 1093 | |||
1099 | -c compiler | 1094 | -c compiler | |
1100 | Select the compiler for the toolchain to build NetBSD and for | 1095 | Select the compiler for the toolchain to build NetBSD and for | |
1101 | inclusion in the NetBSD distribution. Supported choices: | 1096 | inclusion in the NetBSD distribution. Supported choices: | |
1102 | 1097 | |||
1103 | clang | 1098 | clang | |
1104 | 1099 | |||
1105 | gcc [default] | 1100 | gcc [default] | |
1106 | 1101 | |||
1107 | The compiler used to build the toolchain can be different; see | 1102 | The compiler used to build the toolchain can be different; see | |
1108 | HOST_CC and HOST_CXX. | 1103 | HOST_CC and HOST_CXX. | |
1109 | 1104 | |||
1110 | -D dest Set the value of DESTDIR to dest. If a relative path is | 1105 | -D dest Set the value of DESTDIR to dest. If a relative path is | |
1111 | specified, it will be converted to an absolute path before | 1106 | specified, it will be converted to an absolute path before | |
1112 | being used. | 1107 | being used. | |
1113 | 1108 | |||
1114 | -E Set `expert' mode. This overrides various sanity checks, and | 1109 | -E Set `expert' mode. This overrides various sanity checks, and | |
1115 | allows: DESTDIR does not have to be set to a non-root path for | 1110 | allows: DESTDIR does not have to be set to a non-root path for | |
1116 | builds, and MKUNPRIVED=yes does not have to be set when | 1111 | builds, and MKUNPRIVED=yes does not have to be set when | |
1117 | building as a non-root user. | 1112 | building as a non-root user. | |
1118 | 1113 | |||
1119 | Note: It is highly recommended that you know what you are doing | 1114 | Note: It is highly recommended that you know what you are doing | |
1120 | when you use this option. | 1115 | when you use this option. | |
1121 | 1116 | |||
1122 | -h Show a help message, and exit. | 1117 | -h Show a help message, and exit. | |
1123 | 1118 | |||
1124 | -j njob Run up to njob make(1) subjobs in parallel; passed through to | 1119 | -j njob Run up to njob make(1) subjobs in parallel; passed through to | |
1125 | make(1). If you see failures for reasons other than running | 1120 | make(1). If you see failures for reasons other than running | |
1126 | out of memory while using build.sh with -j, please save | 1121 | out of memory while using build.sh with -j, please save | |
1127 | complete build logs so the failures can be analyzed. | 1122 | complete build logs so the failures can be analyzed. | |
1128 | 1123 | |||
1129 | To achieve the fastest builds, -j values between (1 + the | 1124 | To achieve the fastest builds, -j values between (1 + the | |
1130 | number of CPUs) and (2 * the number of CPUs) are recommended. | 1125 | number of CPUs) and (2 * the number of CPUs) are recommended. | |
1131 | Use lower values on machines with limited memory or I/O | 1126 | Use lower values on machines with limited memory or I/O | |
1132 | bandwidth. | 1127 | bandwidth. | |
1133 | 1128 | |||
1134 | -M obj Set MAKEOBJDIRPREFIX to obj. Unsets MAKEOBJDIR. See "-O obj" | 1129 | -M obj Set MAKEOBJDIRPREFIX to obj. Unsets MAKEOBJDIR. See "-O obj" | |
1135 | for more information. | 1130 | for more information. | |
1136 | 1131 | |||
1137 | For instance, if the source directory is /usr/src, a setting of | 1132 | For instance, if the source directory is /usr/src, a setting of | |
1138 | "-M /usr/obj" will place build-time files under | 1133 | "-M /usr/obj" will place build-time files under | |
1139 | /usr/obj/usr/src/bin, /usr/obj/usr/src/lib, | 1134 | /usr/obj/usr/src/bin, /usr/obj/usr/src/lib, | |
1140 | /usr/obj/usr/src/usr.bin, and so forth. | 1135 | /usr/obj/usr/src/usr.bin, and so forth. | |
1141 | 1136 | |||
1142 | If a relative path is specified, it will be converted to an | 1137 | If a relative path is specified, it will be converted to an | |
1143 | absolute path before being used. build.sh imposes the | 1138 | absolute path before being used. build.sh imposes the | |
1144 | restriction that the argument to the -M option must not begin | 1139 | restriction that the argument to the -M option must not begin | |
1145 | with a "$" (dollar sign) character; otherwise it would be too | 1140 | with a "$" (dollar sign) character; otherwise it would be too | |
1146 | difficult to determine whether the value is an absolute or a | 1141 | difficult to determine whether the value is an absolute or a | |
1147 | relative path. If the directory does not already exist, | 1142 | relative path. If the directory does not already exist, | |
1148 | build.sh will create it. | 1143 | build.sh will create it. | |
1149 | 1144 | |||
1150 | -m mach Set the value of MACHINE to mach, unless the mach argument is | 1145 | -m mach Set the value of MACHINE to mach, unless the mach argument is | |
1151 | an alias that refers to a MACHINE/MACHINE_ARCH pair, in which | 1146 | an alias that refers to a MACHINE/MACHINE_ARCH pair, in which | |
1152 | case both MACHINE and MACHINE_ARCH are set from the alias. | 1147 | case both MACHINE and MACHINE_ARCH are set from the alias. | |
1153 | Such aliases are interpreted entirely by build.sh; they are not | 1148 | Such aliases are interpreted entirely by build.sh; they are not | |
1154 | used by any other part of the build system. The MACHINE_ARCH | 1149 | used by any other part of the build system. The MACHINE_ARCH | |
1155 | setting implied by mach will override any value of MACHINE_ARCH | 1150 | setting implied by mach will override any value of MACHINE_ARCH | |
1156 | in the process environment, but will not override a value set | 1151 | in the process environment, but will not override a value set | |
1157 | by the -a option. All cross builds require -m, but if unset on | 1152 | by the -a option. All cross builds require -m, but if unset on | |
1158 | a NetBSD host, the host's value of MACHINE will be detected and | 1153 | a NetBSD host, the host's value of MACHINE will be detected and | |
1159 | used automatically. | 1154 | used automatically. | |
1160 | 1155 | |||
1161 | See the list-arch operation for a way to get a list of valid | 1156 | See the list-arch operation for a way to get a list of valid | |
1162 | MACHINE and MACHINE_ARCH settings. | 1157 | MACHINE and MACHINE_ARCH settings. | |
1163 | 1158 | |||
1164 | -N noiselevel | 1159 | -N noiselevel | |
1165 | Set the "noisyness" level of the build, by setting MAKEVERBOSE | 1160 | Set the "noisyness" level of the build, by setting MAKEVERBOSE | |
1166 | to noiselevel. | 1161 | to noiselevel. | |
1167 | 1162 | |||
1168 | -n Show the commands that would be executed by build.sh, but do | 1163 | -n Show the commands that would be executed by build.sh, but do | |
1169 | not make any changes. This is similar in concept to "make -n". | 1164 | not make any changes. This is similar in concept to "make -n". | |
1170 | 1165 | |||
1171 | -O obj Create an appropriate transform macro for MAKEOBJDIR that will | 1166 | -O obj Create an appropriate transform macro for MAKEOBJDIR that will | |
1172 | place the built object files under obj. Unsets | 1167 | place the built object files under obj. Unsets | |
1173 | MAKEOBJDIRPREFIX. | 1168 | MAKEOBJDIRPREFIX. | |
1174 | 1169 | |||
1175 | For instance, a setting of "-O /usr/obj" will place build-time | 1170 | For instance, a setting of "-O /usr/obj" will place build-time | |
1176 | files under /usr/obj/bin, /usr/obj/lib, /usr/obj/usr.bin, and | 1171 | files under /usr/obj/bin, /usr/obj/lib, /usr/obj/usr.bin, and | |
1177 | so forth. | 1172 | so forth. | |
1178 | 1173 | |||
1179 | If a relative path is specified, it will be converted to an | 1174 | If a relative path is specified, it will be converted to an | |
1180 | absolute path before being used. build.sh imposes the | 1175 | absolute path before being used. build.sh imposes the | |
1181 | restriction that the argument to the -O option must not contain | 1176 | restriction that the argument to the -O option must not contain | |
1182 | a "$" (dollar sign) character. If the directory does not | 1177 | a "$" (dollar sign) character. If the directory does not | |
1183 | already exist, build.sh will create it. | 1178 | already exist, build.sh will create it. | |
1184 | 1179 | |||
1185 | In normal use, exactly one of the -M or -O options should be | 1180 | In normal use, exactly one of the -M or -O options should be | |
1186 | specified. If neither -M nor -O is specified, then a default | 1181 | specified. If neither -M nor -O is specified, then a default | |
1187 | object directory will be chosen according to rules in | 1182 | object directory will be chosen according to rules in | |
1188 | <bsd.obj.mk>. Relying on this default is not recommended | 1183 | <bsd.obj.mk>. Relying on this default is not recommended | |
1189 | because it is determined by complex rules that are influenced | 1184 | because it is determined by complex rules that are influenced | |
1190 | by the values of several variables and by the location of the | 1185 | by the values of several variables and by the location of the | |
1191 | source directory. | 1186 | source directory. | |
1192 | 1187 | |||
1193 | Note: Placing the obj directory location outside of the default | 1188 | Note: Placing the obj directory location outside of the default | |
1194 | source tree hierarchy makes it easier to manually clear out old | 1189 | source tree hierarchy makes it easier to manually clear out old | |
1195 | files in the event the "make cleandir" operation is unable to | 1190 | files in the event the "make cleandir" operation is unable to | |
1196 | do so. (See CAVEATS below.) | 1191 | do so. (See CAVEATS below.) | |
1197 | 1192 | |||
1198 | Note: The use of one of -M or -O is the only means of building | 1193 | Note: The use of one of -M or -O is the only means of building | |
1199 | multiple machine architecture userlands from the same source | 1194 | multiple machine architecture userlands from the same source | |
1200 | tree without cleaning between builds (in which case, one would | 1195 | tree without cleaning between builds (in which case, one would | |
1201 | specify distinct obj locations for each). | 1196 | specify distinct obj locations for each). | |
1202 | 1197 | |||
1203 | -o Set the value of MKOBJDIRS to "no". Otherwise, it will be | 1198 | -o Set the value of MKOBJDIRS to "no". Otherwise, it will be | |
1204 | automatically set to "yes". This default is opposite to the | 1199 | automatically set to "yes". This default is opposite to the | |
1205 | behaviour when not using build.sh. | 1200 | behaviour when not using build.sh. | |
1206 | 1201 | |||
1207 | -P Set the value of MKREPRO and MKREPRO_TIMESTAMP to the latest | 1202 | -P Set the value of MKREPRO and MKREPRO_TIMESTAMP to the latest | |
1208 | source CVS timestamp for reproducible builds. | 1203 | source CVS timestamp for reproducible builds. | |
1209 | 1204 | |||
1210 | -R rel Set the value of RELEASEDIR to rel. If a relative path is | 1205 | -R rel Set the value of RELEASEDIR to rel. If a relative path is | |
1211 | specified, it will be converted to an absolute path before | 1206 | specified, it will be converted to an absolute path before | |
1212 | being used. | 1207 | being used. | |
1213 | 1208 | |||
1214 | -r Remove the contents of DESTDIR and TOOLDIR before building | 1209 | -r Remove the contents of DESTDIR and TOOLDIR before building | |
1215 | (provides a clean starting point). This will skip deleting | 1210 | (provides a clean starting point). This will skip deleting | |
1216 | DESTDIR if building on a native system to the root directory. | 1211 | DESTDIR if building on a native system to the root directory. | |
1217 | 1212 | |||
1218 | -S seed Change the value of BUILDSEED to seed. This should rarely be | 1213 | -S seed Change the value of BUILDSEED to seed. This should rarely be | |
1219 | necessary. | 1214 | necessary. | |
1220 | 1215 | |||
1221 | -T tools Set the value of TOOLDIR to tools. If a relative path is | 1216 | -T tools Set the value of TOOLDIR to tools. If a relative path is | |
1222 | specified, it will be converted to an absolute path before | 1217 | specified, it will be converted to an absolute path before | |
1223 | being used. If set, the bootstrap "make" will only be rebuilt | 1218 | being used. If set, the bootstrap "make" will only be rebuilt | |
1224 | if the source files for make(1) have changed. | 1219 | if the source files for make(1) have changed. | |
1225 | 1220 | |||
1226 | -U Set MKUNPRIVED=yes. | 1221 | -U Set MKUNPRIVED=yes. | |
1227 | 1222 | |||
1228 | -u Set MKUPDATE=yes. | 1223 | -u Set MKUPDATE=yes. | |
1229 | 1224 | |||
1230 | -V var=[value] | 1225 | -V var=[value] | |
1231 | Set the environment variable var to an optional value. This is | 1226 | Set the environment variable var to an optional value. This is | |
1232 | propagated to the nbmake wrapper. | 1227 | propagated to the nbmake wrapper. | |
1233 | 1228 | |||
1234 | -w wrapper | 1229 | -w wrapper | |
1235 | Create the nbmake wrapper script (see below) in a custom | 1230 | Create the nbmake wrapper script (see below) in a custom | |
1236 | location, specified by wrapper. This allows, for instance, to | 1231 | location, specified by wrapper. This allows, for instance, to | |
1237 | place the wrapper in PATH automatically. | 1232 | place the wrapper in PATH automatically. | |
1238 | 1233 | |||
1239 | Note: wrapper is the full name of the file, not just a | 1234 | Note: wrapper is the full name of the file, not just a | |
1240 | directory name. If a relative path is specified, it will be | 1235 | directory name. If a relative path is specified, it will be | |
1241 | converted to an absolute path before being used. | 1236 | converted to an absolute path before being used. | |
1242 | 1237 | |||
1243 | -X x11src | 1238 | -X x11src | |
1244 | Set the value of X11SRCDIR to x11src. If a relative path is | 1239 | Set the value of X11SRCDIR to x11src. If a relative path is | |
1245 | specified, it will be converted to an absolute path before | 1240 | specified, it will be converted to an absolute path before | |
1246 | being used. | 1241 | being used. | |
1247 | 1242 | |||
1248 | -x Set MKX11=yes. | 1243 | -x Set MKX11=yes. | |
1249 | 1244 | |||
1250 | -Z var Unset ("zap") the environment variable var. This is propagated | 1245 | -Z var Unset ("zap") the environment variable var. This is propagated | |
1251 | to the nbmake wrapper. | 1246 | to the nbmake wrapper. | |
1252 | 1247 | |||
1253 | -? Show a help message, and exit. | 1248 | -? Show a help message, and exit. | |
1254 | 1249 | |||
1255 | The "nbmake-MACHINE" wrapper script | 1250 | The "nbmake-MACHINE" wrapper script | |
1256 | If using the build.sh script to build NetBSD, a nbmake-MACHINE script | 1251 | If using the build.sh script to build NetBSD, a nbmake-MACHINE script | |
1257 | will be created in TOOLDIR/bin upon the first build to assist in building | 1252 | will be created in TOOLDIR/bin upon the first build to assist in building | |
1258 | subtrees on a cross-compile host. | 1253 | subtrees on a cross-compile host. | |
1259 | 1254 | |||
1260 | nbmake-MACHINE can be invoked in lieu of make(1), and will instead call | 1255 | nbmake-MACHINE can be invoked in lieu of make(1), and will instead call | |
1261 | the up-to-date version of "nbmake" installed into TOOLDIR/bin with | 1256 | the up-to-date version of "nbmake" installed into TOOLDIR/bin with | |
1262 | several key variables pre-set, including MACHINE, MACHINE_ARCH, and | 1257 | several key variables pre-set, including MACHINE, MACHINE_ARCH, and | |
1263 | TOOLDIR. nbmake-MACHINE will also set variables specified with -V, and | 1258 | TOOLDIR. nbmake-MACHINE will also set variables specified with -V, and | |
1264 | unset variables specified with -Z. | 1259 | unset variables specified with -Z. | |
1265 | 1260 | |||
1266 | This script can be symlinked into a directory listed in PATH, or called | 1261 | This script can be symlinked into a directory listed in PATH, or called | |
1267 | with an absolute path. | 1262 | with an absolute path. | |
1268 | 1263 | |||
1269 | EXAMPLES | 1264 | EXAMPLES | |
1270 | 1. % ./build.sh [OPTIONS] tools kernel=GENERIC | 1265 | 1. % ./build.sh [OPTIONS] tools kernel=GENERIC | |
1271 | 1266 | |||
1272 | Build a new toolchain, and use the new toolchain to configure and | 1267 | Build a new toolchain, and use the new toolchain to configure and | |
1273 | build a new GENERIC kernel. | 1268 | build a new GENERIC kernel. | |
1274 | 1269 | |||
1275 | 2. % ./build.sh [OPTIONS] -U distribution | 1270 | 2. % ./build.sh [OPTIONS] -U distribution | |
1276 | 1271 | |||
1277 | Using unprivileged mode, build a complete distribution to a DESTDIR | 1272 | Using unprivileged mode, build a complete distribution to a DESTDIR | |
1278 | directory that build.sh selects (and will show). | 1273 | directory that build.sh selects (and will show). | |
1279 | 1274 | |||
1280 | 3. # ./build.sh [OPTIONS] -U install=/ | 1275 | 3. # ./build.sh [OPTIONS] -U install=/ | |
1281 | 1276 | |||
1282 | As root, install to / the distribution that was built by example 2. | 1277 | As root, install to / the distribution that was built by example 2. | |
1283 | Even though this is run as root, -U is required so that the | 1278 | Even though this is run as root, -U is required so that the | |
1284 | permissions stored in DESTDIR/METALOG are correctly applied to the | 1279 | permissions stored in DESTDIR/METALOG are correctly applied to the | |
1285 | files as they're copied to /. | 1280 | files as they're copied to /. | |
1286 | 1281 | |||
1287 | 4. % ./build.sh [OPTIONS] -U -u release | 1282 | 4. % ./build.sh [OPTIONS] -U -u release | |
1288 | 1283 | |||
1289 | Using unprivileged mode, build a complete release to DESTDIR and | 1284 | Using unprivileged mode, build a complete release to DESTDIR and | |
1290 | RELEASEDIR directories that build.sh selects (and will show). | 1285 | RELEASEDIR directories that build.sh selects (and will show). | |
1291 | MKUPDATE=yes (-u) is set to prevent the "make cleandir", so that if | 1286 | MKUPDATE=yes (-u) is set to prevent the "make cleandir", so that if | |
1292 | this is run after example 2, it doesn't need to redo that portion of | 1287 | this is run after example 2, it doesn't need to redo that portion of | |
1293 | the release build. | 1288 | the release build. | |
1294 | 1289 | |||
1295 | OBSOLETE VARIABLES | 1290 | OBSOLETE VARIABLES | |
1296 | NBUILDJOBS Use the make(1) option -j instead. | 1291 | NBUILDJOBS Use the build.sh and make(1) option -j instead. | |
1297 | 1292 | |||
1298 | USE_NEW_TOOLCHAIN | 1293 | USE_NEW_TOOLCHAIN | |
1299 | The new toolchain is now the default. To disable, use | 1294 | The new toolchain is now the default. To disable, use | |
1300 | TOOLCHAIN_MISSING=yes. | 1295 | TOOLCHAIN_MISSING=yes. | |
1301 | 1296 | |||
1302 | SEE ALSO | 1297 | SEE ALSO | |
1303 | ar(1), config(1), ctags(1), cvs(1), cvslatest(1), ex(1), g++(1), gzip(1), | 1298 | ar(1), config(1), ctags(1), cvs(1), cvslatest(1), ex(1), g++(1), gzip(1), | |
1304 | ident(1), ld(1), lint(1), make(1), mkisofs(1), sh(1), uname(1), vi(1), | 1299 | ident(1), ld(1), lint(1), make(1), mkisofs(1), sh(1), uname(1), vi(1), | |
1305 | options(4), mk.conf(5), atf(7), hier(7), release(7), sysctl(7), | 1300 | options(4), mk.conf(5), atf(7), hier(7), release(7), sysctl(7), | |
1306 | etcupdate(8), installboot(8), mount(8), mtree(8), postinstall(8), | 1301 | etcupdate(8), installboot(8), mount(8), mtree(8), postinstall(8), | |
1307 | sysinst(8), pkgsrc/sysutils/cdrtools | 1302 | sysinst(8), pkgsrc/sysutils/cdrtools | |
1308 | 1303 | |||
1309 | HISTORY | 1304 | HISTORY | |
1310 | The build.sh based build scheme was introduced for NetBSD 1.6 as | 1305 | The build.sh based build scheme was introduced for NetBSD 1.6 as | |
1311 | USE_NEW_TOOLCHAIN, and re-worked to TOOLCHAIN_MISSING after that. | 1306 | USE_NEW_TOOLCHAIN, and re-worked to TOOLCHAIN_MISSING after that. | |
1312 | 1307 | |||
1313 | CAVEATS | 1308 | CAVEATS | |
1314 | After significant updates to third-party components in the source tree, | 1309 | After significant updates to third-party components in the source tree, | |
1315 | the "make cleandir" operation may be insufficient to clean out old files | 1310 | the "make cleandir" operation may be insufficient to clean out old files | |
1316 | in object directories. Instead, one may have to manually remove the | 1311 | in object directories. Instead, one may have to manually remove the | |
1317 | files. Consult the UPDATING file for notices concerning this. | 1312 | files. Consult the UPDATING file for notices concerning this. | |
1318 | 1313 | |||
1319 | NetBSD June 5, 2023 NetBSD | 1314 | NetBSD June 10, 2023 NetBSD |
--- src/Makefile 2023/06/02 20:48:09 1.336
+++ src/Makefile 2023/06/11 10:43:51 1.337
@@ -1,540 +1,537 @@ | @@ -1,540 +1,537 @@ | |||
1 | # $NetBSD: Makefile,v 1.336 2023/06/02 20:48:09 lukem Exp $ | 1 | # $NetBSD: Makefile,v 1.337 2023/06/11 10:43:51 lukem Exp $ | |
2 | 2 | |||
3 | # | 3 | # | |
4 | # This is the top-level makefile for building NetBSD. For an outline of | 4 | # This is the top-level makefile for building NetBSD. For an outline of | |
5 | # how to build a snapshot or release, as well as other release engineering | 5 | # how to build a snapshot or release, as well as other release engineering | |
6 | # information, see http://www.NetBSD.org/developers/releng/index.html | 6 | # information, see http://www.NetBSD.org/developers/releng/index.html | |
7 | # | 7 | # | |
8 | # Not everything you can set or do is documented in this makefile. In | 8 | # Not everything you can set or do is documented in this makefile. In | |
9 | # particular, you should review the files in /usr/share/mk (especially | 9 | # particular, you should review the files in /usr/share/mk (especially | |
10 | # bsd.README) for general information on building programs and writing | 10 | # bsd.README) for general information on building programs and writing | |
11 | # Makefiles within this structure, and see the comments in src/etc/Makefile | 11 | # Makefiles within this structure, and see the comments in src/etc/Makefile | |
12 | # for further information on installation and release set options. | 12 | # for further information on installation and release set options. | |
13 | # | 13 | # | |
14 | # Variables listed below can be set on the make command line (highest | 14 | # Variables listed below can be set on the make command line (highest | |
15 | # priority), in /etc/mk.conf (middle priority), or in the environment | 15 | # priority), in /etc/mk.conf (middle priority), or in the environment | |
16 | # (lowest priority). | 16 | # (lowest priority). | |
17 | # | 17 | # | |
18 | # Variables: | 18 | # Variables: | |
19 | # DESTDIR is the target directory for installation of the compiled | 19 | # DESTDIR is the target directory for installation of the compiled | |
20 | # software. It defaults to /. Note that programs are built against | 20 | # software. It defaults to /. Note that programs are built against | |
21 | # libraries installed in DESTDIR. | 21 | # libraries installed in DESTDIR. | |
22 | # MKMAN, if `no', will prevent building of manual pages. | 22 | # MKMAN, if `no', will prevent building of manual pages. | |
23 | # MKOBJDIRS, if not `no', will build object directories at | 23 | # MKOBJDIRS, if not `no', will build object directories at | |
24 | # an appropriate point in a build. | 24 | # an appropriate point in a build. | |
25 | # MKSHARE, if `no', will prevent building and installing | 25 | # MKSHARE, if `no', will prevent building and installing | |
26 | # anything in /usr/share. | 26 | # anything in /usr/share. | |
27 | # MKUPDATE, if not `no', will avoid a `make cleandir' at the start of | 27 | # MKUPDATE, if not `no', will avoid a `make cleandir' at the start of | |
28 | # `make build', as well as having the effects listed in | 28 | # `make build', as well as having the effects listed in | |
29 | # /usr/share/mk/bsd.README. | 29 | # /usr/share/mk/bsd.README. | |
30 | # NOCLEANDIR, if defined, will avoid a `make cleandir' at the start | 30 | # NOCLEANDIR, if defined, will avoid a `make cleandir' at the start | |
31 | # of the `make build'. | 31 | # of the `make build'. | |
32 | # NOINCLUDES will avoid the `make includes' usually done by `make build'. | 32 | # NOINCLUDES will avoid the `make includes' usually done by `make build'. | |
33 | # NOBINARIES will not build binaries, only includes and libraries | 33 | # NOBINARIES will not build binaries, only includes and libraries | |
34 | # | 34 | # | |
35 | # See mk.conf(5) for more details. | 35 | # See mk.conf(5) for more details. | |
36 | # | 36 | # | |
37 | # | 37 | # | |
38 | # Targets: | 38 | # Targets: | |
39 | # build: | 39 | # build: | |
40 | # Builds a full release of NetBSD in DESTDIR, except for the | 40 | # Builds a full release of NetBSD in DESTDIR, except for the | |
41 | # /etc configuration files. | 41 | # /etc configuration files. | |
42 | # If BUILD_DONE is set, this is an empty target. | 42 | # If BUILD_DONE is set, this is an empty target. | |
43 | # distribution: | 43 | # distribution: | |
44 | # Builds a full release of NetBSD in DESTDIR, including the /etc | 44 | # Builds a full release of NetBSD in DESTDIR, including the /etc | |
45 | # configuration files. | 45 | # configuration files. | |
46 | # buildworld: | 46 | # buildworld: | |
47 | # As per `make distribution', except that it ensures that DESTDIR | 47 | # As per `make distribution', except that it ensures that DESTDIR | |
48 | # is not the root directory. | 48 | # is not the root directory. | |
49 | # installworld: | 49 | # installworld: | |
50 | # Install the distribution from DESTDIR to INSTALLWORLDDIR (which | 50 | # Install the distribution from DESTDIR to INSTALLWORLDDIR (which | |
51 | # defaults to the root directory). Ensures that INSTALLWORLDDIR | 51 | # defaults to the root directory). Ensures that INSTALLWORLDDIR | |
52 | # is not the root directory if cross compiling. | 52 | # is not the root directory if cross compiling. | |
53 | # release: | 53 | # release: | |
54 | # Does a `make distribution', and then tars up the DESTDIR files | 54 | # Does a `make distribution', and then tars up the DESTDIR files | |
55 | # into ${RELEASEDIR}/${RELEASEMACHINEDIR}, in release(7) format. | 55 | # into ${RELEASEDIR}/${RELEASEMACHINEDIR}, in release(7) format. | |
56 | # (See etc/Makefile for more information on this.) | 56 | # (See etc/Makefile for more information on this.) | |
57 | # regression-tests: | 57 | # regression-tests: | |
58 | # Runs the regression tests in "regress" on this host. | 58 | # Runs the regression tests in "regress" on this host. | |
59 | # sets: | 59 | # sets: | |
60 | # Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets | 60 | # Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/sets | |
61 | # from ${DESTDIR} | 61 | # from ${DESTDIR} | |
62 | # sourcesets: | 62 | # sourcesets: | |
63 | # Populate ${RELEASEDIR}/source/sets from ${NETBSDSRCDIR} | 63 | # Populate ${RELEASEDIR}/source/sets from ${NETBSDSRCDIR} | |
64 | # syspkgs: | 64 | # syspkgs: | |
65 | # Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/syspkgs | 65 | # Populate ${RELEASEDIR}/${RELEASEMACHINEDIR}/binary/syspkgs | |
66 | # from ${DESTDIR} | 66 | # from ${DESTDIR} | |
67 | # iso-image: | 67 | # iso-image: | |
68 | # Create CD-ROM image in RELEASEDIR/images. | 68 | # Create CD-ROM image in RELEASEDIR/images. | |
69 | # RELEASEDIR must already have been populated by `make release' | 69 | # RELEASEDIR must already have been populated by `make release' | |
70 | # or equivalent. | 70 | # or equivalent. | |
71 | # iso-image-source: | 71 | # iso-image-source: | |
72 | # Create CD-ROM image with source in RELEASEDIR/images. | 72 | # Create CD-ROM image with source in RELEASEDIR/images. | |
73 | # RELEASEDIR must already have been populated by | 73 | # RELEASEDIR must already have been populated by | |
74 | # `make release sourcesets' or equivalent. | 74 | # `make release sourcesets' or equivalent. | |
75 | # live-image: | 75 | # live-image: | |
76 | # Create bootable live image for emulators or USB stick etc. | 76 | # Create bootable live image for emulators or USB stick etc. | |
77 | # in RELEASEDIR/liveimage. | 77 | # in RELEASEDIR/liveimage. | |
78 | # RELEASEDIR must already have been populated by `make release' | 78 | # RELEASEDIR must already have been populated by `make release' | |
79 | # or equivalent. | 79 | # or equivalent. | |
80 | # install-image: | 80 | # install-image: | |
81 | # Create bootable installation image for USB stick etc. | 81 | # Create bootable installation image for USB stick etc. | |
82 | # in RELEASEDIR/installimage. | 82 | # in RELEASEDIR/installimage. | |
83 | # RELEASEDIR must already have been populated by `make release' | 83 | # RELEASEDIR must already have been populated by `make release' | |
84 | # or equivalent. | 84 | # or equivalent. | |
85 | # | 85 | # | |
86 | # Targets invoked by `make build,' in order: | 86 | # Targets invoked by `make build,' in order: | |
87 | # cleandir: cleans the tree. | 87 | # cleandir: cleans the tree. | |
88 | # do-top-obj: creates the top level object directory. | 88 | # do-top-obj: creates the top level object directory. | |
89 | # do-tools-obj: creates object directories for the host toolchain. | 89 | # do-tools-obj: creates object directories for the host toolchain. | |
90 | # do-tools: builds host toolchain. | 90 | # do-tools: builds host toolchain. | |
91 | # params: create params file with various make(1) parameters. | 91 | # params: create params file with various make(1) parameters. | |
92 | # show-params: show various make(1) parameters. | 92 | # show-params: show various make(1) parameters. | |
93 | # obj: creates object directories. | 93 | # obj: creates object directories. | |
94 | # do-distrib-dirs: creates the distribution directories. | 94 | # do-distrib-dirs: creates the distribution directories. | |
95 | # includes: installs include files. | 95 | # includes: installs include files. | |
96 | # do-lib: builds and installs prerequisites from lib. | 96 | # do-lib: builds and installs prerequisites from lib. | |
97 | # do-compat-lib: builds and installs prerequisites from compat/lib | 97 | # do-compat-lib: builds and installs prerequisites from compat/lib | |
98 | # if ${MKCOMPAT} != "no". | 98 | # if ${MKCOMPAT} != "no". | |
99 | # do-x11: builds and installs X11 tools and libraries | 99 | # do-x11: builds and installs X11 tools and libraries | |
100 | # from src/external/mit/xorg if ${MKX11} != "no". | 100 | # from src/external/mit/xorg if ${MKX11} != "no". | |
101 | # do-build: builds and installs the entire system. | 101 | # do-build: builds and installs the entire system. | |
102 | # do-obsolete: installs the obsolete sets (for the postinstall-* targets). | 102 | # do-obsolete: installs the obsolete sets (for the postinstall-* targets). | |
103 | # | 103 | # | |
104 | 104 | |||
105 | .if ${.MAKEFLAGS:M${.CURDIR}/share/mk} == "" | 105 | .if ${.MAKEFLAGS:M${.CURDIR}/share/mk} == "" | |
106 | .MAKEFLAGS: -m ${.CURDIR}/share/mk | 106 | .MAKEFLAGS: -m ${.CURDIR}/share/mk | |
107 | .endif | 107 | .endif | |
108 | 108 | |||
109 | # | 109 | # | |
110 | # If _SRC_TOP_OBJ_ gets set here, we will end up with a directory that may | 110 | # If _SRC_TOP_OBJ_ gets set here, we will end up with a directory that may | |
111 | # not be the top level objdir, because "make obj" can happen in the *middle* | 111 | # not be the top level objdir, because "make obj" can happen in the *middle* | |
112 | # of "make build" (long after <bsd.own.mk> is calculated it). So, pre-set | 112 | # of "make build" (long after <bsd.own.mk> is calculated it). So, pre-set | |
113 | # _SRC_TOP_OBJ_ here so it will not be added to ${.MAKEOVERRIDES}. | 113 | # _SRC_TOP_OBJ_ here so it will not be added to ${.MAKEOVERRIDES}. | |
114 | # | 114 | # | |
115 | _SRC_TOP_OBJ_= | 115 | _SRC_TOP_OBJ_= | |
116 | 116 | |||
117 | .include <bsd.own.mk> | 117 | .include <bsd.own.mk> | |
118 | 118 | |||
119 | # | 119 | # | |
120 | # Sanity check: make sure that "make build" is not invoked simultaneously | 120 | # Sanity check: make sure that "make build" is not invoked simultaneously | |
121 | # with a standard recursive target. | 121 | # with a standard recursive target. | |
122 | # | 122 | # | |
123 | 123 | |||
124 | .if make(build) || make(release) || make(snapshot) | 124 | .if make(build) || make(release) || make(snapshot) | |
125 | .for targ in ${TARGETS:Nobj:Ncleandir} | 125 | .for targ in ${TARGETS:Nobj:Ncleandir} | |
126 | .if make(${targ}) && !target(.BEGIN) | 126 | .if make(${targ}) && !target(.BEGIN) | |
127 | .BEGIN: | 127 | .BEGIN: | |
128 | @echo 'BUILD ABORTED: "make build" and "make ${targ}" are mutually exclusive.' | 128 | @echo 'BUILD ABORTED: "make build" and "make ${targ}" are mutually exclusive.' | |
129 | @false | 129 | @false | |
130 | .endif | 130 | .endif | |
131 | .endfor | 131 | .endfor | |
132 | .endif | 132 | .endif | |
133 | 133 | |||
134 | # | 134 | # | |
135 | # _SUBDIR is used to set SUBDIR, after removing directories that have | 135 | # _SUBDIR is used to set SUBDIR, after removing directories that have | |
136 | # BUILD_${dir}=no, or that have no ${dir}/Makefile. | 136 | # BUILD_${dir}=no, or that have no ${dir}/Makefile. | |
137 | # | 137 | # | |
138 | _SUBDIR= tools .WAIT lib | 138 | _SUBDIR= tools .WAIT lib | |
139 | .if ${MKLLVM} != "no" | 139 | .if ${MKLLVM} != "no" | |
140 | _SUBDIR+= external/bsd/compiler_rt | 140 | _SUBDIR+= external/bsd/compiler_rt | |
141 | .endif | 141 | .endif | |
142 | _SUBDIR+= include external crypto/external bin | 142 | _SUBDIR+= include external crypto/external bin | |
143 | _SUBDIR+= games libexec sbin usr.bin | 143 | _SUBDIR+= games libexec sbin usr.bin | |
144 | _SUBDIR+= usr.sbin share sys etc tests compat | 144 | _SUBDIR+= usr.sbin share sys etc tests compat | |
145 | _SUBDIR+= .WAIT rescue .WAIT distrib regress | 145 | _SUBDIR+= .WAIT rescue .WAIT distrib regress | |
146 | 146 | |||
147 | .for dir in ${_SUBDIR} | 147 | .for dir in ${_SUBDIR} | |
148 | .if "${dir}" == ".WAIT" \ | 148 | .if "${dir}" == ".WAIT" \ | |
149 | || (${BUILD_${dir}:Uyes} != "no" && exists(${dir}/Makefile)) | 149 | || (${BUILD_${dir}:Uyes} != "no" && exists(${dir}/Makefile)) | |
150 | SUBDIR+= ${dir} | 150 | SUBDIR+= ${dir} | |
151 | .endif | 151 | .endif | |
152 | .endfor | 152 | .endfor | |
153 | 153 | |||
154 | .if exists(regress) | 154 | .if exists(regress) | |
155 | regression-tests: .PHONY .MAKE | 155 | regression-tests: .PHONY .MAKE | |
156 | @echo Running regression tests... | 156 | @echo Running regression tests... | |
157 | ${MAKEDIRTARGET} regress regress | 157 | ${MAKEDIRTARGET} regress regress | |
158 | .endif | 158 | .endif | |
159 | 159 | |||
160 | .if ${MKUNPRIVED} != "no" | 160 | .if ${MKUNPRIVED} != "no" | |
161 | NOPOSTINSTALL= # defined | 161 | NOPOSTINSTALL= # defined | |
162 | .endif | 162 | .endif | |
163 | 163 | |||
164 | afterinstall: .PHONY .MAKE | 164 | afterinstall: .PHONY .MAKE | |
165 | .if ${MKMAN} != "no" | 165 | .if ${MKMAN} != "no" | |
166 | ${MAKEDIRTARGET} share/man makedb | 166 | ${MAKEDIRTARGET} share/man makedb | |
167 | .endif | 167 | .endif | |
168 | .if (${MKUNPRIVED} != "no" && ${MKINFO} != "no") | 168 | .if (${MKUNPRIVED} != "no" && ${MKINFO} != "no") | |
169 | ${MAKEDIRTARGET} external/gpl2/texinfo/bin/install-info infodir-meta | 169 | ${MAKEDIRTARGET} external/gpl2/texinfo/bin/install-info infodir-meta | |
170 | .endif | 170 | .endif | |
171 | .if !defined(NOPOSTINSTALL) | 171 | .if !defined(NOPOSTINSTALL) | |
172 | ${MAKEDIRTARGET} . postinstall-check | 172 | ${MAKEDIRTARGET} . postinstall-check | |
173 | .endif | 173 | .endif | |
174 | 174 | |||
175 | _POSTINSTALL= ${:!cd ${.CURDIR}/usr.sbin/postinstall && \ | 175 | _POSTINSTALL= ${:!cd ${.CURDIR}/usr.sbin/postinstall && \ | |
176 | ${MAKE} -v .OBJDIR!}/postinstall \ | 176 | ${MAKE} -v .OBJDIR!}/postinstall \ | |
177 | -m ${MACHINE} -a ${MACHINE_ARCH} | 177 | -m ${MACHINE} -a ${MACHINE_ARCH} | |
178 | _POSTINSTALL_ENV= \ | 178 | _POSTINSTALL_ENV= \ | |
179 | AWK=${TOOL_AWK:Q} \ | 179 | AWK=${TOOL_AWK:Q} \ | |
180 | DB=${TOOL_DB:Q} \ | 180 | DB=${TOOL_DB:Q} \ | |
181 | HOST_SH=${HOST_SH:Q} \ | 181 | HOST_SH=${HOST_SH:Q} \ | |
182 | MAKE=${MAKE:Q} \ | 182 | MAKE=${MAKE:Q} \ | |
183 | PWD_MKDB=${TOOL_PWD_MKDB:Q} \ | 183 | PWD_MKDB=${TOOL_PWD_MKDB:Q} \ | |
184 | SED=${TOOL_SED:Q} \ | 184 | SED=${TOOL_SED:Q} \ | |
185 | STAT=${TOOL_STAT:Q} | 185 | STAT=${TOOL_STAT:Q} | |
186 | 186 | |||
187 | .if ${MKX11} != "no" | 187 | .if ${MKX11} != "no" | |
188 | _POSTINSTALL_X11=-x ${X11SRCDIR:Q} | 188 | _POSTINSTALL_X11=-x ${X11SRCDIR:Q} | |
189 | .endif | 189 | .endif | |
190 | 190 | |||
191 | postinstall-check: .PHONY | 191 | postinstall-check: .PHONY | |
192 | @echo " === Post installation checks ===" | 192 | @echo " === Post installation checks ===" | |
193 | ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ check; if [ $$? -gt 1 ]; then exit 1; fi | 193 | ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ check; if [ $$? -gt 1 ]; then exit 1; fi | |
194 | @echo " ================================" | 194 | @echo " ================================" | |
195 | 195 | |||
196 | postinstall-fix: .NOTMAIN .PHONY | 196 | postinstall-fix: .NOTMAIN .PHONY | |
197 | @echo " === Post installation fixes ===" | 197 | @echo " === Post installation fixes ===" | |
198 | ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix | 198 | ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix | |
199 | @echo " ===============================" | 199 | @echo " ===============================" | |
200 | 200 | |||
201 | postinstall-fix-obsolete: .NOTMAIN .PHONY | 201 | postinstall-fix-obsolete: .NOTMAIN .PHONY | |
202 | @echo " === Removing obsolete files ===" | 202 | @echo " === Removing obsolete files ===" | |
203 | ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix obsolete | 203 | ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix obsolete | |
204 | @echo " ===============================" | 204 | @echo " ===============================" | |
205 | 205 | |||
206 | postinstall-fix-obsolete_stand: .NOTMAIN .PHONY | 206 | postinstall-fix-obsolete_stand: .NOTMAIN .PHONY | |
207 | @echo " === Removing obsolete files ===" | 207 | @echo " === Removing obsolete files ===" | |
208 | ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix obsolete_stand | 208 | ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix obsolete_stand | |
209 | ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix obsolete_stand_debug | 209 | ${_POSTINSTALL_ENV} ${HOST_SH} ${_POSTINSTALL} -s ${.CURDIR} ${_POSTINSTALL_X11} -d ${DESTDIR}/ fix obsolete_stand_debug | |
210 | @echo " ===============================" | 210 | @echo " ===============================" | |
211 | 211 | |||
212 | 212 | |||
213 | # | 213 | # | |
214 | # Targets (in order!) called by "make build". | 214 | # Targets (in order!) called by "make build". | |
215 | # | 215 | # | |
216 | BUILDTARGETS+= check-tools | 216 | BUILDTARGETS+= check-tools | |
217 | .if ${MKUPDATE} == "no" && !defined(NOCLEANDIR) | 217 | .if ${MKUPDATE} == "no" && !defined(NOCLEANDIR) | |
218 | BUILDTARGETS+= cleandir | 218 | BUILDTARGETS+= cleandir | |
219 | .endif | 219 | .endif | |
220 | .if ${MKOBJDIRS} != "no" | 220 | .if ${MKOBJDIRS} != "no" | |
221 | BUILDTARGETS+= do-top-obj | 221 | BUILDTARGETS+= do-top-obj | |
222 | .endif | 222 | .endif | |
223 | .if ${USETOOLS} == "yes" # { | 223 | .if ${USETOOLS} == "yes" # { | |
224 | .if ${MKOBJDIRS} != "no" | 224 | .if ${MKOBJDIRS} != "no" | |
225 | BUILDTARGETS+= do-tools-obj | 225 | BUILDTARGETS+= do-tools-obj | |
226 | .endif | 226 | .endif | |
227 | BUILDTARGETS+= do-tools | 227 | BUILDTARGETS+= do-tools | |
228 | .endif # USETOOLS # } | 228 | .endif # USETOOLS # } | |
229 | BUILDTARGETS+= params | 229 | BUILDTARGETS+= params | |
230 | .if ${MKOBJDIRS} != "no" | 230 | .if ${MKOBJDIRS} != "no" | |
231 | BUILDTARGETS+= obj | 231 | BUILDTARGETS+= obj | |
232 | .endif | 232 | .endif | |
233 | BUILDTARGETS+= clean_METALOG | 233 | BUILDTARGETS+= clean_METALOG | |
234 | .if !defined(NODISTRIBDIRS) | 234 | .if !defined(NODISTRIBDIRS) | |
235 | BUILDTARGETS+= do-distrib-dirs | 235 | BUILDTARGETS+= do-distrib-dirs | |
236 | .endif | 236 | .endif | |
237 | .if !defined(NOINCLUDES) | 237 | .if !defined(NOINCLUDES) | |
238 | BUILDTARGETS+= includes | 238 | BUILDTARGETS+= includes | |
239 | .endif | 239 | .endif | |
240 | BUILDTARGETS+= do-lib | 240 | BUILDTARGETS+= do-lib | |
241 | BUILDTARGETS+= do-compat-lib | 241 | BUILDTARGETS+= do-compat-lib | |
242 | .if ${MKLLVM} != "no" | 242 | .if ${MKLLVM} != "no" | |
243 | BUILDTARGETS+= do-sanitizer | 243 | BUILDTARGETS+= do-sanitizer | |
244 | .if ${MKSANITIZER:Uno} == "yes" | 244 | .if ${MKSANITIZER:Uno} == "yes" | |
245 | BUILDTARGETS+= do-sanitizer-tools | 245 | BUILDTARGETS+= do-sanitizer-tools | |
246 | .endif | 246 | .endif | |
247 | .endif | 247 | .endif | |
248 | .if ${MKX11} != "no" | 248 | .if ${MKX11} != "no" | |
249 | BUILDTARGETS+= do-x11 | 249 | BUILDTARGETS+= do-x11 | |
250 | .endif | 250 | .endif | |
251 | .if !defined(NOBINARIES) | 251 | .if !defined(NOBINARIES) | |
252 | BUILDTARGETS+= do-build | 252 | BUILDTARGETS+= do-build | |
253 | BUILDTARGETS+= do-obsolete | 253 | BUILDTARGETS+= do-obsolete | |
254 | .endif | 254 | .endif | |
255 | 255 | |||
256 | # | 256 | # | |
257 | # Enforce proper ordering of some rules. | 257 | # Enforce proper ordering of some rules. | |
258 | # | 258 | # | |
259 | 259 | |||
260 | .ORDER: ${BUILDTARGETS} | 260 | .ORDER: ${BUILDTARGETS} | |
261 | includes-lib: .PHONY includes-include includes-sys | 261 | includes-lib: .PHONY includes-include includes-sys | |
262 | 262 | |||
263 | # | 263 | # | |
264 | # Record the values of variables that might affect the build. | 264 | # Record the values of variables that might affect the build. | |
265 | # If no values have changed, avoid updating the timestamp | 265 | # If no values have changed, avoid updating the timestamp | |
266 | # of the params file. | 266 | # of the params file. | |
267 | # | 267 | # | |
268 | # This is referenced by _NETBSD_VERSION_DEPENDS in <bsd.own.mk>. | 268 | # This is referenced by _NETBSD_VERSION_DEPENDS in <bsd.own.mk>. | |
269 | # | 269 | # | |
270 | .include "${NETBSDSRCDIR}/etc/Makefile.params" | 270 | .include "${NETBSDSRCDIR}/etc/Makefile.params" | |
271 | CLEANDIRFILES+= params | 271 | CLEANDIRFILES+= params | |
272 | params: .EXEC | 272 | params: .EXEC | |
273 | ${_MKMSG_CREATE} params | 273 | ${_MKMSG_CREATE} params | |
274 | @${PRINT_PARAMS} >${.TARGET}.new | 274 | @${PRINT_PARAMS} >${.TARGET}.new | |
275 | @if cmp -s ${.TARGET}.new ${.TARGET} > /dev/null 2>&1; then \ | 275 | @if cmp -s ${.TARGET}.new ${.TARGET} > /dev/null 2>&1; then \ | |
276 | : "params is unchanged" ; \ | 276 | : "params is unchanged" ; \ | |
277 | rm ${.TARGET}.new ; \ | 277 | rm ${.TARGET}.new ; \ | |
278 | else \ | 278 | else \ | |
279 | : "params has changed or is new" ; \ | 279 | : "params has changed or is new" ; \ | |
280 | mv ${.TARGET}.new ${.TARGET} ; \ | 280 | mv ${.TARGET}.new ${.TARGET} ; \ | |
281 | fi | 281 | fi | |
282 | 282 | |||
283 | # | 283 | # | |
284 | # Display current make(1) parameters | 284 | # Display current make(1) parameters | |
285 | # | 285 | # | |
286 | show-params: .PHONY .MAKE | 286 | show-params: .PHONY .MAKE | |
287 | @${PRINT_PARAMS} | 287 | @${PRINT_PARAMS} | |
288 | 288 | |||
289 | # | 289 | # | |
290 | # Build the system and install into DESTDIR. | 290 | # Build the system and install into DESTDIR. | |
291 | # | 291 | # | |
292 | 292 | |||
293 | START_TIME!= date | 293 | START_TIME!= date | |
294 | 294 | |||
295 | build: .PHONY .MAKE | 295 | build: .PHONY .MAKE | |
296 | .if defined(BUILD_DONE) | 296 | .if defined(BUILD_DONE) | |
297 | @echo "Build already installed into ${DESTDIR}" | 297 | @echo "Build already installed into ${DESTDIR}" | |
298 | .else | 298 | .else | |
299 | @echo "Build started at: ${START_TIME}" | 299 | @echo "Build started at: ${START_TIME}" | |
300 | .for tgt in ${BUILDTARGETS} | 300 | .for tgt in ${BUILDTARGETS} | |
301 | ${MAKEDIRTARGET} . ${tgt} | 301 | ${MAKEDIRTARGET} . ${tgt} | |
302 | .endfor | 302 | .endfor | |
303 | ${MAKEDIRTARGET} etc install-etc-release | 303 | ${MAKEDIRTARGET} etc install-etc-release | |
304 | @echo "Build started at: ${START_TIME}" | 304 | @echo "Build started at: ${START_TIME}" | |
305 | @printf "Build finished at: " && date | 305 | @printf "Build finished at: " && date | |
306 | .endif | 306 | .endif | |
307 | 307 | |||
308 | # | 308 | # | |
309 | # Build a full distribution, but not a release (i.e. no sets into | 309 | # Build a full distribution, but not a release (i.e. no sets into | |
310 | # ${RELEASEDIR}). "buildworld" enforces a build to ${DESTDIR} != / | 310 | # ${RELEASEDIR}). "buildworld" enforces a build to ${DESTDIR} != / | |
311 | # | 311 | # | |
312 | 312 | |||
313 | distribution buildworld: .PHONY .MAKE | 313 | distribution buildworld: .PHONY .MAKE | |
314 | .if make(buildworld) && \ | 314 | .if make(buildworld) && \ | |
315 | (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/") | 315 | (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/") | |
316 | @echo "Won't make ${.TARGET} with DESTDIR=/" | 316 | @echo "Won't make ${.TARGET} with DESTDIR=/" | |
317 | @false | 317 | @false | |
318 | .endif | 318 | .endif | |
319 | ${MAKEDIRTARGET} . build NOPOSTINSTALL=1 | 319 | ${MAKEDIRTARGET} . build NOPOSTINSTALL=1 | |
320 | ${MAKEDIRTARGET} etc distribution INSTALL_DONE=1 | 320 | ${MAKEDIRTARGET} etc distribution INSTALL_DONE=1 | |
321 | .if defined(DESTDIR) && ${DESTDIR} != "" && ${DESTDIR} != "/" | 321 | .if defined(DESTDIR) && ${DESTDIR} != "" && ${DESTDIR} != "/" | |
322 | ${MAKEDIRTARGET} . postinstall-fix-obsolete | 322 | ${MAKEDIRTARGET} . postinstall-fix-obsolete | |
323 | ${MAKEDIRTARGET} . postinstall-fix-obsolete_stand | 323 | ${MAKEDIRTARGET} . postinstall-fix-obsolete_stand | |
324 | ${MAKEDIRTARGET} distrib/sets checkflist | 324 | ${MAKEDIRTARGET} distrib/sets checkflist | |
325 | .endif | 325 | .endif | |
326 | @echo "make ${.TARGET} started at: ${START_TIME}" | 326 | @echo "make ${.TARGET} started at: ${START_TIME}" | |
327 | @printf "make ${.TARGET} finished at: " && date | 327 | @printf "make ${.TARGET} finished at: " && date | |
328 | 328 | |||
329 | # | 329 | # | |
330 | # Install the distribution from $DESTDIR to $INSTALLWORLDDIR (defaults to `/') | 330 | # Install the distribution from $DESTDIR to $INSTALLWORLDDIR (defaults to `/') | |
331 | # If installing to /, ensures that the host's operating system is NetBSD and | 331 | # If installing to /, ensures that the host's operating system is NetBSD and | |
332 | # the host's `uname -m` == ${MACHINE}. | 332 | # the host's `uname -m` == ${MACHINE}. | |
333 | # | 333 | # | |
334 | 334 | |||
335 | HOST_UNAME_S!= uname -s | 335 | HOST_UNAME_S!= uname -s | |
336 | HOST_UNAME_M!= uname -m | 336 | HOST_UNAME_M!= uname -m | |
337 | 337 | |||
338 | installworld: .PHONY .MAKE | 338 | installworld: .PHONY .MAKE | |
339 | .if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/") | 339 | .if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/") | |
340 | @echo "Can't make ${.TARGET} to DESTDIR=/" | 340 | @echo "Can't make ${.TARGET} to DESTDIR=/" | |
341 | @false | 341 | @false | |
342 | .endif | 342 | .endif | |
343 | .if !defined(INSTALLWORLDDIR) || \ | 343 | .if !defined(INSTALLWORLDDIR) || \ | |
344 | ${INSTALLWORLDDIR} == "" || ${INSTALLWORLDDIR} == "/" | 344 | ${INSTALLWORLDDIR} == "" || ${INSTALLWORLDDIR} == "/" | |
345 | .if (${HOST_UNAME_S} != "NetBSD") | 345 | .if (${HOST_UNAME_S} != "NetBSD") | |
346 | @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLWORLDDIR=/" | 346 | @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLWORLDDIR=/" | |
347 | @false | 347 | @false | |
348 | .endif | 348 | .endif | |
349 | .if (${HOST_UNAME_M} != ${MACHINE}) | 349 | .if (${HOST_UNAME_M} != ${MACHINE}) | |
350 | @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLWORLDDIR=/" | 350 | @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLWORLDDIR=/" | |
351 | @false | 351 | @false | |
352 | .endif | 352 | .endif | |
353 | .endif | 353 | .endif | |
354 | ${MAKEDIRTARGET} distrib/sets installsets \ | 354 | ${MAKEDIRTARGET} distrib/sets installsets \ | |
355 | INSTALLDIR=${INSTALLWORLDDIR:U/} INSTALLSETS=${INSTALLSETS:Q} | 355 | INSTALLDIR=${INSTALLWORLDDIR:U/} INSTALLSETS=${INSTALLSETS:Q} | |
356 | ${MAKEDIRTARGET} . postinstall-check DESTDIR=${INSTALLWORLDDIR} | 356 | ${MAKEDIRTARGET} . postinstall-check DESTDIR=${INSTALLWORLDDIR} | |
357 | @echo "make ${.TARGET} started at: ${START_TIME}" | 357 | @echo "make ${.TARGET} started at: ${START_TIME}" | |
358 | @printf "make ${.TARGET} finished at: " && date | 358 | @printf "make ${.TARGET} finished at: " && date | |
359 | 359 | |||
360 | # | 360 | # | |
361 | # Install modules from $DESTDIR to $INSTALLMODULESDIR | 361 | # Install modules from $DESTDIR to $INSTALLMODULESDIR | |
362 | # | 362 | # | |
363 | installmodules: .PHONY .MAKE | 363 | installmodules: .PHONY .MAKE | |
364 | .if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/") | 364 | .if (!defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/") | |
365 | @echo "Can't make ${.TARGET} to DESTDIR=/" | 365 | @echo "Can't make ${.TARGET} to DESTDIR=/" | |
366 | @false | 366 | @false | |
367 | .endif | 367 | .endif | |
368 | .if !defined(INSTALLMODULESDIR) || \ | 368 | .if !defined(INSTALLMODULESDIR) || \ | |
369 | ${INSTALLMODULESDIR} == "" || ${INSTALLMODULESDIR} == "/" | 369 | ${INSTALLMODULESDIR} == "" || ${INSTALLMODULESDIR} == "/" | |
370 | .if (${HOST_UNAME_S} != "NetBSD") | 370 | .if (${HOST_UNAME_S} != "NetBSD") | |
371 | @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLMODULESDIR=/" | 371 | @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_S} to NetBSD with INSTALLMODULESDIR=/" | |
372 | @false | 372 | @false | |
373 | .endif | 373 | .endif | |
374 | .if (${HOST_UNAME_M} != ${MACHINE}) | 374 | .if (${HOST_UNAME_M} != ${MACHINE}) | |
375 | @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLMODULESDIR=/" | 375 | @echo "Won't cross-make ${.TARGET} from ${HOST_UNAME_M} to ${MACHINE} with INSTALLMODULESDIR=/" | |
376 | @false | 376 | @false | |
377 | .endif | 377 | .endif | |
378 | .endif | 378 | .endif | |
379 | ${MAKEDIRTARGET} sys/modules install DESTDIR=${INSTALLMODULESDIR:U/} | 379 | ${MAKEDIRTARGET} sys/modules install DESTDIR=${INSTALLMODULESDIR:U/} | |
380 | @echo "make ${.TARGET} started at: ${START_TIME}" | 380 | @echo "make ${.TARGET} started at: ${START_TIME}" | |
381 | @printf "make ${.TARGET} finished at: " && date | 381 | @printf "make ${.TARGET} finished at: " && date | |
382 | 382 | |||
383 | # | 383 | # | |
384 | # Create sets from $DESTDIR or $NETBSDSRCDIR into $RELEASEDIR | 384 | # Create sets from $DESTDIR or $NETBSDSRCDIR into $RELEASEDIR | |
385 | # | 385 | # | |
386 | 386 | |||
387 | .for tgt in sets sourcesets syspkgs | 387 | .for tgt in sets sourcesets syspkgs | |
388 | ${tgt}: .PHONY .MAKE | 388 | ${tgt}: .PHONY .MAKE | |
389 | ${MAKEDIRTARGET} distrib/sets ${tgt} | 389 | ${MAKEDIRTARGET} distrib/sets ${tgt} | |
390 | .endfor | 390 | .endfor | |
391 | 391 | |||
392 | # | 392 | # | |
393 | # Build a release or snapshot (implies "make distribution"). Note that | 393 | # Build a release or snapshot (implies "make distribution"). Note that | |
394 | # in this case, the set lists will be checked before the tar files | 394 | # in this case, the set lists will be checked before the tar files | |
395 | # are made. | 395 | # are made. | |
396 | # | 396 | # | |
397 | 397 | |||
398 | release snapshot: .PHONY .MAKE | 398 | release snapshot: .PHONY .MAKE | |
399 | ${MAKEDIRTARGET} . distribution | 399 | ${MAKEDIRTARGET} . distribution | |
400 | ${MAKEDIRTARGET} etc release DISTRIBUTION_DONE=1 | 400 | ${MAKEDIRTARGET} etc release DISTRIBUTION_DONE=1 | |
401 | @echo "make ${.TARGET} started at: ${START_TIME}" | 401 | @echo "make ${.TARGET} started at: ${START_TIME}" | |
402 | @printf "make ${.TARGET} finished at: " && date | 402 | @printf "make ${.TARGET} finished at: " && date | |
403 | 403 | |||
404 | # | 404 | # | |
405 | # Create a CD-ROM image. | 405 | # Create a CD-ROM image. | |
406 | # | 406 | # | |
407 | 407 | |||
408 | iso-image: .PHONY | 408 | iso-image: .PHONY | |
409 | ${MAKEDIRTARGET} distrib iso_image | 409 | ${MAKEDIRTARGET} distrib iso_image | |
410 | ${MAKEDIRTARGET} etc iso-image | 410 | ${MAKEDIRTARGET} etc iso-image | |
411 | @echo "make ${.TARGET} started at: ${START_TIME}" | 411 | @echo "make ${.TARGET} started at: ${START_TIME}" | |
412 | @printf "make ${.TARGET} finished at: " && date | 412 | @printf "make ${.TARGET} finished at: " && date | |
413 | 413 | |||
414 | iso-image-source: .PHONY | 414 | iso-image-source: .PHONY | |
415 | ${MAKEDIRTARGET} distrib iso_image CDSOURCE=true | 415 | ${MAKEDIRTARGET} distrib iso_image CDSOURCE=true | |
416 | ${MAKEDIRTARGET} etc iso-image | 416 | ${MAKEDIRTARGET} etc iso-image | |
417 | @echo "make ${.TARGET} started at: ${START_TIME}" | 417 | @echo "make ${.TARGET} started at: ${START_TIME}" | |
418 | @printf "make ${.TARGET} finished at: " && date | 418 | @printf "make ${.TARGET} finished at: " && date | |
419 | 419 | |||
420 | # | 420 | # | |
421 | # Create bootable live images. | 421 | # Create bootable live images. | |
422 | # | 422 | # | |
423 | 423 | |||
424 | live-image: .PHONY | 424 | live-image: .PHONY | |
425 | ${MAKEDIRTARGET} etc live-image | 425 | ${MAKEDIRTARGET} etc live-image | |
426 | @echo "make ${.TARGET} started at: ${START_TIME}" | 426 | @echo "make ${.TARGET} started at: ${START_TIME}" | |
427 | @printf "make ${.TARGET} finished at: " && date | 427 | @printf "make ${.TARGET} finished at: " && date | |
428 | 428 | |||
429 | # | 429 | # | |
430 | # Create bootable installation images. | 430 | # Create bootable installation images. | |
431 | # | 431 | # | |
432 | 432 | |||
433 | install-image: .PHONY | 433 | install-image: .PHONY | |
434 | ${MAKEDIRTARGET} etc install-image | 434 | ${MAKEDIRTARGET} etc install-image | |
435 | @echo "make ${.TARGET} started at: ${START_TIME}" | 435 | @echo "make ${.TARGET} started at: ${START_TIME}" | |
436 | @printf "make ${.TARGET} finished at: " && date | 436 | @printf "make ${.TARGET} finished at: " && date | |
437 | 437 | |||
438 | # | 438 | # | |
439 | # Special components of the "make build" process. | 439 | # Special components of the "make build" process. | |
440 | # | 440 | # | |
441 | 441 | |||
442 | check-tools: .PHONY | 442 | check-tools: .PHONY | |
443 | .if ${TOOLCHAIN_MISSING} != "no" && !defined(EXTERNAL_TOOLCHAIN) | 443 | .if ${TOOLCHAIN_MISSING} != "no" && !defined(EXTERNAL_TOOLCHAIN) | |
444 | @echo '*** WARNING: Building on MACHINE=${MACHINE} with missing toolchain.' | 444 | @echo '*** WARNING: Building on MACHINE=${MACHINE} with missing toolchain.' | |
445 | @echo '*** May result in a failed build or corrupt binaries!' | 445 | @echo '*** May result in a failed build or corrupt binaries!' | |
446 | .elif defined(EXTERNAL_TOOLCHAIN) | 446 | .elif defined(EXTERNAL_TOOLCHAIN) | |
447 | @echo '*** Using external toolchain rooted at ${EXTERNAL_TOOLCHAIN}.' | 447 | @echo '*** Using external toolchain rooted at ${EXTERNAL_TOOLCHAIN}.' | |
448 | .endif | 448 | .endif | |
449 | .if defined(NBUILDJOBS) | |||
450 | @echo '*** WARNING: NBUILDJOBS is obsolete; use -j directly instead!' | |||
451 | .endif | |||
452 | 449 | |||
453 | # Delete or sanitise a leftover METALOG from a previous build. | 450 | # Delete or sanitise a leftover METALOG from a previous build. | |
454 | clean_METALOG: .PHONY .MAKE | 451 | clean_METALOG: .PHONY .MAKE | |
455 | .if ${MKUPDATE} != "no" | 452 | .if ${MKUPDATE} != "no" | |
456 | ${MAKEDIRTARGET} distrib/sets clean_METALOG | 453 | ${MAKEDIRTARGET} distrib/sets clean_METALOG | |
457 | .endif | 454 | .endif | |
458 | 455 | |||
459 | do-distrib-dirs: .PHONY .MAKE | 456 | do-distrib-dirs: .PHONY .MAKE | |
460 | .if !defined(DESTDIR) || ${DESTDIR} == "" | 457 | .if !defined(DESTDIR) || ${DESTDIR} == "" | |
461 | ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=/ | 458 | ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=/ | |
462 | .else | 459 | .else | |
463 | ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=${DESTDIR} | 460 | ${MAKEDIRTARGET} etc distrib-dirs DESTDIR=${DESTDIR} | |
464 | .endif | 461 | .endif | |
465 | 462 | |||
466 | .for targ in cleandir obj includes | 463 | .for targ in cleandir obj includes | |
467 | do-${targ}: .PHONY ${targ} | 464 | do-${targ}: .PHONY ${targ} | |
468 | @true | 465 | @true | |
469 | .endfor | 466 | .endfor | |
470 | 467 | |||
471 | do-tools: .PHONY .MAKE | 468 | do-tools: .PHONY .MAKE | |
472 | ${MAKEDIRTARGET} tools build_install | 469 | ${MAKEDIRTARGET} tools build_install | |
473 | 470 | |||
474 | do-lib: .PHONY .MAKE | 471 | do-lib: .PHONY .MAKE | |
475 | ${MAKEDIRTARGET} lib build_install | 472 | ${MAKEDIRTARGET} lib build_install | |
476 | 473 | |||
477 | do-compat-lib: .PHONY .MAKE | 474 | do-compat-lib: .PHONY .MAKE | |
478 | ${MAKEDIRTARGET} compat build_install BOOTSTRAP_SUBDIRS="../../../lib" | 475 | ${MAKEDIRTARGET} compat build_install BOOTSTRAP_SUBDIRS="../../../lib" | |
479 | 476 | |||
480 | do-sanitizer: .PHONY .MAKE | 477 | do-sanitizer: .PHONY .MAKE | |
481 | ${MAKEDIRTARGET} external/bsd/compiler_rt build_install | 478 | ${MAKEDIRTARGET} external/bsd/compiler_rt build_install | |
482 | 479 | |||
483 | do-sanitizer-tools: .PHONY .MAKE | 480 | do-sanitizer-tools: .PHONY .MAKE | |
484 | .if !exists(${TOOLDIR}/lib/clang) && ${HAVE_LLVM:Uno} == "yes" | 481 | .if !exists(${TOOLDIR}/lib/clang) && ${HAVE_LLVM:Uno} == "yes" | |
485 | mkdir -p ${TOOLDIR}/lib/clang | 482 | mkdir -p ${TOOLDIR}/lib/clang | |
486 | cd ${DESTDIR}/usr/lib/clang && \ | 483 | cd ${DESTDIR}/usr/lib/clang && \ | |
487 | ${TOOL_PAX} -rw . ${TOOLDIR}/lib/clang | 484 | ${TOOL_PAX} -rw . ${TOOLDIR}/lib/clang | |
488 | .endif | 485 | .endif | |
489 | 486 | |||
490 | do-top-obj: .PHONY .MAKE | 487 | do-top-obj: .PHONY .MAKE | |
491 | ${MAKEDIRTARGET} . obj NOSUBDIR= | 488 | ${MAKEDIRTARGET} . obj NOSUBDIR= | |
492 | 489 | |||
493 | do-tools-obj: .PHONY .MAKE | 490 | do-tools-obj: .PHONY .MAKE | |
494 | ${MAKEDIRTARGET} tools obj | 491 | ${MAKEDIRTARGET} tools obj | |
495 | 492 | |||
496 | do-build: .PHONY .MAKE | 493 | do-build: .PHONY .MAKE | |
497 | .for targ in dependall install | 494 | .for targ in dependall install | |
498 | ${MAKEDIRTARGET} . ${targ} BUILD_tools=no BUILD_lib=no | 495 | ${MAKEDIRTARGET} . ${targ} BUILD_tools=no BUILD_lib=no | |
499 | .endfor | 496 | .endfor | |
500 | 497 | |||
501 | do-x11: .PHONY .MAKE | 498 | do-x11: .PHONY .MAKE | |
502 | .if ${MKX11} != "no" | 499 | .if ${MKX11} != "no" | |
503 | ${MAKEDIRTARGET} external/mit/xorg/tools all | 500 | ${MAKEDIRTARGET} external/mit/xorg/tools all | |
504 | ${MAKEDIRTARGET} external/mit/xorg/lib build_install | 501 | ${MAKEDIRTARGET} external/mit/xorg/lib build_install | |
505 | .if ${MKCOMPATX11} != "no" | 502 | .if ${MKCOMPATX11} != "no" | |
506 | ${MAKEDIRTARGET} compat build_install BOOTSTRAP_SUBDIRS="../../../external/mit/xorg/lib" | 503 | ${MAKEDIRTARGET} compat build_install BOOTSTRAP_SUBDIRS="../../../external/mit/xorg/lib" | |
507 | .endif | 504 | .endif | |
508 | .else | 505 | .else | |
509 | @echo "MKX11 is not enabled" | 506 | @echo "MKX11 is not enabled" | |
510 | @false | 507 | @false | |
511 | .endif | 508 | .endif | |
512 | 509 | |||
513 | do-obsolete: .PHONY .MAKE | 510 | do-obsolete: .PHONY .MAKE | |
514 | ${MAKEDIRTARGET} etc install-obsolete-lists | 511 | ${MAKEDIRTARGET} etc install-obsolete-lists | |
515 | 512 | |||
516 | # | 513 | # | |
517 | # Speedup stubs for some subtrees that don't need to run these rules. | 514 | # Speedup stubs for some subtrees that don't need to run these rules. | |
518 | # (Tells <bsd.subdir.mk> not to recurse for them.) | 515 | # (Tells <bsd.subdir.mk> not to recurse for them.) | |
519 | # | 516 | # | |
520 | 517 | |||
521 | .for dir in bin etc distrib games libexec regress sbin usr.bin usr.sbin tools | 518 | .for dir in bin etc distrib games libexec regress sbin usr.bin usr.sbin tools | |
522 | includes-${dir}: .PHONY | 519 | includes-${dir}: .PHONY | |
523 | @true | 520 | @true | |
524 | .endfor | 521 | .endfor | |
525 | .for dir in etc distrib regress | 522 | .for dir in etc distrib regress | |
526 | install-${dir}: .PHONY | 523 | install-${dir}: .PHONY | |
527 | @true | 524 | @true | |
528 | .endfor | 525 | .endfor | |
529 | 526 | |||
530 | # | 527 | # | |
531 | # XXX this needs to change when distrib Makefiles are recursion compliant | 528 | # XXX this needs to change when distrib Makefiles are recursion compliant | |
532 | # XXX many distrib subdirs need "cd etc && make snap_pre snap_kern" first... | 529 | # XXX many distrib subdirs need "cd etc && make snap_pre snap_kern" first... | |
533 | # | 530 | # | |
534 | dependall-distrib depend-distrib all-distrib: .PHONY | 531 | dependall-distrib depend-distrib all-distrib: .PHONY | |
535 | @true | 532 | @true | |
536 | 533 | |||
537 | .include <bsd.obj.mk> | 534 | .include <bsd.obj.mk> | |
538 | .include <bsd.kernobj.mk> | 535 | .include <bsd.kernobj.mk> | |
539 | .include <bsd.subdir.mk> | 536 | .include <bsd.subdir.mk> | |
540 | .include <bsd.clean.mk> | 537 | .include <bsd.clean.mk> |
--- src/doc/BUILDING.mdoc 2023/06/05 22:36:17 1.141
+++ src/doc/BUILDING.mdoc 2023/06/11 10:43:51 1.142
@@ -1,2498 +1,2490 @@ | @@ -1,2498 +1,2490 @@ | |||
1 | .\" $NetBSD: BUILDING.mdoc,v 1.141 2023/06/05 22:36:17 lukem Exp $ | 1 | .\" $NetBSD: BUILDING.mdoc,v 1.142 2023/06/11 10:43:51 lukem Exp $ | |
2 | .\" | 2 | .\" | |
3 | .\" Copyright (c) 2001-2023 The NetBSD Foundation, Inc. | 3 | .\" Copyright (c) 2001-2023 The NetBSD Foundation, Inc. | |
4 | .\" All rights reserved. | 4 | .\" All rights reserved. | |
5 | .\" | 5 | .\" | |
6 | .\" This code is derived from software contributed to The NetBSD Foundation | 6 | .\" This code is derived from software contributed to The NetBSD Foundation | |
7 | .\" by Todd Vierling and Luke Mewburn. | 7 | .\" by Todd Vierling and Luke Mewburn. | |
8 | .\" | 8 | .\" | |
9 | .\" Redistribution and use in source and binary forms, with or without | 9 | .\" Redistribution and use in source and binary forms, with or without | |
10 | .\" modification, are permitted provided that the following conditions | 10 | .\" modification, are permitted provided that the following conditions | |
11 | .\" are met: | 11 | .\" are met: | |
12 | .\" 1. Redistributions of source code must retain the above copyright | 12 | .\" 1. Redistributions of source code must retain the above copyright | |
13 | .\" notice, this list of conditions and the following disclaimer. | 13 | .\" notice, this list of conditions and the following disclaimer. | |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | 14 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
15 | .\" notice, this list of conditions and the following disclaimer in the | 15 | .\" notice, this list of conditions and the following disclaimer in the | |
16 | .\" documentation and/or other materials provided with the distribution. | 16 | .\" documentation and/or other materials provided with the distribution. | |
17 | .\" | 17 | .\" | |
18 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | 18 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |
19 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 19 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
20 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 20 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 21 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
24 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 24 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 25 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 26 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 27 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
28 | .\" POSSIBILITY OF SUCH DAMAGE. | 28 | .\" POSSIBILITY OF SUCH DAMAGE. | |
29 | .\" | 29 | .\" | |
30 | .\" NOTE: After changing this file, run "make regen" in the src/doc | 30 | .\" NOTE: After changing this file, run "make regen" in the src/doc | |
31 | .\" directory, and check in both src/BUILDING and src/doc/BUILDING.mdoc. | 31 | .\" directory, and check in both src/BUILDING and src/doc/BUILDING.mdoc. | |
32 | .\" | 32 | .\" | |
33 | .\" Toolchain prefix for commands | 33 | .\" Toolchain prefix for commands | |
34 | .ds toolprefix nb | 34 | .ds toolprefix nb | |
35 | . | 35 | . | |
36 | .Dd June 5, 2023 | 36 | .Dd June 10, 2023 | |
37 | .Dt BUILDING 8 | 37 | .Dt BUILDING 8 | |
38 | .Os NetBSD | 38 | .Os NetBSD | |
39 | .\" turn off hyphenation | 39 | .\" turn off hyphenation | |
40 | .hym 999 | 40 | .hym 999 | |
41 | . | 41 | . | |
42 | .\" if this file is processed with real roff (doc.tmac) | 42 | .\" if this file is processed with real roff (doc.tmac) | |
43 | .\" now that the tmac files have been lazily read, | 43 | .\" now that the tmac files have been lazily read, | |
44 | .\" we can override ``quotes'' with "quotes" for ascii output | 44 | .\" we can override ``quotes'' with "quotes" for ascii output | |
45 | .ie '\*[Lq]'``' \{\ | 45 | .ie '\*[Lq]'``' \{\ | |
46 | .ds Lq \*q | 46 | .ds Lq \*q | |
47 | .ds Rq \*q | 47 | .ds Rq \*q | |
48 | .\} | 48 | .\} | |
49 | .\" and disable hyphenation | 49 | .\" and disable hyphenation | |
50 | .nr hyphen-flags 0 | 50 | .nr hyphen-flags 0 | |
51 | . | 51 | . | |
52 | .Sh NAME | 52 | .Sh NAME | |
53 | . | 53 | . | |
54 | .Nm BUILDING | 54 | .Nm BUILDING | |
55 | .Nd Procedure for building | 55 | .Nd Procedure for building | |
56 | .Nx | 56 | .Nx | |
57 | from source code | 57 | from source code | |
58 | . | 58 | . | |
59 | .Sh REQUIREMENTS | 59 | .Sh REQUIREMENTS | |
60 | . | 60 | . | |
61 | .Nx | 61 | .Nx | |
62 | is designed to be buildable on most POSIX-compliant host systems. | 62 | is designed to be buildable on most POSIX-compliant host systems. | |
63 | The basic build procedure is the same whether compiling | 63 | The basic build procedure is the same whether compiling | |
64 | .Em natively | 64 | .Em natively | |
65 | (on the same | 65 | (on the same | |
66 | .Nx | 66 | .Nx | |
67 | architecture) or | 67 | architecture) or | |
68 | .Em cross compiling | 68 | .Em cross compiling | |
69 | (on another architecture or OS). | 69 | (on another architecture or OS). | |
70 | .Pp | 70 | .Pp | |
71 | This source tree contains a special subtree, | 71 | This source tree contains a special subtree, | |
72 | .Dq tools , | 72 | .Dq tools , | |
73 | which uses the host system to create a build toolchain for the target | 73 | which uses the host system to create a build toolchain for the target | |
74 | architecture. | 74 | architecture. | |
75 | The host system must have at least C and C++ | 75 | The host system must have at least C and C++ | |
76 | compilers in order to create the toolchain | 76 | compilers in order to create the toolchain | |
77 | .Nm ( make | 77 | .Nm ( make | |
78 | is not required); all other tools are created as part of the | 78 | is not required); all other tools are created as part of the | |
79 | .Nx | 79 | .Nx | |
80 | build process. | 80 | build process. | |
81 | (See the | 81 | (See the | |
82 | .Sx Environment variables | 82 | .Sx Environment variables | |
83 | section below if you need | 83 | section below if you need | |
84 | to override or manually select your compilers.) | 84 | to override or manually select your compilers.) | |
85 | . | 85 | . | |
86 | .Sh FILES | 86 | .Sh FILES | |
87 | . | 87 | . | |
88 | .Ss Source tree layout | 88 | .Ss Source tree layout | |
89 | . | 89 | . | |
90 | .Bl -tag -width "BUILDING.mdoc" | 90 | .Bl -tag -width "BUILDING.mdoc" | |
91 | . | 91 | . | |
92 | .It Pa BUILDING | 92 | .It Pa BUILDING | |
93 | This document (in plaintext). | 93 | This document (in plaintext). | |
94 | Generated from | 94 | Generated from | |
95 | .Pa doc/BUILDING.mdoc . | 95 | .Pa doc/BUILDING.mdoc . | |
96 | . | 96 | . | |
97 | .It Pa Makefile | 97 | .It Pa Makefile | |
98 | The main Makefile for | 98 | The main Makefile for | |
99 | .Nx ; | 99 | .Nx ; | |
100 | should only be run for native builds with an appropriately up-to-date | 100 | should only be run for native builds with an appropriately up-to-date | |
101 | version of | 101 | version of | |
102 | .Nx | 102 | .Nx | |
103 | .Xr make 1 . | 103 | .Xr make 1 . | |
104 | Intended for expert use with knowledge of its shortcomings, | 104 | Intended for expert use with knowledge of its shortcomings, | |
105 | it has been superseded by the | 105 | it has been superseded by the | |
106 | .Nm build.sh | 106 | .Nm build.sh | |
107 | shell script as the recommended means for building | 107 | shell script as the recommended means for building | |
108 | .Nx . | 108 | .Nx . | |
109 | . | 109 | . | |
110 | .It Pa UPDATING | 110 | .It Pa UPDATING | |
111 | Special notes for updating from an earlier revision of | 111 | Special notes for updating from an earlier revision of | |
112 | .Nx . | 112 | .Nx . | |
113 | It is important to read this file before every build of an updated | 113 | It is important to read this file before every build of an updated | |
114 | source tree. | 114 | source tree. | |
115 | . | 115 | . | |
116 | .It Pa build.sh | 116 | .It Pa build.sh | |
117 | Bourne-compatible shell script used for building the host build tools | 117 | Bourne-compatible shell script used for building the host build tools | |
118 | and the | 118 | and the | |
119 | .Nx | 119 | .Nx | |
120 | system from scratch. | 120 | system from scratch. | |
121 | Can be used for both native and cross builds, and should be used instead of | 121 | Can be used for both native and cross builds, and should be used instead of | |
122 | .Xr make 1 | 122 | .Xr make 1 | |
123 | as it performs additional checks to prevent common issues going undetected, such | 123 | as it performs additional checks to prevent common issues going undetected, such | |
124 | as building with an outdated version of | 124 | as building with an outdated version of | |
125 | .Xr make 1 . | 125 | .Xr make 1 . | |
126 | . | 126 | . | |
127 | .It Pa crypto/dist/ , dist/ , gnu/dist/ | 127 | .It Pa crypto/dist/ , dist/ , gnu/dist/ | |
128 | Sources imported verbatim from third parties, without mangling the | 128 | Sources imported verbatim from third parties, without mangling the | |
129 | existing build structure. | 129 | existing build structure. | |
130 | Other source trees in | 130 | Other source trees in | |
131 | .Sy bin | 131 | .Sy bin | |
132 | through | 132 | through | |
133 | .Sy usr.sbin | 133 | .Sy usr.sbin | |
134 | use the | 134 | use the | |
135 | .Nx | 135 | .Nx | |
136 | .Xr make 1 | 136 | .Xr make 1 | |
137 | .Dq reachover | 137 | .Dq reachover | |
138 | Makefile semantics when building these programs for a native host. | 138 | Makefile semantics when building these programs for a native host. | |
139 | . | 139 | . | |
140 | .It Pa distrib/ , etc/ | 140 | .It Pa distrib/ , etc/ | |
141 | Sources for items used when making a full release snapshot, such as | 141 | Sources for items used when making a full release snapshot, such as | |
142 | files installed in | 142 | files installed in | |
143 | .Sy DESTDIR Ns Pa /etc | 143 | .Sy DESTDIR Ns Pa /etc | |
144 | on the destination system, boot media, and release notes. | 144 | on the destination system, boot media, and release notes. | |
145 | . | 145 | . | |
146 | .It Pa doc/BUILDING.mdoc | 146 | .It Pa doc/BUILDING.mdoc | |
147 | This document, in -mdoc troff format; the original copy. | 147 | This document, in -mdoc troff format; the original copy. | |
148 | Used to generate | 148 | Used to generate | |
149 | .Pa BUILDING . | 149 | .Pa BUILDING . | |
150 | . | 150 | . | |
151 | .It Pa external , sys/external | 151 | .It Pa external , sys/external | |
152 | Sources and build infrastructure for components imported (mostly) unchanged | 152 | Sources and build infrastructure for components imported (mostly) unchanged | |
153 | from upstream maintainers, sorted by applicable license. | 153 | from upstream maintainers, sorted by applicable license. | |
154 | This is (slowly) replacing the | 154 | This is (slowly) replacing the | |
155 | .Pa crypto/dist , | 155 | .Pa crypto/dist , | |
156 | .Pa dist , | 156 | .Pa dist , | |
157 | and | 157 | and | |
158 | .Pa gnu/dist | 158 | .Pa gnu/dist | |
159 | directories. | 159 | directories. | |
160 | . | 160 | . | |
161 | .It Pa external/mit/xorg/ | 161 | .It Pa external/mit/xorg/ | |
162 | .Dq Reachover | 162 | .Dq Reachover | |
163 | build structure for modular Xorg; the source is in | 163 | build structure for modular Xorg; the source is in | |
164 | .Sy X11SRCDIR . | 164 | .Sy X11SRCDIR . | |
165 | . | 165 | . | |
166 | .It Pa regress/ , tests/ | 166 | .It Pa regress/ , tests/ | |
167 | Regression test harness. | 167 | Regression test harness. | |
168 | Can be cross-compiled, but only run natively. | 168 | Can be cross-compiled, but only run natively. | |
169 | .Pa tests/ | 169 | .Pa tests/ | |
170 | uses the | 170 | uses the | |
171 | .Xr atf 7 | 171 | .Xr atf 7 | |
172 | test framework; | 172 | test framework; | |
173 | .Pa regress/ | 173 | .Pa regress/ | |
174 | contains older tests that have not yet been migrated to | 174 | contains older tests that have not yet been migrated to | |
175 | .Xr atf 7 . | 175 | .Xr atf 7 . | |
176 | . | 176 | . | |
177 | .It Pa sys/ | 177 | .It Pa sys/ | |
178 | .Nx | 178 | .Nx | |
179 | kernel sources. | 179 | kernel sources. | |
180 | . | 180 | . | |
181 | .It Pa tools/ | 181 | .It Pa tools/ | |
182 | .Dq Reachover | 182 | .Dq Reachover | |
183 | build structure for the host build tools. | 183 | build structure for the host build tools. | |
184 | This has a special method of determining out-of-date status. | 184 | This has a special method of determining out-of-date status. | |
185 | . | 185 | . | |
186 | .It Pa tools/compat/README | 186 | .It Pa tools/compat/README | |
187 | Special notes for cross-hosting a NetBSD build on non-NetBSD platforms. | 187 | Special notes for cross-hosting a NetBSD build on non-NetBSD platforms. | |
188 | . | 188 | . | |
189 | .It Other directories including Pa bin/ ... usr.sbin/ | 189 | .It Other directories including Pa bin/ ... usr.sbin/ | |
190 | Sources to the | 190 | Sources to the | |
191 | .Nx | 191 | .Nx | |
192 | userland (non-kernel) programs. | 192 | userland (non-kernel) programs. | |
193 | If any of these directories are missing, they will be skipped during the build. | 193 | If any of these directories are missing, they will be skipped during the build. | |
194 | . | 194 | . | |
195 | .El | 195 | .El | |
196 | . | 196 | . | |
197 | .Ss Build tree layout | 197 | .Ss Build tree layout | |
198 | . | 198 | . | |
199 | The | 199 | The | |
200 | .Nx | 200 | .Nx | |
201 | build tree is described in | 201 | build tree is described in | |
202 | .Xr hier 7 , | 202 | .Xr hier 7 , | |
203 | and the release layout is described in | 203 | and the release layout is described in | |
204 | .Xr release 7 . | 204 | .Xr release 7 . | |
205 | . | 205 | . | |
206 | .Sh CONFIGURATION | 206 | .Sh CONFIGURATION | |
207 | . | 207 | . | |
208 | .Ss Environment variables | 208 | .Ss Environment variables | |
209 | . | 209 | . | |
210 | .de DFLT | 210 | .de DFLT | |
211 | .Pp | 211 | .Pp | |
212 | .Em Default : | 212 | .Em Default : | |
213 | .. | 213 | .. | |
214 | .de DFLTn | 214 | .de DFLTn | |
215 | .DFLT | 215 | .DFLT | |
216 | .Dq no | 216 | .Dq no | |
217 | .. | 217 | .. | |
218 | .de DFLTu | 218 | .de DFLTu | |
219 | .DFLT | 219 | .DFLT | |
220 | Unset. | 220 | Unset. | |
221 | .. | 221 | .. | |
222 | .de DFLTy | 222 | .de DFLTy | |
223 | .DFLT | 223 | .DFLT | |
224 | .Dq yes | 224 | .Dq yes | |
225 | .. | 225 | .. | |
226 | .de NODEF | 226 | .de NODEF | |
227 | .Pp | 227 | .Pp | |
228 | Forced to | 228 | Forced to | |
229 | .Dq no | 229 | .Dq no | |
230 | if | 230 | if | |
231 | .Sy \\$* | 231 | .Sy \\$* | |
232 | is defined, | 232 | is defined, | |
233 | usually in the Makefile before any | 233 | usually in the Makefile before any | |
234 | .Xr make 1 | 234 | .Xr make 1 | |
235 | .Cm \&.include | 235 | .Cm \&.include | |
236 | directives. | 236 | directives. | |
237 | .. | 237 | .. | |
238 | .de NOVAR | 238 | .de NOVAR | |
239 | .Pp | 239 | .Pp | |
240 | Forced to | 240 | Forced to | |
241 | .Dq no | 241 | .Dq no | |
242 | if | 242 | if | |
243 | .Sy \\$* . | 243 | .Sy \\$* . | |
244 | .. | 244 | .. | |
245 | .de YorN | 245 | .de YorN | |
246 | Can be set to | 246 | Can be set to | |
247 | .Dq yes | 247 | .Dq yes | |
248 | or | 248 | or | |
249 | .Dq no . | 249 | .Dq no . | |
250 | .. | 250 | .. | |
251 | . | 251 | . | |
252 | Several environment variables control the behaviour of | 252 | Several environment variables control the behaviour of | |
253 | .Nx | 253 | .Nx | |
254 | builds. | 254 | builds. | |
255 | . | 255 | . | |
256 | .Bl -tag -width 14n | 256 | .Bl -tag -width 14n | |
257 | . | 257 | . | |
258 | .\" These entries are sorted alphabetically. | 258 | .\" These entries are sorted alphabetically. | |
259 | . | 259 | . | |
260 | .It Sy HOST_CC | 260 | .It Sy HOST_CC | |
261 | Path name to C compiler used to create the toolchain. | 261 | Path name to C compiler used to create the toolchain. | |
262 | . | 262 | . | |
263 | .It Sy HOST_CFLAGS | 263 | .It Sy HOST_CFLAGS | |
264 | Flags passed to the host C compiler. | 264 | Flags passed to the host C compiler. | |
265 | . | 265 | . | |
266 | .It Sy HOST_CXX | 266 | .It Sy HOST_CXX | |
267 | Path name to C++ compiler used to create the toolchain. | 267 | Path name to C++ compiler used to create the toolchain. | |
268 | . | 268 | . | |
269 | .It Sy HOST_CXXFLAGS | 269 | .It Sy HOST_CXXFLAGS | |
270 | Flags passed to the host C++ compiler. | 270 | Flags passed to the host C++ compiler. | |
271 | . | 271 | . | |
272 | .It Sy HOST_SH | 272 | .It Sy HOST_SH | |
273 | Path name to a shell available on the host system | 273 | Path name to a shell available on the host system | |
274 | and suitable for use during the build. | 274 | and suitable for use during the build. | |
275 | The | 275 | The | |
276 | .Nx | 276 | .Nx | |
277 | build system requires a modern Bourne-like shell | 277 | build system requires a modern Bourne-like shell | |
278 | with POSIX-compliant features, | 278 | with POSIX-compliant features, | |
279 | and also requires support for the | 279 | and also requires support for the | |
280 | .Dq local | 280 | .Dq local | |
281 | keyword to declare local variables in shell functions | 281 | keyword to declare local variables in shell functions | |
282 | (which is a widely-implemented but non-standardised feature). | 282 | (which is a widely-implemented but non-standardised feature). | |
283 | .Pp | 283 | .Pp | |
284 | Depending on the host system, a suitable shell may be | 284 | Depending on the host system, a suitable shell may be | |
285 | .Pa /bin/sh , | 285 | .Pa /bin/sh , | |
286 | .Pa /usr/xpg4/bin/sh , | 286 | .Pa /usr/xpg4/bin/sh , | |
287 | .Pa /bin/ksh | 287 | .Pa /bin/ksh | |
288 | (provided it is a variant of ksh that supports the | 288 | (provided it is a variant of ksh that supports the | |
289 | .Dq local | 289 | .Dq local | |
290 | keyword, | 290 | keyword, | |
291 | such as ksh88, but not ksh93), | 291 | such as ksh88, but not ksh93), | |
292 | or | 292 | or | |
293 | .Pa /usr/local/bin/bash . | 293 | .Pa /usr/local/bin/bash . | |
294 | .Pp | 294 | .Pp | |
295 | Most parts of the build require | 295 | Most parts of the build require | |
296 | .Sy HOST_SH | 296 | .Sy HOST_SH | |
297 | to be an absolute path; however, | 297 | to be an absolute path; however, | |
298 | .Nm build.sh | 298 | .Nm build.sh | |
299 | allows it to be a simple command name, which will be converted | 299 | allows it to be a simple command name, which will be converted | |
300 | to an absolute path by searching the | 300 | to an absolute path by searching the | |
301 | .Sy PATH . | 301 | .Sy PATH . | |
302 | . | 302 | . | |
303 | .It Sy INSTALLBOOT_UBOOT_PATHS | 303 | .It Sy INSTALLBOOT_UBOOT_PATHS | |
304 | A colon-separated list of search paths used by | 304 | A colon-separated list of search paths used by | |
305 | .Xr installboot 8 | 305 | .Xr installboot 8 | |
306 | to find U-Boot packages. | 306 | to find U-Boot packages. | |
307 | . | 307 | . | |
308 | .It Sy MACHINE | 308 | .It Sy MACHINE | |
309 | Machine type, e.g., | 309 | Machine type, e.g., | |
310 | .Dq macppc . | 310 | .Dq macppc . | |
311 | . | 311 | . | |
312 | .It Sy MACHINE_ARCH | 312 | .It Sy MACHINE_ARCH | |
313 | Machine architecture, e.g., | 313 | Machine architecture, e.g., | |
314 | .Dq powerpc . | 314 | .Dq powerpc . | |
315 | . | 315 | . | |
316 | .It Sy MAKE | 316 | .It Sy MAKE | |
317 | Path name to invoke | 317 | Path name to invoke | |
318 | .Xr make 1 | 318 | .Xr make 1 | |
319 | as. | 319 | as. | |
320 | . | 320 | . | |
321 | .It Sy MAKECONF | 321 | .It Sy MAKECONF | |
322 | The name of the | 322 | The name of the | |
323 | .Xr make 1 | 323 | .Xr make 1 | |
324 | configuration file. | 324 | configuration file. | |
325 | See | 325 | See | |
326 | .Sx \*qmake\*q variables | 326 | .Sx \*qmake\*q variables | |
327 | and | 327 | and | |
328 | .Xr mk.conf 5 . | 328 | .Xr mk.conf 5 . | |
329 | .Pp | 329 | .Pp | |
330 | .Em Note : | 330 | .Em Note : | |
331 | Only settable in the process environment. | 331 | Only settable in the process environment. | |
332 | .DFLT | 332 | .DFLT | |
333 | .Dq /etc/mk.conf | 333 | .Dq /etc/mk.conf | |
334 | . | 334 | . | |
335 | .It Sy MAKEFLAGS | 335 | .It Sy MAKEFLAGS | |
336 | Flags to invoke | 336 | Flags to invoke | |
337 | .Xr make 1 | 337 | .Xr make 1 | |
338 | with. | 338 | with. | |
339 | .Pp | 339 | .Pp | |
340 | .Em Note : | 340 | .Em Note : | |
341 | .Sy build.sh | 341 | .Sy build.sh | |
342 | ignores the value of | 342 | ignores the value of | |
343 | .Sy MAKEFLAGS | 343 | .Sy MAKEFLAGS | |
344 | passed in the environment, but allows | 344 | passed in the environment, but allows | |
345 | .Sy MAKEFLAGS | 345 | .Sy MAKEFLAGS | |
346 | to be set via the | 346 | to be set via the | |
347 | .Fl V | 347 | .Fl V | |
348 | option. | 348 | option. | |
349 | . | 349 | . | |
350 | .It Sy MAKEOBJDIR | 350 | .It Sy MAKEOBJDIR | |
351 | Directory to use as the | 351 | Directory to use as the | |
352 | .Sy .OBJDIR | 352 | .Sy .OBJDIR | |
353 | for the current directory. | 353 | for the current directory. | |
354 | The value is subjected to variable expansion by | 354 | The value is subjected to variable expansion by | |
355 | .Xr make 1 . | 355 | .Xr make 1 . | |
356 | Typical usage is to set this variable to a value involving the use of | 356 | Typical usage is to set this variable to a value involving the use of | |
357 | .Sq ${.CURDIR:S...} | 357 | .Sq ${.CURDIR:S...} | |
358 | or | 358 | or | |
359 | .Sq ${.CURDIR:C...} , | 359 | .Sq ${.CURDIR:C...} , | |
360 | to derive the value of | 360 | to derive the value of | |
361 | .Sy .OBJDIR | 361 | .Sy .OBJDIR | |
362 | from the value of | 362 | from the value of | |
363 | .Sy .CURDIR . | 363 | .Sy .CURDIR . | |
364 | Used only if | 364 | Used only if | |
365 | .Sy MAKEOBJDIRPREFIX | 365 | .Sy MAKEOBJDIRPREFIX | |
366 | is not defined. | 366 | is not defined. | |
367 | .Pp | 367 | .Pp | |
368 | .Em Note : | 368 | .Em Note : | |
369 | .Sy MAKEOBJDIR | 369 | .Sy MAKEOBJDIR | |
370 | can be provided only in the environment or via the | 370 | can be provided only in the environment or via the | |
371 | .Fl O | 371 | .Fl O | |
372 | flag of | 372 | flag of | |
373 | .Nm build.sh ; | 373 | .Nm build.sh ; | |
374 | it cannot usefully be set inside a Makefile, including in | 374 | it cannot usefully be set inside a Makefile, including in | |
375 | .Xr mk.conf 5 | 375 | .Xr mk.conf 5 | |
376 | or | 376 | or | |
377 | .Sy MAKECONF . | 377 | .Sy MAKECONF . | |
378 | . | 378 | . | |
379 | .It Sy MAKEOBJDIRPREFIX | 379 | .It Sy MAKEOBJDIRPREFIX | |
380 | Top level directory of the object directory tree. | 380 | Top level directory of the object directory tree. | |
381 | The value is subjected to variable expansion by | 381 | The value is subjected to variable expansion by | |
382 | .Xr make 1 . | 382 | .Xr make 1 . | |
383 | .Sy build.sh | 383 | .Sy build.sh | |
384 | will create the | 384 | will create the | |
385 | ${MAKEOBJDIRPREFIX} | 385 | ${MAKEOBJDIRPREFIX} | |
386 | directory if necessary, but if | 386 | directory if necessary, but if | |
387 | .Xr make 1 | 387 | .Xr make 1 | |
388 | is used without | 388 | is used without | |
389 | .Sy build.sh , | 389 | .Sy build.sh , | |
390 | then rules in | 390 | then rules in | |
391 | .Aq bsd.obj.mk | 391 | .Aq bsd.obj.mk | |
392 | will abort the build if the | 392 | will abort the build if the | |
393 | ${MAKEOBJDIRPREFIX} | 393 | ${MAKEOBJDIRPREFIX} | |
394 | directory does not exist. | 394 | directory does not exist. | |
395 | If the value is defined and valid, then | 395 | If the value is defined and valid, then | |
396 | ${MAKEOBJDIRPREFIX}/${.CURDIR} | 396 | ${MAKEOBJDIRPREFIX}/${.CURDIR} | |
397 | is used as the | 397 | is used as the | |
398 | .Sy .OBJDIR | 398 | .Sy .OBJDIR | |
399 | for the current directory. | 399 | for the current directory. | |
400 | The current directory may be read only. | 400 | The current directory may be read only. | |
401 | .Pp | 401 | .Pp | |
402 | .Em Note : | 402 | .Em Note : | |
403 | .Sy MAKEOBJDIRPREFIX | 403 | .Sy MAKEOBJDIRPREFIX | |
404 | can be provided only in the environment or via the | 404 | can be provided only in the environment or via the | |
405 | .Fl M | 405 | .Fl M | |
406 | flag of | 406 | flag of | |
407 | .Nm build.sh ; | 407 | .Nm build.sh ; | |
408 | it cannot usefully be set inside a Makefile, including in | 408 | it cannot usefully be set inside a Makefile, including in | |
409 | .Xr mk.conf 5 | 409 | .Xr mk.conf 5 | |
410 | or | 410 | or | |
411 | .Sy MAKECONF . | 411 | .Sy MAKECONF . | |
412 | . | 412 | . | |
413 | .It Sy TMPDIR | 413 | .It Sy TMPDIR | |
414 | Top-level directory to store temporary directories used by | 414 | Top-level directory to store temporary directories used by | |
415 | .Sy build.sh | 415 | .Sy build.sh | |
416 | before paths to other directories such as | 416 | before paths to other directories such as | |
417 | .Sy .OBJDIR | 417 | .Sy .OBJDIR | |
418 | can be determined. | 418 | can be determined. | |
419 | .Pp | 419 | .Pp | |
420 | .Em Note : | 420 | .Em Note : | |
421 | Must support execution of binaries. | 421 | Must support execution of binaries. | |
422 | I.e., without | 422 | I.e., without | |
423 | .Xr mount 8 Ns 's | 423 | .Xr mount 8 Ns 's | |
424 | .Fl o | 424 | .Fl o | |
425 | .Sy noexec | 425 | .Sy noexec | |
426 | option. | 426 | option. | |
427 | .DFLT | 427 | .DFLT | |
428 | .Dq /tmp . | 428 | .Dq /tmp . | |
429 | . | 429 | . | |
430 | .El | 430 | .El | |
431 | . | 431 | . | |
432 | .Ss \*qmake\*q variables | 432 | .Ss \*qmake\*q variables | |
433 | . | 433 | . | |
434 | Several variables control the behavior of | 434 | Several variables control the behavior of | |
435 | .Nx | 435 | .Nx | |
436 | builds. | 436 | builds. | |
437 | Unless otherwise specified, these variables may be set in | 437 | Unless otherwise specified, these variables may be set in | |
438 | either the process environment or the | 438 | either the process environment or the | |
439 | .Xr make 1 | 439 | .Xr make 1 | |
440 | configuration file | 440 | configuration file | |
441 | .Xr mk.conf 5 | 441 | .Xr mk.conf 5 | |
442 | specified by | 442 | specified by | |
443 | .Sy MAKECONF . | 443 | .Sy MAKECONF . | |
444 | .Pp | 444 | .Pp | |
445 | This list is not comprehensive; | 445 | This list is not comprehensive; | |
446 | all supported variables and their defaults are documented in | 446 | all supported variables and their defaults are documented in | |
447 | .Xr mk.conf 5 . | 447 | .Xr mk.conf 5 . | |
448 | . | 448 | . | |
449 | .Bl -tag -width 14n | 449 | .Bl -tag -width 14n | |
450 | . | 450 | . | |
451 | .\" These entries are sorted alphabetically. | 451 | .\" These entries are sorted alphabetically. | |
452 | .\" Keep in sync with canonical reference share/man/man5/mk.conf.5 | 452 | .\" Keep in sync with canonical reference share/man/man5/mk.conf.5 | |
453 | .\" and with share/mk/bsd.README. | 453 | .\" and with share/mk/bsd.README. | |
454 | . | 454 | . | |
455 | .It Sy BSDOBJDIR | 455 | .It Sy BSDOBJDIR | |
456 | The real path to the object directory tree for the | 456 | The real path to the object directory tree for the | |
457 | .Nx | 457 | .Nx | |
458 | source tree. | 458 | source tree. | |
459 | .DFLT | 459 | .DFLT | |
460 | .Dq Pa /usr/obj | 460 | .Dq Pa /usr/obj | |
461 | . | 461 | . | |
462 | .It Sy BSDSRCDIR | 462 | .It Sy BSDSRCDIR | |
463 | The real path to the | 463 | The real path to the | |
464 | .Nx | 464 | .Nx | |
465 | source tree, if | 465 | source tree, if | |
466 | .Sy NETBSDSRCDIR | 466 | .Sy NETBSDSRCDIR | |
467 | isn't defined. | 467 | isn't defined. | |
468 | .DFLT | 468 | .DFLT | |
469 | .Dq Pa /usr/src | 469 | .Dq Pa /usr/src | |
470 | . | 470 | . | |
471 | .It Sy BUILDID | 471 | .It Sy BUILDID | |
472 | Identifier for the build. | 472 | Identifier for the build. | |
473 | If set, this should be a short string that is suitable for use as | 473 | If set, this should be a short string that is suitable for use as | |
474 | part of a file or directory name. | 474 | part of a file or directory name. | |
475 | The identifier will be appended to | 475 | The identifier will be appended to | |
476 | object directory names, and can be consulted in the | 476 | object directory names, and can be consulted in the | |
477 | .Xr make 1 | 477 | .Xr make 1 | |
478 | configuration file in order to set additional build parameters, | 478 | configuration file in order to set additional build parameters, | |
479 | such as compiler flags. | 479 | such as compiler flags. | |
480 | It will also be used as part of the kernel version string, | 480 | It will also be used as part of the kernel version string, | |
481 | which can be shown by | 481 | which can be shown by | |
482 | .Dq Li uname \-v . | 482 | .Dq Li uname \-v . | |
483 | .DFLTu | 483 | .DFLTu | |
484 | . | 484 | . | |
485 | .It Sy BUILDINFO | 485 | .It Sy BUILDINFO | |
486 | Optional multi-line string containing information about the build. | 486 | Optional multi-line string containing information about the build. | |
487 | This will appear in | 487 | This will appear in | |
488 | .Sy DESTDIR Ns Pa /etc/release , | 488 | .Sy DESTDIR Ns Pa /etc/release , | |
489 | and it will be stored in the | 489 | and it will be stored in the | |
490 | .Va buildinfo | 490 | .Va buildinfo | |
491 | variable in any kernels that are built. | 491 | variable in any kernels that are built. | |
492 | When such kernels are booted, the | 492 | When such kernels are booted, the | |
493 | .Xr sysctl 7 | 493 | .Xr sysctl 7 | |
494 | .Va kern.buildinfo | 494 | .Va kern.buildinfo | |
495 | variable will report this value. | 495 | variable will report this value. | |
496 | The string may contain backslash escape sequences, such as | 496 | The string may contain backslash escape sequences, such as | |
497 | .Dq "\e\e" | 497 | .Dq "\e\e" | |
498 | (representing a backslash character) | 498 | (representing a backslash character) | |
499 | and | 499 | and | |
500 | .Dq "\en" | 500 | .Dq "\en" | |
501 | (representing a newline). | 501 | (representing a newline). | |
502 | .DFLTu | 502 | .DFLTu | |
503 | . | 503 | . | |
504 | .It Sy BUILDSEED | 504 | .It Sy BUILDSEED | |
505 | .Xr g++ 1 | 505 | .Xr g++ 1 | |
506 | uses random numbers when compiling C++ code. | 506 | uses random numbers when compiling C++ code. | |
507 | This variable seeds the | 507 | This variable seeds the | |
508 | .Xr g++ 1 | 508 | .Xr g++ 1 | |
509 | random number generator using | 509 | random number generator using | |
510 | .Fl frandom-seed | 510 | .Fl frandom-seed | |
511 | with this value. | 511 | with this value. | |
512 | By default, it is set to | 512 | By default, it is set to | |
513 | .Do NetBSD-( Ns Em majorversion ) Dc . | 513 | .Do NetBSD-( Ns Em majorversion ) Dc . | |
514 | Using a fixed value causes C++ binaries to be the same when | 514 | Using a fixed value causes C++ binaries to be the same when | |
515 | built from the same sources, resulting in identical (reproducible) builds. | 515 | built from the same sources, resulting in identical (reproducible) builds. | |
516 | Additional information is available in the | 516 | Additional information is available in the | |
517 | .Xr g++ 1 | 517 | .Xr g++ 1 | |
518 | documentation of | 518 | documentation of | |
519 | .Fl frandom-seed . | 519 | .Fl frandom-seed . | |
520 | .DFLTu | 520 | .DFLTu | |
521 | . | 521 | . | |
522 | .It Sy CPUFLAGS | 522 | .It Sy CPUFLAGS | |
523 | Additional flags to the compiler/assembler to select | 523 | Additional flags to the compiler/assembler to select | |
524 | CPU instruction set options, CPU tuning options, etc. | 524 | CPU instruction set options, CPU tuning options, etc. | |
525 | .DFLTu | 525 | .DFLTu | |
526 | . | 526 | . | |
527 | .It Sy DESTDIR | 527 | .It Sy DESTDIR | |
528 | Directory to contain the built | 528 | Directory to contain the built | |
529 | .Nx | 529 | .Nx | |
530 | system. | 530 | system. | |
531 | If set, special options are passed to the compilation tools to | 531 | If set, special options are passed to the compilation tools to | |
532 | prevent their default use of the host system's | 532 | prevent their default use of the host system's | |
533 | .Pa /usr/include , /usr/lib , | 533 | .Pa /usr/include , /usr/lib , | |
534 | and so forth. | 534 | and so forth. | |
535 | This pathname must be an absolute path, and should | 535 | This pathname must be an absolute path, and should | |
536 | .Em not | 536 | .Em not | |
537 | end with a slash | 537 | end with a slash | |
538 | .Pq / | 538 | .Pq / | |
539 | character. | 539 | character. | |
540 | (For installation into the system's root directory, set | 540 | (For installation into the system's root directory, set | |
541 | .Sy DESTDIR | 541 | .Sy DESTDIR | |
542 | to an empty string, not to | 542 | to an empty string, not to | |
543 | .Dq / ) . | 543 | .Dq / ) . | |
544 | The directory must reside on a file system which supports long file | 544 | The directory must reside on a file system which supports long file | |
545 | names and hard links. | 545 | names and hard links. | |
546 | .Pp | 546 | .Pp | |
547 | .Em Note : | 547 | .Em Note : | |
548 | .Sy build.sh | 548 | .Sy build.sh | |
549 | will provide a default of | 549 | will provide a default of | |
550 | .Pa destdir . Ns Sy MACHINE | 550 | .Pa destdir . Ns Sy MACHINE | |
551 | (in the top-level | 551 | (in the top-level | |
552 | .Sy .OBJDIR ) | 552 | .Sy .OBJDIR ) | |
553 | unless run in | 553 | unless run in | |
554 | .Sq expert | 554 | .Sq expert | |
555 | mode. | 555 | mode. | |
556 | .DFLT | 556 | .DFLT | |
557 | Empty string if | 557 | Empty string if | |
558 | .Sy USETOOLS | 558 | .Sy USETOOLS | |
559 | is | 559 | is | |
560 | .Dq yes ; | 560 | .Dq yes ; | |
561 | unset otherwise. | 561 | unset otherwise. | |
562 | . | 562 | . | |
563 | .It Sy EXTERNAL_TOOLCHAIN | 563 | .It Sy EXTERNAL_TOOLCHAIN | |
564 | If defined, this variable indicates the root directory of | 564 | If defined, this variable indicates the root directory of | |
565 | an external toolchain which will be used to build the tree. | 565 | an external toolchain which will be used to build the tree. | |
566 | For example, if a platform is a | 566 | For example, if a platform is a | |
567 | .Sy TOOLCHAIN_MISSING | 567 | .Sy TOOLCHAIN_MISSING | |
568 | platform, | 568 | platform, | |
569 | .Sy EXTERNAL_TOOLCHAIN | 569 | .Sy EXTERNAL_TOOLCHAIN | |
570 | can be used to re-enable the cross-compile framework. | 570 | can be used to re-enable the cross-compile framework. | |
571 | .Pp | 571 | .Pp | |
572 | If | 572 | If | |
573 | .Sy EXTERNAL_TOOLCHAIN | 573 | .Sy EXTERNAL_TOOLCHAIN | |
574 | is defined, act as | 574 | is defined, act as | |
575 | .Sy MKGCC=no , | 575 | .Sy MKGCC=no , | |
576 | since the external version of the compiler may not be | 576 | since the external version of the compiler may not be | |
577 | able to build the library components of the in-tree compiler. | 577 | able to build the library components of the in-tree compiler. | |
578 | .Pp | 578 | .Pp | |
579 | This variable should be used in conjunction with an appropriate | 579 | This variable should be used in conjunction with an appropriate | |
580 | .Sy HAVE_GCC | 580 | .Sy HAVE_GCC | |
581 | or | 581 | or | |
582 | .Sy HAVE_LLVM | 582 | .Sy HAVE_LLVM | |
583 | setting to control the compiler flags. | 583 | setting to control the compiler flags. | |
584 | .Pp | 584 | .Pp | |
585 | .Em Note : | 585 | .Em Note : | |
586 | This variable is not yet used in as many places as it should be. | 586 | This variable is not yet used in as many places as it should be. | |
587 | Expect the exact semantics of this variable to change in the short | 587 | Expect the exact semantics of this variable to change in the short | |
588 | term as parts of the cross-compile framework continue to be cleaned up. | 588 | term as parts of the cross-compile framework continue to be cleaned up. | |
589 | .DFLTu | 589 | .DFLTu | |
590 | . | 590 | . | |
591 | .It Sy MAKEVERBOSE | 591 | .It Sy MAKEVERBOSE | |
592 | Level of verbosity of status messages. | 592 | Level of verbosity of status messages. | |
593 | Supported values: | 593 | Supported values: | |
594 | .Bl -tag -width 2n | 594 | .Bl -tag -width 2n | |
595 | .It 0 | 595 | .It 0 | |
596 | No descriptive messages or commands executed by | 596 | No descriptive messages or commands executed by | |
597 | .Xr make 1 | 597 | .Xr make 1 | |
598 | are shown. | 598 | are shown. | |
599 | .It 1 | 599 | .It 1 | |
600 | Brief messages are shown describing what is being done, | 600 | Brief messages are shown describing what is being done, | |
601 | but the actual commands executed by | 601 | but the actual commands executed by | |
602 | .Xr make 1 | 602 | .Xr make 1 | |
603 | are not shown. | 603 | are not shown. | |
604 | .It 2 | 604 | .It 2 | |
605 | Descriptive messages are shown as above (prefixed with a | 605 | Descriptive messages are shown as above (prefixed with a | |
606 | .Sq # ) , | 606 | .Sq # ) , | |
607 | and ordinary commands performed by | 607 | and ordinary commands performed by | |
608 | .Xr make 1 | 608 | .Xr make 1 | |
609 | are shown. | 609 | are shown. | |
610 | .It 3 | 610 | .It 3 | |
611 | In addition to the above, all commands performed by | 611 | In addition to the above, all commands performed by | |
612 | .Xr make 1 | 612 | .Xr make 1 | |
613 | are shown, even if they would ordinarily have been hidden | 613 | are shown, even if they would ordinarily have been hidden | |
614 | through use of the | 614 | through use of the | |
615 | .Dq \&@ | 615 | .Dq \&@ | |
616 | prefix in the relevant makefile. | 616 | prefix in the relevant makefile. | |
617 | .It 4 | 617 | .It 4 | |
618 | In addition to the above, commands executed by | 618 | In addition to the above, commands executed by | |
619 | .Xr make 1 | 619 | .Xr make 1 | |
620 | are traced through use of the | 620 | are traced through use of the | |
621 | .Xr sh 1 | 621 | .Xr sh 1 | |
622 | .Dq Fl x | 622 | .Dq Fl x | |
623 | flag. | 623 | flag. | |
624 | .El | 624 | .El | |
625 | .DFLT | 625 | .DFLT | |
626 | 2 | 626 | 2 | |
627 | . | 627 | . | |
628 | .It Sy MKCATPAGES | 628 | .It Sy MKCATPAGES | |
629 | .YorN | 629 | .YorN | |
630 | Indicates whether preformatted plaintext manual pages will be created | 630 | Indicates whether preformatted plaintext manual pages will be created | |
631 | and installed. | 631 | and installed. | |
632 | .NOVAR MKMAN=no No or Sy MKSHARE=no | 632 | .NOVAR MKMAN=no No or Sy MKSHARE=no | |
633 | .DFLTn | 633 | .DFLTn | |
634 | . | 634 | . | |
635 | .It Sy MKCROSSGDB | 635 | .It Sy MKCROSSGDB | |
636 | .YorN | 636 | .YorN | |
637 | Create a cross-gdb as a host tool. | 637 | Create a cross-gdb as a host tool. | |
638 | .DFLTn | 638 | .DFLTn | |
639 | . | 639 | . | |
640 | .It Sy MKDEBUG | 640 | .It Sy MKDEBUG | |
641 | .YorN | 641 | .YorN | |
642 | Indicates whether debug information should be generated for | 642 | Indicates whether debug information should be generated for | |
643 | all userland binaries. | 643 | all userland binaries. | |
644 | The result is collected as an additional | 644 | The result is collected as an additional | |
645 | .Sy debug.tgz | 645 | .Sy debug.tgz | |
646 | and | 646 | and | |
647 | .Sy xdebug.tgz | 647 | .Sy xdebug.tgz | |
648 | set and installed in | 648 | set and installed in | |
649 | .Sy DESTDIR Ns Pa /usr/libdata/debug . | 649 | .Sy DESTDIR Ns Pa /usr/libdata/debug . | |
650 | .NODEF NODEBUG | 650 | .NODEF NODEBUG | |
651 | .DFLTn | 651 | .DFLTn | |
652 | . | 652 | . | |
653 | .It Sy MKDEBUGKERNEL | 653 | .It Sy MKDEBUGKERNEL | |
654 | .YorN | 654 | .YorN | |
655 | Indicates whether debugging symbols will be built for kernels | 655 | Indicates whether debugging symbols will be built for kernels | |
656 | by default; pretend as if | 656 | by default; pretend as if | |
657 | .Em makeoptions DEBUG="-g" | 657 | .Em makeoptions DEBUG="-g" | |
658 | is specified in kernel configuration files. | 658 | is specified in kernel configuration files. | |
659 | This will also put the debug kernel | 659 | This will also put the debug kernel | |
660 | .Pa netbsd.gdb | 660 | .Pa netbsd.gdb | |
661 | in the kernel sets. | 661 | in the kernel sets. | |
662 | See | 662 | See | |
663 | .Xr options 4 | 663 | .Xr options 4 | |
664 | for details. | 664 | for details. | |
665 | This is useful if a cross-gdb is built as well (see | 665 | This is useful if a cross-gdb is built as well (see | |
666 | .Sy MKCROSSGDB ) . | 666 | .Sy MKCROSSGDB ) . | |
667 | .DFLTn | 667 | .DFLTn | |
668 | . | 668 | . | |
669 | .It Sy MKDEBUGLIB | 669 | .It Sy MKDEBUGLIB | |
670 | .YorN | 670 | .YorN | |
671 | Indicates whether debug libraries | 671 | Indicates whether debug libraries | |
672 | .Sy ( lib*_g.a ) | 672 | .Sy ( lib*_g.a ) | |
673 | will be built and installed. | 673 | will be built and installed. | |
674 | Debug libraries are compiled with | 674 | Debug libraries are compiled with | |
675 | .Dq Li -g -DDEBUG . | 675 | .Dq Li -g -DDEBUG . | |
676 | .NODEF NODEBUGLIB | 676 | .NODEF NODEBUGLIB | |
677 | .DFLTn | 677 | .DFLTn | |
678 | . | 678 | . | |
679 | .It Sy MKDEBUGTOOLS | 679 | .It Sy MKDEBUGTOOLS | |
680 | .YorN | 680 | .YorN | |
681 | Indicates whether debug information | 681 | Indicates whether debug information | |
682 | .Sy ( lib*_g.a ) | 682 | .Sy ( lib*_g.a ) | |
683 | will be included in the build toolchain. | 683 | will be included in the build toolchain. | |
684 | .DFLTn | 684 | .DFLTn | |
685 | . | 685 | . | |
686 | .It Sy MKDOC | 686 | .It Sy MKDOC | |
687 | .YorN | 687 | .YorN | |
688 | Indicates whether system documentation destined for | 688 | Indicates whether system documentation destined for | |
689 | .Sy DESTDIR Ns Pa /usr/share/doc | 689 | .Sy DESTDIR Ns Pa /usr/share/doc | |
690 | will be installed. | 690 | will be installed. | |
691 | .NODEF NODOC | 691 | .NODEF NODOC | |
692 | .NOVAR MKSHARE=no | 692 | .NOVAR MKSHARE=no | |
693 | .DFLTy | 693 | .DFLTy | |
694 | . | 694 | . | |
695 | .It Sy MKHOSTOBJ | 695 | .It Sy MKHOSTOBJ | |
696 | .YorN | 696 | .YorN | |
697 | If set to | 697 | If set to | |
698 | .Dq yes , | 698 | .Dq yes , | |
699 | then for programs intended to be run on the compile host, | 699 | then for programs intended to be run on the compile host, | |
700 | the name, release, and architecture of the host operating system | 700 | the name, release, and architecture of the host operating system | |
701 | will be suffixed to the name of the object directory created by | 701 | will be suffixed to the name of the object directory created by | |
702 | .Dq make obj . | 702 | .Dq make obj . | |
703 | (This allows multiple host systems to compile NetBSD for a single target.) | 703 | (This allows multiple host systems to compile NetBSD for a single target.) | |
704 | If set to | 704 | If set to | |
705 | .Dq no , | 705 | .Dq no , | |
706 | then programs built to be run on the compile host will use the same | 706 | then programs built to be run on the compile host will use the same | |
707 | object directory names as programs built to be run on the target. | 707 | object directory names as programs built to be run on the target. | |
708 | .DFLTn | 708 | .DFLTn | |
709 | . | 709 | . | |
710 | .It Sy MKHTML | 710 | .It Sy MKHTML | |
711 | .YorN | 711 | .YorN | |
712 | Indicates whether the HTML manual pages are created and installed. | 712 | Indicates whether the HTML manual pages are created and installed. | |
713 | and installed | 713 | and installed | |
714 | .NODEF NOHTML | 714 | .NODEF NOHTML | |
715 | .NOVAR MKMAN=no No or Sy MKSHARE=no | 715 | .NOVAR MKMAN=no No or Sy MKSHARE=no | |
716 | .DFLTy | 716 | .DFLTy | |
717 | . | 717 | . | |
718 | .It Sy MKINFO | 718 | .It Sy MKINFO | |
719 | .YorN | 719 | .YorN | |
720 | Indicates whether GNU Info files, used for the documentation for | 720 | Indicates whether GNU Info files, used for the documentation for | |
721 | most of the compilation tools, will be built and installed. | 721 | most of the compilation tools, will be built and installed. | |
722 | .NODEF NOINFO | 722 | .NODEF NOINFO | |
723 | .NOVAR MKSHARE=no | 723 | .NOVAR MKSHARE=no | |
724 | .DFLTy | 724 | .DFLTy | |
725 | . | 725 | . | |
726 | .It Sy MKKDEBUG | 726 | .It Sy MKKDEBUG | |
727 | Deprecated, use | 727 | Deprecated, use | |
728 | .Sy MKDEBUGKERNEL . | 728 | .Sy MKDEBUGKERNEL . | |
729 | . | 729 | . | |
730 | .It Sy MKKMOD | 730 | .It Sy MKKMOD | |
731 | .YorN | 731 | .YorN | |
732 | Indicates whether kernel modules are built and installed. | 732 | Indicates whether kernel modules are built and installed. | |
733 | .DFLTn | 733 | .DFLTn | |
734 | on | 734 | on | |
735 | .Sy or1k ; | 735 | .Sy or1k ; | |
736 | .Dq yes | 736 | .Dq yes | |
737 | on other platforms. | 737 | on other platforms. | |
738 | . | 738 | . | |
739 | .It Sy MKLINKLIB | 739 | .It Sy MKLINKLIB | |
740 | .YorN | 740 | .YorN | |
741 | Indicates whether all of the shared library infrastructure | 741 | Indicates whether all of the shared library infrastructure | |
742 | will be built and installed. | 742 | will be built and installed. | |
743 | If | 743 | If | |
744 | .Dq no , | 744 | .Dq no , | |
745 | prevents: | 745 | prevents: | |
746 | installation of the | 746 | installation of the | |
747 | .Sy *.a | 747 | .Sy *.a | |
748 | libraries, | 748 | libraries, | |
749 | installation of the | 749 | installation of the | |
750 | .Sy *_pic.a | 750 | .Sy *_pic.a | |
751 | libraries on PIC systems, | 751 | libraries on PIC systems, | |
752 | building of | 752 | building of | |
753 | .Sy *.a | 753 | .Sy *.a | |
754 | libraries on PIC systems, | 754 | libraries on PIC systems, | |
755 | or | 755 | or | |
756 | installation of | 756 | installation of | |
757 | .Sy .so | 757 | .Sy .so | |
758 | symlinks on ELF systems. | 758 | symlinks on ELF systems. | |
759 | .NODEF NOLINKLIB | 759 | .NODEF NOLINKLIB | |
760 | .Pp | 760 | .Pp | |
761 | If | 761 | If | |
762 | .Dq no , | 762 | .Dq no , | |
763 | acts as | 763 | acts as | |
764 | .Sy MKLINT=no MKPICINSTALL=no MKPROFILE=no . | 764 | .Sy MKLINT=no MKPICINSTALL=no MKPROFILE=no . | |
765 | .DFLTy | 765 | .DFLTy | |
766 | . | 766 | . | |
767 | .It Sy MKLINT | 767 | .It Sy MKLINT | |
768 | .YorN | 768 | .YorN | |
769 | Indicates whether | 769 | Indicates whether | |
770 | .Xr lint 1 | 770 | .Xr lint 1 | |
771 | will be run against portions of the | 771 | will be run against portions of the | |
772 | .Nx | 772 | .Nx | |
773 | source code during the build, and whether lint libraries will be | 773 | source code during the build, and whether lint libraries will be | |
774 | installed into | 774 | installed into | |
775 | .Sy DESTDIR Ns Pa /usr/libdata/lint . | 775 | .Sy DESTDIR Ns Pa /usr/libdata/lint . | |
776 | .NODEF NOLINT | 776 | .NODEF NOLINT | |
777 | .NOVAR MKLINKLIB=no | 777 | .NOVAR MKLINKLIB=no | |
778 | .DFLTn | 778 | .DFLTn | |
779 | . | 779 | . | |
780 | .It Sy MKMAN | 780 | .It Sy MKMAN | |
781 | .YorN | 781 | .YorN | |
782 | Indicates whether manual pages will be installed. | 782 | Indicates whether manual pages will be installed. | |
783 | .NODEF NOMAN | 783 | .NODEF NOMAN | |
784 | .NOVAR MKSHARE=no | 784 | .NOVAR MKSHARE=no | |
785 | .Pp | 785 | .Pp | |
786 | If | 786 | If | |
787 | .Dq no , | 787 | .Dq no , | |
788 | acts as | 788 | acts as | |
789 | .Sy MKCATPAGES=no MKHTML=no . | 789 | .Sy MKCATPAGES=no MKHTML=no . | |
790 | .DFLTy | 790 | .DFLTy | |
791 | . | 791 | . | |
792 | .It Sy MKNLS | 792 | .It Sy MKNLS | |
793 | .YorN | 793 | .YorN | |
794 | Indicates whether Native Language System (NLS) locale zone files will be | 794 | Indicates whether Native Language System (NLS) locale zone files will be | |
795 | built and installed. | 795 | built and installed. | |
796 | .NODEF NONLS | 796 | .NODEF NONLS | |
797 | .NOVAR MKSHARE=no | 797 | .NOVAR MKSHARE=no | |
798 | .DFLTy | 798 | .DFLTy | |
799 | . | 799 | . | |
800 | .It Sy MKOBJ | 800 | .It Sy MKOBJ | |
801 | .YorN | 801 | .YorN | |
802 | Indicates whether object directories will be created when running | 802 | Indicates whether object directories will be created when running | |
803 | .Dq make obj . | 803 | .Dq make obj . | |
804 | If set to | 804 | If set to | |
805 | .Dq no , | 805 | .Dq no , | |
806 | then all built files will be located inside the regular source tree. | 806 | then all built files will be located inside the regular source tree. | |
807 | .NODEF NOOBJ | 807 | .NODEF NOOBJ | |
808 | .Pp | 808 | .Pp | |
809 | If | 809 | If | |
810 | .Dq no , | 810 | .Dq no , | |
811 | acts as | 811 | acts as | |
812 | .Sy MKOBJDIRS=no . | 812 | .Sy MKOBJDIRS=no . | |
813 | .Pp | 813 | .Pp | |
814 | .Em Note : | 814 | .Em Note : | |
815 | Setting | 815 | Setting | |
816 | .Sy MKOBJ | 816 | .Sy MKOBJ | |
817 | to | 817 | to | |
818 | .Dq no | 818 | .Dq no | |
819 | is not recommended and may cause problems when updating the tree with | 819 | is not recommended and may cause problems when updating the tree with | |
820 | .Xr cvs 1 . | 820 | .Xr cvs 1 . | |
821 | .DFLTy | 821 | .DFLTy | |
822 | . | 822 | . | |
823 | .It Sy MKOBJDIRS | 823 | .It Sy MKOBJDIRS | |
824 | .YorN | 824 | .YorN | |
825 | Indicates whether object directories will be created automatically | 825 | Indicates whether object directories will be created automatically | |
826 | (via a | 826 | (via a | |
827 | .Dq make obj | 827 | .Dq make obj | |
828 | pass) at the start of a build. | 828 | pass) at the start of a build. | |
829 | .NOVAR MKOBJ=no | 829 | .NOVAR MKOBJ=no | |
830 | .DFLTn | 830 | .DFLTn | |
831 | . | 831 | . | |
832 | .It Sy MKPIC | 832 | .It Sy MKPIC | |
833 | .YorN | 833 | .YorN | |
834 | Indicates whether shared objects and libraries will be created and | 834 | Indicates whether shared objects and libraries will be created and | |
835 | installed. | 835 | installed. | |
836 | If | 836 | If | |
837 | .Dq no , | 837 | .Dq no , | |
838 | the entire built system will be statically linked. | 838 | the entire built system will be statically linked. | |
839 | .NODEF NOPIC | 839 | .NODEF NOPIC | |
840 | .Pp | 840 | .Pp | |
841 | If | 841 | If | |
842 | .Dq no , | 842 | .Dq no , | |
843 | acts as | 843 | acts as | |
844 | .Sy MKPICLIB=no . | 844 | .Sy MKPICLIB=no . | |
845 | .DFLTn | 845 | .DFLTn | |
846 | on | 846 | on | |
847 | .Sy m68000 ; | 847 | .Sy m68000 ; | |
848 | .Dq yes | 848 | .Dq yes | |
849 | on other platforms. | 849 | on other platforms. | |
850 | . | 850 | . | |
851 | .It Sy MKPICINSTALL | 851 | .It Sy MKPICINSTALL | |
852 | .YorN | 852 | .YorN | |
853 | Indicates whether the | 853 | Indicates whether the | |
854 | .Xr ar 1 | 854 | .Xr ar 1 | |
855 | format libraries | 855 | format libraries | |
856 | .Sy ( lib*_pic.a ) , | 856 | .Sy ( lib*_pic.a ) , | |
857 | used to generate shared libraries, are installed. | 857 | used to generate shared libraries, are installed. | |
858 | .NODEF NOPICINSTALL | 858 | .NODEF NOPICINSTALL | |
859 | .NOVAR MKLINKLIB=no | 859 | .NOVAR MKLINKLIB=no | |
860 | .DFLTn | 860 | .DFLTn | |
861 | . | 861 | . | |
862 | .It Sy MKPROFILE | 862 | .It Sy MKPROFILE | |
863 | .YorN | 863 | .YorN | |
864 | Indicates whether profiled libraries | 864 | Indicates whether profiled libraries | |
865 | .Sy ( lib*_p.a ) | 865 | .Sy ( lib*_p.a ) | |
866 | will be built and installed. | 866 | will be built and installed. | |
867 | .NODEF NOPROFILE | 867 | .NODEF NOPROFILE | |
868 | .NOVAR MKLINKLIB=no | 868 | .NOVAR MKLINKLIB=no | |
869 | .DFLTn | 869 | .DFLTn | |
870 | on | 870 | on | |
871 | .Sy or1k , | 871 | .Sy or1k , | |
872 | .Sy riscv32 , | 872 | .Sy riscv32 , | |
873 | and | 873 | and | |
874 | .Sy riscv64 | 874 | .Sy riscv64 | |
875 | (due to toolchain problems with profiled code); | 875 | (due to toolchain problems with profiled code); | |
876 | .Dq yes | 876 | .Dq yes | |
877 | on other platforms. | 877 | on other platforms. | |
878 | . | 878 | . | |
879 | .It Sy MKREPRO | 879 | .It Sy MKREPRO | |
880 | .YorN | 880 | .YorN | |
881 | Indicates whether builds are to be reproducible. | 881 | Indicates whether builds are to be reproducible. | |
882 | If | 882 | If | |
883 | .Dq yes , | 883 | .Dq yes , | |
884 | two builds from the same source tree will produce the same build | 884 | two builds from the same source tree will produce the same build | |
885 | results. | 885 | results. | |
886 | .Pp | 886 | .Pp | |
887 | Used as the default for | 887 | Used as the default for | |
888 | .Sy MKARZERO . | 888 | .Sy MKARZERO . | |
889 | .Pp | 889 | .Pp | |
890 | .\" Note: This paragraph is not in share/man/man5/mk.conf.5. | 890 | .\" Note: This paragraph is not in share/man/man5/mk.conf.5. | |
891 | This may be set to | 891 | This may be set to | |
892 | .Dq yes | 892 | .Dq yes | |
893 | by giving | 893 | by giving | |
894 | .Sy build.sh | 894 | .Sy build.sh | |
895 | the | 895 | the | |
896 | .Fl P | 896 | .Fl P | |
897 | option. | 897 | option. | |
898 | .DFLTn | 898 | .DFLTn | |
899 | .YorN | 899 | .YorN | |
900 | . | 900 | . | |
901 | .It Sy MKREPRO_TIMESTAMP | 901 | .It Sy MKREPRO_TIMESTAMP | |
902 | Unix timestamp. | 902 | Unix timestamp. | |
903 | When | 903 | When | |
904 | .Sy MKREPRO | 904 | .Sy MKREPRO | |
905 | is set, the timestamp of all files in the sets will be set | 905 | is set, the timestamp of all files in the sets will be set | |
906 | to this value. | 906 | to this value. | |
907 | .Pp | 907 | .Pp | |
908 | .\" Note: This paragraph is not in share/man/man5/mk.conf.5. | 908 | .\" Note: This paragraph is not in share/man/man5/mk.conf.5. | |
909 | This may be set automatically to the latest source tree timestamp | 909 | This may be set automatically to the latest source tree timestamp | |
910 | using | 910 | using | |
911 | .Xr cvslatest 1 | 911 | .Xr cvslatest 1 | |
912 | by giving | 912 | by giving | |
913 | .Sy build.sh | 913 | .Sy build.sh | |
914 | the | 914 | the | |
915 | .Fl P | 915 | .Fl P | |
916 | option. | 916 | option. | |
917 | .DFLTu | 917 | .DFLTu | |
918 | . | 918 | . | |
919 | .It Sy MKSHARE | 919 | .It Sy MKSHARE | |
920 | .YorN | 920 | .YorN | |
921 | Indicates whether files destined to reside in | 921 | Indicates whether files destined to reside in | |
922 | .Sy DESTDIR Ns Pa /usr/share | 922 | .Sy DESTDIR Ns Pa /usr/share | |
923 | will be built and installed. | 923 | will be built and installed. | |
924 | .NODEF NOSHARE | 924 | .NODEF NOSHARE | |
925 | .Pp | 925 | .Pp | |
926 | If | 926 | If | |
927 | .Dq no , | 927 | .Dq no , | |
928 | acts as | 928 | acts as | |
929 | .Sy MKCATPAGES=no MKDOC=no MKINFO=no MKHTML=no MKMAN=no MKNLS=no . | 929 | .Sy MKCATPAGES=no MKDOC=no MKINFO=no MKHTML=no MKMAN=no MKNLS=no . | |
930 | .DFLTy | 930 | .DFLTy | |
931 | . | 931 | . | |
932 | .It Sy MKSTRIPIDENT | 932 | .It Sy MKSTRIPIDENT | |
933 | .YorN | 933 | .YorN | |
934 | Indicates whether RCS IDs, for use with | 934 | Indicates whether RCS IDs, for use with | |
935 | .Xr ident 1 , | 935 | .Xr ident 1 , | |
936 | should be stripped from program binaries and shared libraries. | 936 | should be stripped from program binaries and shared libraries. | |
937 | .DFLTn | 937 | .DFLTn | |
938 | . | 938 | . | |
939 | .It Sy MKSTRIPSYM | 939 | .It Sy MKSTRIPSYM | |
940 | .YorN | 940 | .YorN | |
941 | Indicates whether all local symbols should be stripped from shared libraries. | 941 | Indicates whether all local symbols should be stripped from shared libraries. | |
942 | If | 942 | If | |
943 | .Dq yes , | 943 | .Dq yes , | |
944 | strip all local symbols from shared libraries; | 944 | strip all local symbols from shared libraries; | |
945 | the affect is equivalent to the | 945 | the affect is equivalent to the | |
946 | .Fl x | 946 | .Fl x | |
947 | option of | 947 | option of | |
948 | .Xr ld 1 . | 948 | .Xr ld 1 . | |
949 | If | 949 | If | |
950 | .Dq no , | 950 | .Dq no , | |
951 | strip only temporary local symbols; the affect is equivalent | 951 | strip only temporary local symbols; the affect is equivalent | |
952 | to the | 952 | to the | |
953 | .Fl X | 953 | .Fl X | |
954 | option of | 954 | option of | |
955 | .Xr ld 1 . | 955 | .Xr ld 1 . | |
956 | Keeping non-temporary local symbols | 956 | Keeping non-temporary local symbols | |
957 | such as static function names is useful on using DTrace for | 957 | such as static function names is useful on using DTrace for | |
958 | userland libraries and getting a backtrace from a rump kernel | 958 | userland libraries and getting a backtrace from a rump kernel | |
959 | loading shared libraries. | 959 | loading shared libraries. | |
960 | .DFLTy | 960 | .DFLTy | |
961 | . | 961 | . | |
962 | .It Sy MKUNPRIVED | 962 | .It Sy MKUNPRIVED | |
963 | .YorN | 963 | .YorN | |
964 | Indicates whether an unprivileged install will occur. | 964 | Indicates whether an unprivileged install will occur. | |
965 | The user, group, permissions, and file flags, will not be set on | 965 | The user, group, permissions, and file flags, will not be set on | |
966 | the installed items; instead the information will be appended to | 966 | the installed items; instead the information will be appended to | |
967 | a file called | 967 | a file called | |
968 | .Pa METALOG | 968 | .Pa METALOG | |
969 | in | 969 | in | |
970 | .Sy DESTDIR . | 970 | .Sy DESTDIR . | |
971 | The contents of | 971 | The contents of | |
972 | .Pa METALOG | 972 | .Pa METALOG | |
973 | are used during the generation of the distribution tar files to ensure | 973 | are used during the generation of the distribution tar files to ensure | |
974 | that the appropriate file ownership is stored. | 974 | that the appropriate file ownership is stored. | |
975 | .DFLTn | 975 | .DFLTn | |
976 | . | 976 | . | |
977 | .It Sy MKUPDATE | 977 | .It Sy MKUPDATE | |
978 | .YorN | 978 | .YorN | |
979 | Indicates whether all install operations intended to write to | 979 | Indicates whether all install operations intended to write to | |
980 | .Sy DESTDIR | 980 | .Sy DESTDIR | |
981 | will compare file timestamps before installing, and skip the install | 981 | will compare file timestamps before installing, and skip the install | |
982 | phase if the destination files are up-to-date. | 982 | phase if the destination files are up-to-date. | |
983 | .Pp | 983 | .Pp | |
984 | .\" Note: This paragraph is not in share/man/man5/mk.conf.5. | 984 | .\" Note: This paragraph is not in share/man/man5/mk.conf.5. | |
985 | .Em Note : | 985 | .Em Note : | |
986 | This also has implications on full builds (see next subsection). | 986 | This also has implications on full builds (see next subsection). | |
987 | .DFLTn | 987 | .DFLTn | |
988 | . | 988 | . | |
989 | .It Sy MKX11 | 989 | .It Sy MKX11 | |
990 | .YorN | 990 | .YorN | |
991 | Indicates whether X11 is built and installed from | 991 | Indicates whether X11 is built and installed from | |
992 | .Sy X11SRCDIR , | 992 | .Sy X11SRCDIR , | |
993 | and whether the X sets will be created. | 993 | and whether the X sets will be created. | |
994 | .Pp | 994 | .Pp | |
995 | .Em Note : | 995 | .Em Note : | |
996 | If | 996 | If | |
997 | .Dq yes , | 997 | .Dq yes , | |
998 | requires | 998 | requires | |
999 | .Sy MKINET6=yes . | 999 | .Sy MKINET6=yes . | |
1000 | .DFLTn | 1000 | .DFLTn | |
1001 | . | 1001 | . | |
1002 | .It Sy NETBSDSRCDIR | 1002 | .It Sy NETBSDSRCDIR | |
1003 | The path to the top level of the | 1003 | The path to the top level of the | |
1004 | .Nx | 1004 | .Nx | |
1005 | sources. | 1005 | sources. | |
1006 | .DFLT | 1006 | .DFLT | |
1007 | Top level of the | 1007 | Top level of the | |
1008 | .Nx | 1008 | .Nx | |
1009 | source tree (as determined by the presence of | 1009 | source tree (as determined by the presence of | |
1010 | .Pa build.sh | 1010 | .Pa build.sh | |
1011 | and | 1011 | and | |
1012 | .Pa tools/ ) | 1012 | .Pa tools/ ) | |
1013 | if | 1013 | if | |
1014 | .Xr make 1 | 1014 | .Xr make 1 | |
1015 | is run from within that tree; | 1015 | is run from within that tree; | |
1016 | otherwise | 1016 | otherwise | |
1017 | .Sy BSDSRCDIR | 1017 | .Sy BSDSRCDIR | |
1018 | will be used. | 1018 | will be used. | |
1019 | . | 1019 | . | |
1020 | .It Sy TOOLCHAIN_MISSING | 1020 | .It Sy TOOLCHAIN_MISSING | |
1021 | .YorN | 1021 | .YorN | |
1022 | If not | 1022 | If not | |
1023 | .Dq no , | 1023 | .Dq no , | |
1024 | this indicates that the platform | 1024 | this indicates that the platform | |
1025 | .Dq Sy MACHINE_ARCH | 1025 | .Dq Sy MACHINE_ARCH | |
1026 | being built does not have a working in-tree toolchain. | 1026 | being built does not have a working in-tree toolchain. | |
1027 | .Pp | 1027 | .Pp | |
1028 | If not | 1028 | If not | |
1029 | .Dq no , | 1029 | .Dq no , | |
1030 | acts as | 1030 | acts as | |
1031 | .Sy MKBINUTILS=no MKGCC=no MKGDB=no . | 1031 | .Sy MKBINUTILS=no MKGCC=no MKGDB=no . | |
1032 | .DFLTn | 1032 | .DFLTn | |
1033 | . | 1033 | . | |
1034 | .It Sy TOOLDIR | 1034 | .It Sy TOOLDIR | |
1035 | Directory to hold the host tools, once built. | 1035 | Directory to hold the host tools, once built. | |
1036 | If specified, must be an absolute path. | 1036 | If specified, must be an absolute path. | |
1037 | This directory should be unique to a given host system and | 1037 | This directory should be unique to a given host system and | |
1038 | .Nx | 1038 | .Nx | |
1039 | source tree. | 1039 | source tree. | |
1040 | (However, multiple targets may share the same | 1040 | (However, multiple targets may share the same | |
1041 | .Sy TOOLDIR ; | 1041 | .Sy TOOLDIR ; | |
1042 | the target-dependent files have unique names.) If unset, a default based | 1042 | the target-dependent files have unique names.) If unset, a default based | |
1043 | on the | 1043 | on the | |
1044 | .Xr uname 1 | 1044 | .Xr uname 1 | |
1045 | information of the host platform will be created in the | 1045 | information of the host platform will be created in the | |
1046 | .Sy .OBJDIR | 1046 | .Sy .OBJDIR | |
1047 | of | 1047 | of | |
1048 | .Pa src . | 1048 | .Pa src . | |
1049 | .DFLTu | 1049 | .DFLTu | |
1050 | . | 1050 | . | |
1051 | .It Sy USETOOLS | 1051 | .It Sy USETOOLS | |
1052 | .YorN | 1052 | .YorN | |
1053 | Indicates whether the tools specified by | 1053 | Indicates whether the tools specified by | |
1054 | .Sy TOOLDIR | 1054 | .Sy TOOLDIR | |
1055 | should be used as part of a build in progress. | 1055 | should be used as part of a build in progress. | |
1056 | Must be set to | 1056 | Must be set to | |
1057 | .Dq yes | 1057 | .Dq yes | |
1058 | if cross-compiling. | 1058 | if cross-compiling. | |
1059 | .Bl -tag -width "never" | 1059 | .Bl -tag -width "never" | |
1060 | .It yes | 1060 | .It yes | |
1061 | Use the tools from | 1061 | Use the tools from | |
1062 | .Sy TOOLDIR . | 1062 | .Sy TOOLDIR . | |
1063 | .It no | 1063 | .It no | |
1064 | Do not use the tools from | 1064 | Do not use the tools from | |
1065 | .Sy TOOLDIR , | 1065 | .Sy TOOLDIR , | |
1066 | but refuse to build native compilation tool components that are | 1066 | but refuse to build native compilation tool components that are | |
1067 | version-specific for that tool. | 1067 | version-specific for that tool. | |
1068 | .It never | 1068 | .It never | |
1069 | Do not use the tools from | 1069 | Do not use the tools from | |
1070 | .Sy TOOLDIR , | 1070 | .Sy TOOLDIR , | |
1071 | even when building native tool components. | 1071 | even when building native tool components. | |
1072 | This is similar to the traditional | 1072 | This is similar to the traditional | |
1073 | .Nx | 1073 | .Nx | |
1074 | build method, but does | 1074 | build method, but does | |
1075 | .Em not | 1075 | .Em not | |
1076 | verify that the compilation tools in use are up-to-date enough in order | 1076 | verify that the compilation tools in use are up-to-date enough in order | |
1077 | to build the tree successfully. | 1077 | to build the tree successfully. | |
1078 | This may cause build or runtime problems when building the whole | 1078 | This may cause build or runtime problems when building the whole | |
1079 | .Nx | 1079 | .Nx | |
1080 | source tree. | 1080 | source tree. | |
1081 | .El | 1081 | .El | |
1082 | .DFLTn | 1082 | .DFLTn | |
1083 | when using | 1083 | when using | |
1084 | .Aq bsd.*.mk | 1084 | .Aq bsd.*.mk | |
1085 | outside the | 1085 | outside the | |
1086 | .Nx | 1086 | .Nx | |
1087 | source tree (detected automatically) or if | 1087 | source tree (detected automatically) or if | |
1088 | .Sy TOOLCHAIN_MISSING=yes ; | 1088 | .Sy TOOLCHAIN_MISSING=yes ; | |
1089 | .Dq yes | 1089 | .Dq yes | |
1090 | otherwise. | 1090 | otherwise. | |
1091 | . | 1091 | . | |
1092 | .It Sy X11SRCDIR | 1092 | .It Sy X11SRCDIR | |
1093 | Directory containing the modular Xorg source. | 1093 | Directory containing the modular Xorg source. | |
1094 | If specified, must be an absolute path. | 1094 | If specified, must be an absolute path. | |
1095 | The main modular Xorg source is found in | 1095 | The main modular Xorg source is found in | |
1096 | .Sy X11SRCDIR Ns Pa /external/mit . | 1096 | .Sy X11SRCDIR Ns Pa /external/mit . | |
1097 | .DFLT | 1097 | .DFLT | |
1098 | .Sy NETBSDSRCDIR Ns Pa /../xsrc , | 1098 | .Sy NETBSDSRCDIR Ns Pa /../xsrc , | |
1099 | if that exists; otherwise | 1099 | if that exists; otherwise | |
1100 | .Pa /usr/xsrc . | 1100 | .Pa /usr/xsrc . | |
1101 | . | 1101 | . | |
1102 | .El | 1102 | .El | |
1103 | . | 1103 | . | |
1104 | .Ss \*qmake\*q variables for full builds | 1104 | .Ss \*qmake\*q variables for full builds | |
1105 | . | 1105 | . | |
1106 | These variables only affect the top level | 1106 | These variables only affect the top level | |
1107 | .Dq Makefile | 1107 | .Dq Makefile | |
1108 | and do not affect manually building subtrees of the | 1108 | and do not affect manually building subtrees of the | |
1109 | .Nx | 1109 | .Nx | |
1110 | source code. | 1110 | source code. | |
1111 | . | 1111 | . | |
1112 | .Bl -tag -width 14n | 1112 | .Bl -tag -width 14n | |
1113 | . | 1113 | . | |
1114 | .\" These entries are sorted alphabetically. | 1114 | .\" These entries are sorted alphabetically. | |
1115 | . | 1115 | . | |
1116 | .It Sy INSTALLBOOT_BOARDS | 1116 | .It Sy INSTALLBOOT_BOARDS | |
1117 | A list of boards to create bootable images for. | 1117 | A list of boards to create bootable images for. | |
1118 | If corresponding U-Boot packages are installed, | 1118 | If corresponding U-Boot packages are installed, | |
1119 | bootable images are created as part of a release. | 1119 | bootable images are created as part of a release. | |
1120 | See the | 1120 | See the | |
1121 | .Bk -words | 1121 | .Bk -words | |
1122 | .Fl o Sy board= Ns Ar name | 1122 | .Fl o Sy board= Ns Ar name | |
1123 | .Ek | 1123 | .Ek | |
1124 | option of | 1124 | option of | |
1125 | .Xr installboot 8 . | 1125 | .Xr installboot 8 . | |
1126 | . | 1126 | . | |
1127 | .It Sy INSTALLWORLDDIR | 1127 | .It Sy INSTALLWORLDDIR | |
1128 | Location for the | 1128 | Location for the | |
1129 | .Dq make installworld | 1129 | .Dq make installworld | |
1130 | target to install to. | 1130 | target to install to. | |
1131 | If specified, must be an absolute path. | 1131 | If specified, must be an absolute path. | |
1132 | .DFLT | 1132 | .DFLT | |
1133 | .Dq / | 1133 | .Dq / | |
1134 | . | 1134 | . | |
1135 | .It Sy MKOBJDIRS | 1135 | .It Sy MKOBJDIRS | |
1136 | .YorN | 1136 | .YorN | |
1137 | Indicates whether object directories will be created automatically | 1137 | Indicates whether object directories will be created automatically | |
1138 | (via a | 1138 | (via a | |
1139 | .Dq make obj | 1139 | .Dq make obj | |
1140 | pass) at the start of a build. | 1140 | pass) at the start of a build. | |
1141 | .DFLTn | 1141 | .DFLTn | |
1142 | .Pp | 1142 | .Pp | |
1143 | If using | 1143 | If using | |
1144 | .Sy build.sh , | 1144 | .Sy build.sh , | |
1145 | the default is | 1145 | the default is | |
1146 | .Dq yes . | 1146 | .Dq yes . | |
1147 | This may be set back to | 1147 | This may be set back to | |
1148 | .Dq no | 1148 | .Dq no | |
1149 | by giving | 1149 | by giving | |
1150 | .Sy build.sh | 1150 | .Sy build.sh | |
1151 | the | 1151 | the | |
1152 | .Fl o | 1152 | .Fl o | |
1153 | option. | 1153 | option. | |
1154 | . | 1154 | . | |
1155 | .It Sy MKUPDATE | 1155 | .It Sy MKUPDATE | |
1156 | .YorN | 1156 | .YorN | |
1157 | If set, then in addition to the effects described for | 1157 | If set, then in addition to the effects described for | |
1158 | .Sy MKUPDATE=yes | 1158 | .Sy MKUPDATE=yes | |
1159 | above, this implies the effects of | 1159 | above, this implies the effects of | |
1160 | .Sy NOCLEANDIR | 1160 | .Sy NOCLEANDIR | |
1161 | (i.e., | 1161 | (i.e., | |
1162 | .Dq make cleandir | 1162 | .Dq make cleandir | |
1163 | is avoided). | 1163 | is avoided). | |
1164 | .DFLTn | 1164 | .DFLTn | |
1165 | .Pp | 1165 | .Pp | |
1166 | If using | 1166 | If using | |
1167 | .Sy build.sh , | 1167 | .Sy build.sh , | |
1168 | this may be set by giving the | 1168 | this may be set by giving the | |
1169 | .Fl u | 1169 | .Fl u | |
1170 | option. | 1170 | option. | |
1171 | . | 1171 | . | |
1172 | .It Sy NBUILDJOBS | |||
1173 | Now obsolete. | |||
1174 | Use the | |||
1175 | .Xr make 1 | |||
1176 | option | |||
1177 | .Fl j , | |||
1178 | instead. | |||
1179 | See below. | |||
1180 | .DFLTu | |||
1181 | . | |||
1182 | .It Sy NOCLEANDIR | 1172 | .It Sy NOCLEANDIR | |
1183 | If set, avoids the | 1173 | If set, avoids the | |
1184 | .Dq make cleandir | 1174 | .Dq make cleandir | |
1185 | phase of a full build. | 1175 | phase of a full build. | |
1186 | This has the effect of allowing only changed | 1176 | This has the effect of allowing only changed | |
1187 | files in a source tree to be recompiled. | 1177 | files in a source tree to be recompiled. | |
1188 | This can speed up builds when updating only a few files in the tree. | 1178 | This can speed up builds when updating only a few files in the tree. | |
1189 | .DFLTu | 1179 | .DFLTu | |
1190 | .Pp | 1180 | .Pp | |
1191 | See also | 1181 | See also | |
1192 | .Sy MKUPDATE . | 1182 | .Sy MKUPDATE . | |
1193 | . | 1183 | . | |
1194 | .It Sy NODISTRIBDIRS | 1184 | .It Sy NODISTRIBDIRS | |
1195 | If set, avoids the | 1185 | If set, avoids the | |
1196 | .Dq make distrib-dirs | 1186 | .Dq make distrib-dirs | |
1197 | phase of a full build. | 1187 | phase of a full build. | |
1198 | This skips running | 1188 | This skips running | |
1199 | .Xr mtree 8 | 1189 | .Xr mtree 8 | |
1200 | on | 1190 | on | |
1201 | .Sy DESTDIR , | 1191 | .Sy DESTDIR , | |
1202 | useful on systems where building as an unprivileged user, or where it is | 1192 | useful on systems where building as an unprivileged user, or where it is | |
1203 | known that the system-wide mtree files have not changed. | 1193 | known that the system-wide mtree files have not changed. | |
1204 | .DFLTu | 1194 | .DFLTu | |
1205 | . | 1195 | . | |
1206 | .It Sy NOINCLUDES | 1196 | .It Sy NOINCLUDES | |
1207 | If set, avoids the | 1197 | If set, avoids the | |
1208 | .Dq make includes | 1198 | .Dq make includes | |
1209 | phase of a full build. | 1199 | phase of a full build. | |
1210 | This has the effect of preventing | 1200 | This has the effect of preventing | |
1211 | .Xr make 1 | 1201 | .Xr make 1 | |
1212 | from thinking that some programs are out-of-date simply because the | 1202 | from thinking that some programs are out-of-date simply because the | |
1213 | system include files have changed. | 1203 | system include files have changed. | |
1214 | However, this option should not be used when updating the entire | 1204 | However, this option should not be used when updating the entire | |
1215 | .Nx | 1205 | .Nx | |
1216 | source tree arbitrarily; it is suggested to use | 1206 | source tree arbitrarily; it is suggested to use | |
1217 | .Sy MKUPDATE=yes | 1207 | .Sy MKUPDATE=yes | |
1218 | instead in that case. | 1208 | instead in that case. | |
1219 | .DFLTu | 1209 | .DFLTu | |
1220 | . | 1210 | . | |
1221 | .It Sy RELEASEDIR | 1211 | .It Sy RELEASEDIR | |
1222 | If set, specifies the directory to which a | 1212 | If set, specifies the directory to which a | |
1223 | .Xr release 7 | 1213 | .Xr release 7 | |
1224 | layout will be written at the end of a | 1214 | layout will be written at the end of a | |
1225 | .Dq make release . | 1215 | .Dq make release . | |
1226 | If specified, must be an absolute path. | 1216 | If specified, must be an absolute path. | |
1227 | .Pp | 1217 | .Pp | |
1228 | .Em Note : | 1218 | .Em Note : | |
1229 | .Sy build.sh | 1219 | .Sy build.sh | |
1230 | will provide a default of | 1220 | will provide a default of | |
1231 | .Pa releasedir | 1221 | .Pa releasedir | |
1232 | (in the top-level | 1222 | (in the top-level | |
1233 | .Sy .OBJDIR ) | 1223 | .Sy .OBJDIR ) | |
1234 | unless run in | 1224 | unless run in | |
1235 | .Sq expert | 1225 | .Sq expert | |
1236 | mode. | 1226 | mode. | |
1237 | .DFLTu | 1227 | .DFLTu | |
1238 | . | 1228 | . | |
1239 | .El | 1229 | .El | |
1240 | . | 1230 | . | |
1241 | .Sh BUILDING | 1231 | .Sh BUILDING | |
1242 | . | 1232 | . | |
1243 | .Ss \*qmake\*q command line options | 1233 | .Ss \*qmake\*q command line options | |
1244 | This is not a summary of all the options available to | 1234 | This is not a summary of all the options available to | |
1245 | .Xr make 1 ; | 1235 | .Xr make 1 ; | |
1246 | only the options used most frequently with | 1236 | only the options used most frequently with | |
1247 | .Nx | 1237 | .Nx | |
1248 | builds are listed here. | 1238 | builds are listed here. | |
1249 | . | 1239 | . | |
1250 | .Bl -tag -width "var=value" | 1240 | .Bl -tag -width "var=value" | |
1251 | . | 1241 | . | |
1252 | .It Fl j Ar njob | 1242 | .It Fl j Ar njob | |
1253 | Run up to | 1243 | Run up to | |
1254 | .Ar njob | 1244 | .Ar njob | |
1255 | .Xr make 1 | 1245 | .Xr make 1 | |
1256 | subjobs in parallel. | 1246 | subjobs in parallel. | |
1257 | Makefiles should use .WAIT or have explicit dependencies | 1247 | Makefiles should use .WAIT or have explicit dependencies | |
1258 | as necessary to enforce build ordering. | 1248 | as necessary to enforce build ordering. | |
1259 | . | 1249 | . | |
1260 | .It Fl m Ar dir | 1250 | .It Fl m Ar dir | |
1261 | Specify the default directory for searching for system Makefile | 1251 | Specify the default directory for searching for system Makefile | |
1262 | segments, mainly the | 1252 | segments, mainly the | |
1263 | .Aq bsd.*.mk | 1253 | .Aq bsd.*.mk | |
1264 | files. | 1254 | files. | |
1265 | When building any full | 1255 | When building any full | |
1266 | .Nx | 1256 | .Nx | |
1267 | source tree, this should be set to the | 1257 | source tree, this should be set to the | |
1268 | .Dq Pa share/mk | 1258 | .Dq Pa share/mk | |
1269 | directory in the source tree. | 1259 | directory in the source tree. | |
1270 | This is set automatically when building from the top level, or when using | 1260 | This is set automatically when building from the top level, or when using | |
1271 | .Sy build.sh . | 1261 | .Sy build.sh . | |
1272 | . | 1262 | . | |
1273 | .It Fl n | 1263 | .It Fl n | |
1274 | Show the commands that would have been executed, but do not | 1264 | Show the commands that would have been executed, but do not | |
1275 | actually execute them. | 1265 | actually execute them. | |
1276 | This will still cause recursion to take place. | 1266 | This will still cause recursion to take place. | |
1277 | . | 1267 | . | |
1278 | .It Fl V Ar var | 1268 | .It Fl V Ar var | |
1279 | Show | 1269 | Show | |
1280 | .Xr make 1 Ns 's | 1270 | .Xr make 1 Ns 's | |
1281 | idea of the value of | 1271 | idea of the value of | |
1282 | .Ar var . | 1272 | .Ar var . | |
1283 | Does not build any targets. | 1273 | Does not build any targets. | |
1284 | . | 1274 | . | |
1285 | .It Ar var Ns Sy = Ns Ar value | 1275 | .It Ar var Ns Sy = Ns Ar value | |
1286 | Set the variable | 1276 | Set the variable | |
1287 | .Ar var | 1277 | .Ar var | |
1288 | to | 1278 | to | |
1289 | .Ar value , | 1279 | .Ar value , | |
1290 | overriding any setting specified by the process environment, the | 1280 | overriding any setting specified by the process environment, the | |
1291 | .Sy MAKECONF | 1281 | .Sy MAKECONF | |
1292 | configuration file, or the system Makefile segments. | 1282 | configuration file, or the system Makefile segments. | |
1293 | . | 1283 | . | |
1294 | .El | 1284 | .El | |
1295 | . | 1285 | . | |
1296 | .Ss \*qmake\*q targets | 1286 | .Ss \*qmake\*q targets | |
1297 | . | 1287 | . | |
1298 | These default targets may be built by running | 1288 | These default targets may be built by running | |
1299 | .Xr make 1 | 1289 | .Xr make 1 | |
1300 | in any subtree of the | 1290 | in any subtree of the | |
1301 | .Nx | 1291 | .Nx | |
1302 | source code. | 1292 | source code. | |
1303 | It is recommended that none of these be used from the top | 1293 | It is recommended that none of these be used from the top | |
1304 | level Makefile; as a specific exception, | 1294 | level Makefile; as a specific exception, | |
1305 | .Dq make obj | 1295 | .Dq make obj | |
1306 | and | 1296 | and | |
1307 | .Dq make cleandir | 1297 | .Dq make cleandir | |
1308 | are useful in that context. | 1298 | are useful in that context. | |
1309 | . | 1299 | . | |
1310 | .Bl -tag -width "dependall" | 1300 | .Bl -tag -width "dependall" | |
1311 | . | 1301 | . | |
1312 | .It Sy all | 1302 | .It Sy all | |
1313 | Build programs, libraries, and preformatted documentation. | 1303 | Build programs, libraries, and preformatted documentation. | |
1314 | . | 1304 | . | |
1315 | .It Sy clean | 1305 | .It Sy clean | |
1316 | Remove program and library object code files. | 1306 | Remove program and library object code files. | |
1317 | . | 1307 | . | |
1318 | .It Sy cleandir | 1308 | .It Sy cleandir | |
1319 | Same as | 1309 | Same as | |
1320 | .Sy clean , | 1310 | .Sy clean , | |
1321 | but also remove preformatted documentation, dependency files generated | 1311 | but also remove preformatted documentation, dependency files generated | |
1322 | by | 1312 | by | |
1323 | .Dq make depend , | 1313 | .Dq make depend , | |
1324 | and any other files known to be created at build time. | 1314 | and any other files known to be created at build time. | |
1325 | . | 1315 | . | |
1326 | .It Sy depend | 1316 | .It Sy depend | |
1327 | Create dependency files | 1317 | Create dependency files | |
1328 | .Sy ( .depend ) | 1318 | .Sy ( .depend ) | |
1329 | containing more detailed information about the dependencies of source | 1319 | containing more detailed information about the dependencies of source | |
1330 | code on header files. | 1320 | code on header files. | |
1331 | Allows programs to be recompiled automatically when a dependency changes. | 1321 | Allows programs to be recompiled automatically when a dependency changes. | |
1332 | . | 1322 | . | |
1333 | .It Sy dependall | 1323 | .It Sy dependall | |
1334 | Does a | 1324 | Does a | |
1335 | .Dq make depend | 1325 | .Dq make depend | |
1336 | immediately followed by a | 1326 | immediately followed by a | |
1337 | .Dq make all . | 1327 | .Dq make all . | |
1338 | This improves cache locality of the build since both passes read the source | 1328 | This improves cache locality of the build since both passes read the source | |
1339 | files in their entirety. | 1329 | files in their entirety. | |
1340 | . | 1330 | . | |
1341 | .It Sy distclean | 1331 | .It Sy distclean | |
1342 | Synonym for | 1332 | Synonym for | |
1343 | .Sy cleandir . | 1333 | .Sy cleandir . | |
1344 | . | 1334 | . | |
1345 | .It Sy includes | 1335 | .It Sy includes | |
1346 | Build and install system header files. | 1336 | Build and install system header files. | |
1347 | Typically needed before any system libraries or programs can be built. | 1337 | Typically needed before any system libraries or programs can be built. | |
1348 | . | 1338 | . | |
1349 | .It Sy install | 1339 | .It Sy install | |
1350 | Install programs, libraries, and documentation into | 1340 | Install programs, libraries, and documentation into | |
1351 | .Sy DESTDIR . | 1341 | .Sy DESTDIR . | |
1352 | Few files will be installed to | 1342 | Few files will be installed to | |
1353 | .Sy DESTDIR Ns Pa /dev , | 1343 | .Sy DESTDIR Ns Pa /dev , | |
1354 | .Sy DESTDIR Ns Pa /etc , | 1344 | .Sy DESTDIR Ns Pa /etc , | |
1355 | .Sy DESTDIR Ns Pa /root | 1345 | .Sy DESTDIR Ns Pa /root | |
1356 | or | 1346 | or | |
1357 | .Sy DESTDIR Ns Pa /var | 1347 | .Sy DESTDIR Ns Pa /var | |
1358 | in order to prevent user supplied configuration data from being overwritten. | 1348 | in order to prevent user supplied configuration data from being overwritten. | |
1359 | .It Sy lint | 1349 | .It Sy lint | |
1360 | Run | 1350 | Run | |
1361 | .Xr lint 1 | 1351 | .Xr lint 1 | |
1362 | against the C source code, where appropriate, and generate | 1352 | against the C source code, where appropriate, and generate | |
1363 | system-installed lint libraries. | 1353 | system-installed lint libraries. | |
1364 | . | 1354 | . | |
1365 | .It Sy obj | 1355 | .It Sy obj | |
1366 | Create object directories to be used for built files, instead of | 1356 | Create object directories to be used for built files, instead of | |
1367 | building directly in the source tree. | 1357 | building directly in the source tree. | |
1368 | . | 1358 | . | |
1369 | .It Sy tags | 1359 | .It Sy tags | |
1370 | Create | 1360 | Create | |
1371 | .Xr ctags 1 | 1361 | .Xr ctags 1 | |
1372 | searchable function lists usable by the | 1362 | searchable function lists usable by the | |
1373 | .Xr ex 1 | 1363 | .Xr ex 1 | |
1374 | and | 1364 | and | |
1375 | .Xr vi 1 | 1365 | .Xr vi 1 | |
1376 | text editors. | 1366 | text editors. | |
1377 | . | 1367 | . | |
1378 | .El | 1368 | .El | |
1379 | . | 1369 | . | |
1380 | .Ss \*qmake\*q targets for the top level | 1370 | .Ss \*qmake\*q targets for the top level | |
1381 | . | 1371 | . | |
1382 | Additional | 1372 | Additional | |
1383 | .Xr make 1 | 1373 | .Xr make 1 | |
1384 | targets are usable specifically from the top source level to facilitate | 1374 | targets are usable specifically from the top source level to facilitate | |
1385 | building the entire | 1375 | building the entire | |
1386 | .Nx | 1376 | .Nx | |
1387 | source tree. | 1377 | source tree. | |
1388 | . | 1378 | . | |
1389 | .Bl -tag -width "distribution" | 1379 | .Bl -tag -width "distribution" | |
1390 | . | 1380 | . | |
1391 | .It Sy build | 1381 | .It Sy build | |
1392 | Build the entire | 1382 | Build the entire | |
1393 | .Nx | 1383 | .Nx | |
1394 | system (except the kernel). | 1384 | system (except the kernel). | |
1395 | This orders portions of the source tree such that prerequisites | 1385 | This orders portions of the source tree such that prerequisites | |
1396 | will be built in the proper order. | 1386 | will be built in the proper order. | |
1397 | . | 1387 | . | |
1398 | .It Sy distribution | 1388 | .It Sy distribution | |
1399 | Do a | 1389 | Do a | |
1400 | .Dq make build , | 1390 | .Dq make build , | |
1401 | and then install a full distribution (which does not include a kernel) into | 1391 | and then install a full distribution (which does not include a kernel) into | |
1402 | .Sy DESTDIR , | 1392 | .Sy DESTDIR , | |
1403 | including files in | 1393 | including files in | |
1404 | .Sy DESTDIR Ns Pa /dev , | 1394 | .Sy DESTDIR Ns Pa /dev , | |
1405 | .Sy DESTDIR Ns Pa /etc , | 1395 | .Sy DESTDIR Ns Pa /etc , | |
1406 | .Sy DESTDIR Ns Pa /root | 1396 | .Sy DESTDIR Ns Pa /root | |
1407 | and | 1397 | and | |
1408 | .Sy DESTDIR Ns Pa /var . | 1398 | .Sy DESTDIR Ns Pa /var . | |
1409 | . | 1399 | . | |
1410 | .It Sy buildworld | 1400 | .It Sy buildworld | |
1411 | As per | 1401 | As per | |
1412 | .Dq make distribution , | 1402 | .Dq make distribution , | |
1413 | except that it ensures that | 1403 | except that it ensures that | |
1414 | .Sy DESTDIR | 1404 | .Sy DESTDIR | |
1415 | is not the root directory. | 1405 | is not the root directory. | |
1416 | . | 1406 | . | |
1417 | .It Sy installworld | 1407 | .It Sy installworld | |
1418 | Install the distribution from | 1408 | Install the distribution from | |
1419 | .Sy DESTDIR | 1409 | .Sy DESTDIR | |
1420 | to | 1410 | to | |
1421 | .Sy INSTALLWORLDDIR , | 1411 | .Sy INSTALLWORLDDIR , | |
1422 | which defaults to the root directory. | 1412 | which defaults to the root directory. | |
1423 | Ensures that | 1413 | Ensures that | |
1424 | .Sy INSTALLWORLDDIR | 1414 | .Sy INSTALLWORLDDIR | |
1425 | is not the root directory if cross compiling. | 1415 | is not the root directory if cross compiling. | |
1426 | .Pp | 1416 | .Pp | |
1427 | The | 1417 | The | |
1428 | .Sy INSTALLSETS | 1418 | .Sy INSTALLSETS | |
1429 | environment variable may be set to a space-separated list of | 1419 | environment variable may be set to a space-separated list of | |
1430 | distribution sets to be installed. | 1420 | distribution sets to be installed. | |
1431 | By default, all sets except | 1421 | By default, all sets except | |
1432 | .Dq etc | 1422 | .Dq etc | |
1433 | and | 1423 | and | |
1434 | .Dq xetc | 1424 | .Dq xetc | |
1435 | are installed, so most files in | 1425 | are installed, so most files in | |
1436 | .Sy INSTALLWORLDDIR Ns Pa /etc | 1426 | .Sy INSTALLWORLDDIR Ns Pa /etc | |
1437 | will not be installed or modified. | 1427 | will not be installed or modified. | |
1438 | .Pp | 1428 | .Pp | |
1439 | .Em Note : | 1429 | .Em Note : | |
1440 | Before performing this operation with | 1430 | Before performing this operation with | |
1441 | .Sy INSTALLWORLDDIR Ns = Ns Pa / , | 1431 | .Sy INSTALLWORLDDIR Ns = Ns Pa / , | |
1442 | it is highly recommended that you upgrade your kernel and reboot. | 1432 | it is highly recommended that you upgrade your kernel and reboot. | |
1443 | After performing this operation, | 1433 | After performing this operation, | |
1444 | it is recommended that you use | 1434 | it is recommended that you use | |
1445 | .Xr etcupdate 8 | 1435 | .Xr etcupdate 8 | |
1446 | to update files in | 1436 | to update files in | |
1447 | .Sy INSTALLWORLDDIR Ns Pa /etc , | 1437 | .Sy INSTALLWORLDDIR Ns Pa /etc , | |
1448 | and | 1438 | and | |
1449 | .Xr postinstall 8 | 1439 | .Xr postinstall 8 | |
1450 | to check for or fix inconsistencies. | 1440 | to check for or fix inconsistencies. | |
1451 | .It Sy sets | 1441 | .It Sy sets | |
1452 | Create distribution sets from | 1442 | Create distribution sets from | |
1453 | .Sy DESTDIR | 1443 | .Sy DESTDIR | |
1454 | into | 1444 | into | |
1455 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/sets . | 1445 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/sets . | |
1456 | Should be run after | 1446 | Should be run after | |
1457 | .Dq make distribution , | 1447 | .Dq make distribution , | |
1458 | as | 1448 | as | |
1459 | .Dq make build | 1449 | .Dq make build | |
1460 | alone does not install all of the required files. | 1450 | alone does not install all of the required files. | |
1461 | . | 1451 | . | |
1462 | .It Sy sourcesets | 1452 | .It Sy sourcesets | |
1463 | Create source sets of the source tree into | 1453 | Create source sets of the source tree into | |
1464 | .Sy RELEASEDIR Ns Pa /source/sets . | 1454 | .Sy RELEASEDIR Ns Pa /source/sets . | |
1465 | . | 1455 | . | |
1466 | .It Sy syspkgs | 1456 | .It Sy syspkgs | |
1467 | Create syspkgs from | 1457 | Create syspkgs from | |
1468 | .Sy DESTDIR | 1458 | .Sy DESTDIR | |
1469 | into | 1459 | into | |
1470 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/syspkgs . | 1460 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/syspkgs . | |
1471 | Should be run after | 1461 | Should be run after | |
1472 | .Dq make distribution , | 1462 | .Dq make distribution , | |
1473 | as | 1463 | as | |
1474 | .Dq make build | 1464 | .Dq make build | |
1475 | alone does not install all of the required files. | 1465 | alone does not install all of the required files. | |
1476 | . | 1466 | . | |
1477 | .It Sy release | 1467 | .It Sy release | |
1478 | Do a | 1468 | Do a | |
1479 | .Dq make distribution , | 1469 | .Dq make distribution , | |
1480 | build kernels, distribution media, and install sets | 1470 | build kernels, distribution media, and install sets | |
1481 | (this as per | 1471 | (this as per | |
1482 | .Dq make sets ) , | 1472 | .Dq make sets ) , | |
1483 | and | 1473 | and | |
1484 | then package the system into a standard release layout as described by | 1474 | then package the system into a standard release layout as described by | |
1485 | .Xr release 7 . | 1475 | .Xr release 7 . | |
1486 | This requires that | 1476 | This requires that | |
1487 | .Sy RELEASEDIR | 1477 | .Sy RELEASEDIR | |
1488 | be set (see above). | 1478 | be set (see above). | |
1489 | . | 1479 | . | |
1490 | .It Sy iso-image | 1480 | .It Sy iso-image | |
1491 | Create a | 1481 | Create a | |
1492 | .Nx | 1482 | .Nx | |
1493 | installation CD-ROM image in the | 1483 | installation CD-ROM image in the | |
1494 | .Sy RELEASEDIR Ns Pa /images | 1484 | .Sy RELEASEDIR Ns Pa /images | |
1495 | directory. | 1485 | directory. | |
1496 | The CD-ROM file system will have a layout as described in | 1486 | The CD-ROM file system will have a layout as described in | |
1497 | .Xr release 7 . | 1487 | .Xr release 7 . | |
1498 | .Pp | 1488 | .Pp | |
1499 | For most machine types, the CD-ROM will be bootable, and will automatically | 1489 | For most machine types, the CD-ROM will be bootable, and will automatically | |
1500 | run the | 1490 | run the | |
1501 | .Xr sysinst 8 | 1491 | .Xr sysinst 8 | |
1502 | menu-based installation program, which can be used to install or upgrade a | 1492 | menu-based installation program, which can be used to install or upgrade a | |
1503 | .Nx | 1493 | .Nx | |
1504 | system. | 1494 | system. | |
1505 | Bootable CD-ROMs also contain tools that may be useful in | 1495 | Bootable CD-ROMs also contain tools that may be useful in | |
1506 | repairing a damaged | 1496 | repairing a damaged | |
1507 | .Nx | 1497 | .Nx | |
1508 | installation. | 1498 | installation. | |
1509 | .Pp | 1499 | .Pp | |
1510 | Before | 1500 | Before | |
1511 | .Dq make iso-image | 1501 | .Dq make iso-image | |
1512 | is attempted, RELEASEDIR must be populated by | 1502 | is attempted, RELEASEDIR must be populated by | |
1513 | .Dq make release | 1503 | .Dq make release | |
1514 | or equivalent. | 1504 | or equivalent. | |
1515 | .Pp | 1505 | .Pp | |
1516 | .Em Note : | 1506 | .Em Note : | |
1517 | Other, smaller, CD-ROM images may be created in the | 1507 | Other, smaller, CD-ROM images may be created in the | |
1518 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/cdrom | 1508 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/cdrom | |
1519 | directory by | 1509 | directory by | |
1520 | .Dq "make release" . | 1510 | .Dq "make release" . | |
1521 | These smaller images usually contain the same tools as the larger images in | 1511 | These smaller images usually contain the same tools as the larger images in | |
1522 | .Sy RELEASEDIR Ns Pa /images , | 1512 | .Sy RELEASEDIR Ns Pa /images , | |
1523 | but do not contain additional content such as the distribution sets. | 1513 | but do not contain additional content such as the distribution sets. | |
1524 | .Pp | 1514 | .Pp | |
1525 | .Em Note : | 1515 | .Em Note : | |
1526 | The mac68k port still uses an older method of creating | 1516 | The mac68k port still uses an older method of creating | |
1527 | CD-ROM images. | 1517 | CD-ROM images. | |
1528 | This requires the | 1518 | This requires the | |
1529 | .Xr mkisofs 1 | 1519 | .Xr mkisofs 1 | |
1530 | utility, which is not part of | 1520 | utility, which is not part of | |
1531 | .Nx , | 1521 | .Nx , | |
1532 | but which can be installed from | 1522 | but which can be installed from | |
1533 | .Pa pkgsrc/sysutils/cdrtools . | 1523 | .Pa pkgsrc/sysutils/cdrtools . | |
1534 | . | 1524 | . | |
1535 | .It Sy iso-image-source | 1525 | .It Sy iso-image-source | |
1536 | Create a | 1526 | Create a | |
1537 | .Nx | 1527 | .Nx | |
1538 | installation CD-ROM image in the | 1528 | installation CD-ROM image in the | |
1539 | .Sy RELEASEDIR Ns Pa /images | 1529 | .Sy RELEASEDIR Ns Pa /images | |
1540 | directory. | 1530 | directory. | |
1541 | The CD-ROM file system will have a layout as described in | 1531 | The CD-ROM file system will have a layout as described in | |
1542 | .Xr release 7 . | 1532 | .Xr release 7 . | |
1543 | It will have top level directories for the machine type and source. | 1533 | It will have top level directories for the machine type and source. | |
1544 | .Pp | 1534 | .Pp | |
1545 | For most machine types, the CD-ROM will be bootable, and will automatically | 1535 | For most machine types, the CD-ROM will be bootable, and will automatically | |
1546 | run the | 1536 | run the | |
1547 | .Xr sysinst 8 | 1537 | .Xr sysinst 8 | |
1548 | menu-based installation program, which can be used to install or upgrade a | 1538 | menu-based installation program, which can be used to install or upgrade a | |
1549 | .Nx | 1539 | .Nx | |
1550 | system. | 1540 | system. | |
1551 | Bootable CD-ROMs also contain tools that may be useful in | 1541 | Bootable CD-ROMs also contain tools that may be useful in | |
1552 | repairing a damaged | 1542 | repairing a damaged | |
1553 | .Nx | 1543 | .Nx | |
1554 | installation. | 1544 | installation. | |
1555 | .Pp | 1545 | .Pp | |
1556 | Before | 1546 | Before | |
1557 | .Dq make iso-image-source | 1547 | .Dq make iso-image-source | |
1558 | is attempted, RELEASEDIR must be populated by | 1548 | is attempted, RELEASEDIR must be populated by | |
1559 | .Dq make sourcesets release | 1549 | .Dq make sourcesets release | |
1560 | or equivalent. | 1550 | or equivalent. | |
1561 | .Pp | 1551 | .Pp | |
1562 | .Em Note : | 1552 | .Em Note : | |
1563 | Other, smaller, CD-ROM images may be created in the | 1553 | Other, smaller, CD-ROM images may be created in the | |
1564 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/cdrom | 1554 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/cdrom | |
1565 | directory by | 1555 | directory by | |
1566 | .Dq make release . | 1556 | .Dq make release . | |
1567 | These smaller images usually contain the same tools as the larger images in | 1557 | These smaller images usually contain the same tools as the larger images in | |
1568 | .Sy RELEASEDIR Ns Pa /images , | 1558 | .Sy RELEASEDIR Ns Pa /images , | |
1569 | but do not contain additional content such as the distribution sets. | 1559 | but do not contain additional content such as the distribution sets. | |
1570 | .Pp | 1560 | .Pp | |
1571 | .Em Note : | 1561 | .Em Note : | |
1572 | The mac68k port still uses an older method of creating | 1562 | The mac68k port still uses an older method of creating | |
1573 | CD-ROM images. | 1563 | CD-ROM images. | |
1574 | This requires the | 1564 | This requires the | |
1575 | .Xr mkisofs 1 | 1565 | .Xr mkisofs 1 | |
1576 | utility, which is not part of | 1566 | utility, which is not part of | |
1577 | .Nx , | 1567 | .Nx , | |
1578 | but which can be installed from | 1568 | but which can be installed from | |
1579 | .Pa pkgsrc/sysutils/cdrtools . | 1569 | .Pa pkgsrc/sysutils/cdrtools . | |
1580 | . | 1570 | . | |
1581 | .It Sy install-image | 1571 | .It Sy install-image | |
1582 | Create a bootable | 1572 | Create a bootable | |
1583 | .Nx | 1573 | .Nx | |
1584 | installation disk image in the | 1574 | installation disk image in the | |
1585 | .Sy RELEASEDIR Ns Pa /images | 1575 | .Sy RELEASEDIR Ns Pa /images | |
1586 | directory. | 1576 | directory. | |
1587 | The installation disk image is suitable for copying to | 1577 | The installation disk image is suitable for copying to | |
1588 | bootable USB flash memory sticks, etc., for machines which | 1578 | bootable USB flash memory sticks, etc., for machines which | |
1589 | are able to boot from such devices. | 1579 | are able to boot from such devices. | |
1590 | The file system in the bootable disk image will have a layout | 1580 | The file system in the bootable disk image will have a layout | |
1591 | as described in | 1581 | as described in | |
1592 | .Xr release 7 . | 1582 | .Xr release 7 . | |
1593 | .Pp | 1583 | .Pp | |
1594 | The installation image is bootable, and will automatically | 1584 | The installation image is bootable, and will automatically | |
1595 | run the | 1585 | run the | |
1596 | .Xr sysinst 8 | 1586 | .Xr sysinst 8 | |
1597 | menu-based installation program, which can be used to install or upgrade a | 1587 | menu-based installation program, which can be used to install or upgrade a | |
1598 | .Nx | 1588 | .Nx | |
1599 | system. | 1589 | system. | |
1600 | The image also contains tools that may be | 1590 | The image also contains tools that may be | |
1601 | useful in repairing a damaged | 1591 | useful in repairing a damaged | |
1602 | .Nx | 1592 | .Nx | |
1603 | installation. | 1593 | installation. | |
1604 | .Pp | 1594 | .Pp | |
1605 | Before | 1595 | Before | |
1606 | .Dq make install-image | 1596 | .Dq make install-image | |
1607 | is attempted, | 1597 | is attempted, | |
1608 | .Sy RELEASEDIR | 1598 | .Sy RELEASEDIR | |
1609 | must be populated by | 1599 | must be populated by | |
1610 | .Dq make release | 1600 | .Dq make release | |
1611 | or equivalent. | 1601 | or equivalent. | |
1612 | The build must have been performed with | 1602 | The build must have been performed with | |
1613 | .Sy MKUNPRIVED=yes | 1603 | .Sy MKUNPRIVED=yes | |
1614 | because | 1604 | because | |
1615 | .Dq make install-image | 1605 | .Dq make install-image | |
1616 | relies on information in | 1606 | relies on information in | |
1617 | .Sy DESTDIR Ns Pa /METALOG . | 1607 | .Sy DESTDIR Ns Pa /METALOG . | |
1618 | . | 1608 | . | |
1619 | .It Sy live-image | 1609 | .It Sy live-image | |
1620 | Create | 1610 | Create | |
1621 | .Nx | 1611 | .Nx | |
1622 | live images in the | 1612 | live images in the | |
1623 | .Sy RELEASEDIR/images | 1613 | .Sy RELEASEDIR/images | |
1624 | directory. | 1614 | directory. | |
1625 | The live image contains all necessary files | 1615 | The live image contains all necessary files | |
1626 | to boot | 1616 | to boot | |
1627 | .Nx | 1617 | .Nx | |
1628 | up to multi-user mode, including all files | 1618 | up to multi-user mode, including all files | |
1629 | which should be extracted during installation, | 1619 | which should be extracted during installation, | |
1630 | .Nx | 1620 | .Nx | |
1631 | disklabel, bootloaders, etc. | 1621 | disklabel, bootloaders, etc. | |
1632 | .Pp | 1622 | .Pp | |
1633 | The live image is suitable for use as a disk image in | 1623 | The live image is suitable for use as a disk image in | |
1634 | virtual machine environments such as QEMU, | 1624 | virtual machine environments such as QEMU, | |
1635 | and also useful to boot | 1625 | and also useful to boot | |
1636 | .Nx | 1626 | .Nx | |
1637 | from a USB flash memory stick | 1627 | from a USB flash memory stick | |
1638 | on a real machine, without the need for installation. | 1628 | on a real machine, without the need for installation. | |
1639 | .Pp | 1629 | .Pp | |
1640 | Before | 1630 | Before | |
1641 | .Dq make live-image | 1631 | .Dq make live-image | |
1642 | is attempted, RELEASEDIR must be populated by | 1632 | is attempted, RELEASEDIR must be populated by | |
1643 | .Dq make release | 1633 | .Dq make release | |
1644 | or equivalent. | 1634 | or equivalent. | |
1645 | The build must have been performed with | 1635 | The build must have been performed with | |
1646 | .Sy MKUNPRIVED=yes | 1636 | .Sy MKUNPRIVED=yes | |
1647 | because | 1637 | because | |
1648 | .Dq make install-image | 1638 | .Dq make install-image | |
1649 | relies on information in | 1639 | relies on information in | |
1650 | .Sy DESTDIR Ns Pa /METALOG . | 1640 | .Sy DESTDIR Ns Pa /METALOG . | |
1651 | . | 1641 | . | |
1652 | .It Sy regression-tests | 1642 | .It Sy regression-tests | |
1653 | Can only be run after building the regression tests in the directory | 1643 | Can only be run after building the regression tests in the directory | |
1654 | .Dq regress . | 1644 | .Dq regress . | |
1655 | Runs those compiled regression tests on the local host. | 1645 | Runs those compiled regression tests on the local host. | |
1656 | .Pp | 1646 | .Pp | |
1657 | .Em Note : | 1647 | .Em Note : | |
1658 | Most tests are now managed instead using | 1648 | Most tests are now managed instead using | |
1659 | .Xr atf 7 ; | 1649 | .Xr atf 7 ; | |
1660 | this target should probably run those as well but currently does not. | 1650 | this target should probably run those as well but currently does not. | |
1661 | . | 1651 | . | |
1662 | .El | 1652 | .El | |
1663 | . | 1653 | . | |
1664 | .Ss The \*qbuild.sh\*q script | 1654 | .Ss The \*qbuild.sh\*q script | |
1665 | . | 1655 | . | |
1666 | This script file is a shell script designed to build the | 1656 | This script file is a shell script designed to build the | |
1667 | entire | 1657 | entire | |
1668 | .Nx | 1658 | .Nx | |
1669 | system on any host with a suitable modern shell and some common | 1659 | system on any host with a suitable modern shell and some common | |
1670 | utilities. | 1660 | utilities. | |
1671 | The required shell features are described under the | 1661 | The required shell features are described under the | |
1672 | .Sy HOST_SH | 1662 | .Sy HOST_SH | |
1673 | variable. | 1663 | variable. | |
1674 | .Pp | 1664 | .Pp | |
1675 | If a host system's default shell does support the required | 1665 | If a host system's default shell does support the required | |
1676 | features, then we suggest that you explicitly specify | 1666 | features, then we suggest that you explicitly specify | |
1677 | a suitable shell using a command like | 1667 | a suitable shell using a command like | |
1678 | .Bd -unfilled -offset indent | 1668 | .Bd -unfilled -offset indent | |
1679 | .Li /path/to/suitable/shell build.sh Op Ar options | 1669 | .Li /path/to/suitable/shell build.sh Op Ar options | |
1680 | .Ed | 1670 | .Ed | |
1681 | .Pp | 1671 | .Pp | |
1682 | The above command will usually enable | 1672 | The above command will usually enable | |
1683 | .Nm build.sh | 1673 | .Nm build.sh | |
1684 | to automatically set | 1674 | to automatically set | |
1685 | .Sy HOST_SH Ns Cm = Ns Pa /path/to/suitable/shell , | 1675 | .Sy HOST_SH Ns Cm = Ns Pa /path/to/suitable/shell , | |
1686 | but if that fails, then the following set of commands may be used instead: | 1676 | but if that fails, then the following set of commands may be used instead: | |
1687 | .Bd -unfilled -offset indent | 1677 | .Bd -unfilled -offset indent | |
1688 | .Li HOST_SH= Ns Va /path/to/suitable/shell | 1678 | .Li HOST_SH= Ns Va /path/to/suitable/shell | |
1689 | .Li export HOST_SH | 1679 | .Li export HOST_SH | |
1690 | .Li ${HOST_SH} build.sh Op Ar options | 1680 | .Li ${HOST_SH} build.sh Op Ar options | |
1691 | .Ed | 1681 | .Ed | |
1692 | .Pp | 1682 | .Pp | |
1693 | If | 1683 | If | |
1694 | .Sy build.sh | 1684 | .Sy build.sh | |
1695 | detects that it is being executed under an unsuitable shell, it attempts | 1685 | detects that it is being executed under an unsuitable shell, it attempts | |
1696 | to exec a suitable shell instead, or shows an error message. | 1686 | to exec a suitable shell instead, or shows an error message. | |
1697 | If | 1687 | If | |
1698 | .Sy HOST_SH | 1688 | .Sy HOST_SH | |
1699 | is not set explicitly, then | 1689 | is not set explicitly, then | |
1700 | .Nm build.sh | 1690 | .Nm build.sh | |
1701 | sets a default using heuristics dependent on the host platform, | 1691 | sets a default using heuristics dependent on the host platform, | |
1702 | or from the shell under which | 1692 | or from the shell under which | |
1703 | .Nm build.sh | 1693 | .Nm build.sh | |
1704 | is executed (if that can be determined), | 1694 | is executed (if that can be determined), | |
1705 | or using the first copy of | 1695 | or using the first copy of | |
1706 | .Pa sh | 1696 | .Pa sh | |
1707 | found in | 1697 | found in | |
1708 | .Sy PATH . | 1698 | .Sy PATH . | |
1709 | .Pp | 1699 | .Pp | |
1710 | All cross-compile builds, and most native builds, of the entire system | 1700 | All cross-compile builds, and most native builds, of the entire system | |
1711 | should make use of | 1701 | should make use of | |
1712 | .Sy build.sh | 1702 | .Sy build.sh | |
1713 | rather than just running | 1703 | rather than just running | |
1714 | .Dq make . | 1704 | .Dq make . | |
1715 | This way, the | 1705 | This way, the | |
1716 | .Xr make 1 | 1706 | .Xr make 1 | |
1717 | program will be bootstrapped properly, in case the host system has an | 1707 | program will be bootstrapped properly, in case the host system has an | |
1718 | older or incompatible | 1708 | older or incompatible | |
1719 | .Dq make | 1709 | .Dq make | |
1720 | program. | 1710 | program. | |
1721 | .Pp | 1711 | .Pp | |
1722 | When compiling the entire system via | 1712 | When compiling the entire system via | |
1723 | .Sy build.sh , | 1713 | .Sy build.sh , | |
1724 | many | 1714 | many | |
1725 | .Xr make 1 | 1715 | .Xr make 1 | |
1726 | variables are set for you in order to help encapsulate the build | 1716 | variables are set for you in order to help encapsulate the build | |
1727 | process. | 1717 | process. | |
1728 | In the list of options below, variables that are automatically set by | 1718 | In the list of options below, variables that are automatically set by | |
1729 | .Sy build.sh | 1719 | .Sy build.sh | |
1730 | are noted where applicable. | 1720 | are noted where applicable. | |
1731 | . | 1721 | . | |
1732 | .Pp | 1722 | .Pp | |
1733 | The following operations are supported by | 1723 | The following operations are supported by | |
1734 | .Sy build.sh : | 1724 | .Sy build.sh : | |
1735 | . | 1725 | . | |
1736 | .Bl -tag -width "distribution" | 1726 | .Bl -tag -width "distribution" | |
1737 | . | 1727 | . | |
1738 | .It Sy build | 1728 | .It Sy build | |
1739 | Build the system as per | 1729 | Build the system as per | |
1740 | .Dq make build . | 1730 | .Dq make build . | |
1741 | Before the main part of the build commences, this command runs the | 1731 | Before the main part of the build commences, this command runs the | |
1742 | .Sy obj | 1732 | .Sy obj | |
1743 | operation (unless the | 1733 | operation (unless the | |
1744 | .Fl o | 1734 | .Fl o | |
1745 | option is given), | 1735 | option is given), | |
1746 | .Dq make cleandir | 1736 | .Dq make cleandir | |
1747 | (unless the | 1737 | (unless the | |
1748 | .Fl u | 1738 | .Fl u | |
1749 | option is given), | 1739 | option is given), | |
1750 | and the | 1740 | and the | |
1751 | .Sy tools | 1741 | .Sy tools | |
1752 | operation. | 1742 | operation. | |
1753 | . | 1743 | . | |
1754 | .It Sy distribution | 1744 | .It Sy distribution | |
1755 | Build a full distribution as per | 1745 | Build a full distribution as per | |
1756 | .Dq make distribution . | 1746 | .Dq make distribution . | |
1757 | This command first runs the | 1747 | This command first runs the | |
1758 | .Sy build | 1748 | .Sy build | |
1759 | operation. | 1749 | operation. | |
1760 | . | 1750 | . | |
1761 | .It Sy release | 1751 | .It Sy release | |
1762 | Build a full release as per | 1752 | Build a full release as per | |
1763 | .Dq make release . | 1753 | .Dq make release . | |
1764 | This command first runs the | 1754 | This command first runs the | |
1765 | .Sy distribution | 1755 | .Sy distribution | |
1766 | operation. | 1756 | operation. | |
1767 | . | 1757 | . | |
1768 | .It Sy help | 1758 | .It Sy help | |
1769 | Show a help message, and exit. | 1759 | Show a help message, and exit. | |
1770 | . | 1760 | . | |
1771 | .It Sy makewrapper | 1761 | .It Sy makewrapper | |
1772 | Create the | 1762 | Create the | |
1773 | .Sy \*[toolprefix]make-MACHINE | 1763 | .Sy \*[toolprefix]make-MACHINE | |
1774 | wrapper. | 1764 | wrapper. | |
1775 | This operation is automatically performed for any of the other | 1765 | This operation is automatically performed for any of the other | |
1776 | operations. | 1766 | operations. | |
1777 | . | 1767 | . | |
1778 | .It Sy cleandir | 1768 | .It Sy cleandir | |
1779 | Perform | 1769 | Perform | |
1780 | .Dq make cleandir . | 1770 | .Dq make cleandir . | |
1781 | . | 1771 | . | |
1782 | .It Sy obj | 1772 | .It Sy obj | |
1783 | Perform | 1773 | Perform | |
1784 | .Dq make obj . | 1774 | .Dq make obj . | |
1785 | . | 1775 | . | |
1786 | .It Sy tools | 1776 | .It Sy tools | |
1787 | Build and install the host tools from | 1777 | Build and install the host tools from | |
1788 | .Pa src/tools . | 1778 | .Pa src/tools . | |
1789 | This command will first run | 1779 | This command will first run | |
1790 | .Dq make obj | 1780 | .Dq make obj | |
1791 | and | 1781 | and | |
1792 | .Dq make cleandir | 1782 | .Dq make cleandir | |
1793 | in the | 1783 | in the | |
1794 | .Pa tools | 1784 | .Pa tools | |
1795 | subdirectory unless the | 1785 | subdirectory unless the | |
1796 | .Fl o | 1786 | .Fl o | |
1797 | or | 1787 | or | |
1798 | .Fl u | 1788 | .Fl u | |
1799 | options (respectively) are given. | 1789 | options (respectively) are given. | |
1800 | . | 1790 | . | |
1801 | .It Sy install Ns = Ns Ar idir | 1791 | .It Sy install Ns = Ns Ar idir | |
1802 | Install the contents of | 1792 | Install the contents of | |
1803 | .Sy DESTDIR | 1793 | .Sy DESTDIR | |
1804 | to | 1794 | to | |
1805 | .Ar idir , | 1795 | .Ar idir , | |
1806 | using | 1796 | using | |
1807 | .Dq make installworld . | 1797 | .Dq make installworld . | |
1808 | .Pp | 1798 | .Pp | |
1809 | .Em Note : | 1799 | .Em Note : | |
1810 | Files that are part of the | 1800 | Files that are part of the | |
1811 | .Dq etc | 1801 | .Dq etc | |
1812 | or | 1802 | or | |
1813 | .Dq xetc | 1803 | .Dq xetc | |
1814 | sets will not be installed, unless overridden by | 1804 | sets will not be installed, unless overridden by | |
1815 | the INSTALLSETS environment variable. | 1805 | the INSTALLSETS environment variable. | |
1816 | . | 1806 | . | |
1817 | .It Sy kernel Ns = Ns Ar kconf | 1807 | .It Sy kernel Ns = Ns Ar kconf | |
1818 | Build a new kernel. | 1808 | Build a new kernel. | |
1819 | The | 1809 | The | |
1820 | .Ar kconf | 1810 | .Ar kconf | |
1821 | argument is the name of a configuration file suitable | 1811 | argument is the name of a configuration file suitable | |
1822 | for use by | 1812 | for use by | |
1823 | .Xr config 1 . | 1813 | .Xr config 1 . | |
1824 | If | 1814 | If | |
1825 | .Ar kconf | 1815 | .Ar kconf | |
1826 | does not contain any | 1816 | does not contain any | |
1827 | .Sq / | 1817 | .Sq / | |
1828 | characters, the configuration file is expected to be found in the | 1818 | characters, the configuration file is expected to be found in the | |
1829 | .Sy KERNCONFDIR | 1819 | .Sy KERNCONFDIR | |
1830 | directory, which is typically | 1820 | directory, which is typically | |
1831 | .Pa sys/arch/MACHINE/conf . | 1821 | .Pa sys/arch/MACHINE/conf . | |
1832 | The new kernel will be built in a subdirectory of | 1822 | The new kernel will be built in a subdirectory of | |
1833 | .Sy KERNOBJDIR , | 1823 | .Sy KERNOBJDIR , | |
1834 | which is typically | 1824 | which is typically | |
1835 | .Pa sys/arch/MACHINE/compile | 1825 | .Pa sys/arch/MACHINE/compile | |
1836 | or an associated object directory. | 1826 | or an associated object directory. | |
1837 | .Pp | 1827 | .Pp | |
1838 | This command does | 1828 | This command does | |
1839 | .Em not | 1829 | .Em not | |
1840 | imply the | 1830 | imply the | |
1841 | .Sy tools | 1831 | .Sy tools | |
1842 | command; run the | 1832 | command; run the | |
1843 | .Sy tools | 1833 | .Sy tools | |
1844 | command first unless it is | 1834 | command first unless it is | |
1845 | .Em certain | 1835 | .Em certain | |
1846 | that the tools already exist and are up to date. | 1836 | that the tools already exist and are up to date. | |
1847 | .Pp | 1837 | .Pp | |
1848 | This command will run | 1838 | This command will run | |
1849 | .Dq make cleandir | 1839 | .Dq make cleandir | |
1850 | on the kernel in question first unless the | 1840 | on the kernel in question first unless the | |
1851 | .Fl u | 1841 | .Fl u | |
1852 | option is given. | 1842 | option is given. | |
1853 | . | 1843 | . | |
1854 | .It Sy kernel.gdb Ns = Ns Ar kconf | 1844 | .It Sy kernel.gdb Ns = Ns Ar kconf | |
1855 | Build a new kernel with debug information. | 1845 | Build a new kernel with debug information. | |
1856 | Similar to the above | 1846 | Similar to the above | |
1857 | .Sy kernel Ns = Ns Ar kconf | 1847 | .Sy kernel Ns = Ns Ar kconf | |
1858 | operation, but creates a | 1848 | operation, but creates a | |
1859 | .Pa netbsd.gdb | 1849 | .Pa netbsd.gdb | |
1860 | file alongside of the kernel | 1850 | file alongside of the kernel | |
1861 | .Pa netbsd , | 1851 | .Pa netbsd , | |
1862 | which contains a full symbol table and can be used for debugging | 1852 | which contains a full symbol table and can be used for debugging | |
1863 | (for example with a cross-gdb built by | 1853 | (for example with a cross-gdb built by | |
1864 | .Sy MKCROSSGDB ) . | 1854 | .Sy MKCROSSGDB ) . | |
1865 | .It Sy kernels | 1855 | .It Sy kernels | |
1866 | This command will build all kernels defined in port specific release build | 1856 | This command will build all kernels defined in port specific release build | |
1867 | procedure. | 1857 | procedure. | |
1868 | .Pp | 1858 | .Pp | |
1869 | This command internally calls the | 1859 | This command internally calls the | |
1870 | .Sy kernel Ns = Ns Ar kconf | 1860 | .Sy kernel Ns = Ns Ar kconf | |
1871 | operation for each found kernel configuration file. | 1861 | operation for each found kernel configuration file. | |
1872 | .It Sy modules | 1862 | .It Sy modules | |
1873 | This command will build kernel modules and install them into | 1863 | This command will build kernel modules and install them into | |
1874 | .Sy DESTDIR . | 1864 | .Sy DESTDIR . | |
1875 | . | 1865 | . | |
1876 | .It Sy releasekernel Ns = Ns Ar kconf | 1866 | .It Sy releasekernel Ns = Ns Ar kconf | |
1877 | Install a | 1867 | Install a | |
1878 | .Xr gzip 1 Ns ed | 1868 | .Xr gzip 1 Ns ed | |
1879 | copy of the kernel previously built by | 1869 | copy of the kernel previously built by | |
1880 | .Sy kernel Ns = Ns Ar kconf | 1870 | .Sy kernel Ns = Ns Ar kconf | |
1881 | into | 1871 | into | |
1882 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/kernel , | 1872 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/kernel , | |
1883 | usually as | 1873 | usually as | |
1884 | .Pa netbsd- Ns Ar kconf Ns Pa .gz , | 1874 | .Pa netbsd- Ns Ar kconf Ns Pa .gz , | |
1885 | although the | 1875 | although the | |
1886 | .Dq Pa netbsd | 1876 | .Dq Pa netbsd | |
1887 | prefix is determined from the | 1877 | prefix is determined from the | |
1888 | .Dq Sy config | 1878 | .Dq Sy config | |
1889 | directives in | 1879 | directives in | |
1890 | .Ar kconf . | 1880 | .Ar kconf . | |
1891 | . | 1881 | . | |
1892 | .It Sy sets | 1882 | .It Sy sets | |
1893 | Perform | 1883 | Perform | |
1894 | .Dq make sets . | 1884 | .Dq make sets . | |
1895 | . | 1885 | . | |
1896 | .It Sy sourcesets | 1886 | .It Sy sourcesets | |
1897 | Perform | 1887 | Perform | |
1898 | .Dq make sourcesets . | 1888 | .Dq make sourcesets . | |
1899 | . | 1889 | . | |
1900 | .It Sy syspkgs | 1890 | .It Sy syspkgs | |
1901 | Perform | 1891 | Perform | |
1902 | .Dq make syspkgs . | 1892 | .Dq make syspkgs . | |
1903 | . | 1893 | . | |
1904 | .It Sy iso-image | 1894 | .It Sy iso-image | |
1905 | Perform | 1895 | Perform | |
1906 | .Dq make iso-image . | 1896 | .Dq make iso-image . | |
1907 | . | 1897 | . | |
1908 | .It Sy iso-image-source | 1898 | .It Sy iso-image-source | |
1909 | Perform | 1899 | Perform | |
1910 | .Dq make iso-image-source . | 1900 | .Dq make iso-image-source . | |
1911 | . | 1901 | . | |
1912 | .It Sy install-image | 1902 | .It Sy install-image | |
1913 | Perform | 1903 | Perform | |
1914 | .Dq make install-image . | 1904 | .Dq make install-image . | |
1915 | . | 1905 | . | |
1916 | .It Sy live-image | 1906 | .It Sy live-image | |
1917 | Perform | 1907 | Perform | |
1918 | .Dq make live-image . | 1908 | .Dq make live-image . | |
1919 | . | 1909 | . | |
1920 | .It Sy list-arch | 1910 | .It Sy list-arch | |
1921 | Show a list of valid | 1911 | Show a list of valid | |
1922 | .Sy MACHINE | 1912 | .Sy MACHINE | |
1923 | and | 1913 | and | |
1924 | .Sy MACHINE_ARCH | 1914 | .Sy MACHINE_ARCH | |
1925 | settings, the default | 1915 | settings, the default | |
1926 | .Sy MACHINE_ARCH | 1916 | .Sy MACHINE_ARCH | |
1927 | for each | 1917 | for each | |
1928 | .Sy MACHINE , | 1918 | .Sy MACHINE , | |
1929 | and aliases for | 1919 | and aliases for | |
1930 | .Sy MACHINE Ns No / Ns Sy MACHINE_ARCH | 1920 | .Sy MACHINE Ns No / Ns Sy MACHINE_ARCH | |
1931 | pairs, and then exits. | 1921 | pairs, and then exits. | |
1932 | The | 1922 | The | |
1933 | .Fl m | 1923 | .Fl m | |
1934 | or | 1924 | or | |
1935 | .Fl a | 1925 | .Fl a | |
1936 | options (or both) may be used to specify glob patterns | 1926 | options (or both) may be used to specify glob patterns | |
1937 | that will be used to narrow the list of results; | 1927 | that will be used to narrow the list of results; | |
1938 | for example, | 1928 | for example, | |
1939 | .Dq Li build.sh -m 'evb*' -a '*arm*' list-arch | 1929 | .Dq Li build.sh -m 'evb*' -a '*arm*' list-arch | |
1940 | will list all known | 1930 | will list all known | |
1941 | .Sy MACHINE Ns No / Ns Sy MACHINE_ARCH | 1931 | .Sy MACHINE Ns No / Ns Sy MACHINE_ARCH | |
1942 | values in which either | 1932 | values in which either | |
1943 | .Sy MACHINE | 1933 | .Sy MACHINE | |
1944 | or | 1934 | or | |
1945 | .Sy ALIAS | 1935 | .Sy ALIAS | |
1946 | matches the pattern | 1936 | matches the pattern | |
1947 | .Ql evb* , | 1937 | .Ql evb* , | |
1948 | and | 1938 | and | |
1949 | .Sy MACHINE_ARCH | 1939 | .Sy MACHINE_ARCH | |
1950 | matches the pattern | 1940 | matches the pattern | |
1951 | .Ql *arm* . | 1941 | .Ql *arm* . | |
1952 | . | 1942 | . | |
1953 | .El | 1943 | .El | |
1954 | . | 1944 | . | |
1955 | .Pp | 1945 | .Pp | |
1956 | The following command line options alter the behaviour of the | 1946 | The following command line options alter the behaviour of the | |
1957 | .Sy build.sh | 1947 | .Sy build.sh | |
1958 | operations described above: | 1948 | operations described above: | |
1959 | . | 1949 | . | |
1960 | .Bl -tag -width "-T tools" | 1950 | .Bl -tag -width "-T tools" | |
1961 | . | 1951 | . | |
1962 | .It Fl a Ar arch | 1952 | .It Fl a Ar arch | |
1963 | Set the value of | 1953 | Set the value of | |
1964 | .Sy MACHINE_ARCH | 1954 | .Sy MACHINE_ARCH | |
1965 | to | 1955 | to | |
1966 | .Ar arch . | 1956 | .Ar arch . | |
1967 | See the | 1957 | See the | |
1968 | .Fl m | 1958 | .Fl m | |
1969 | option for more information. | 1959 | option for more information. | |
1970 | . | 1960 | . | |
1971 | .It Fl B Ar buildid | 1961 | .It Fl B Ar buildid | |
1972 | Set the value of | 1962 | Set the value of | |
1973 | .Sy BUILDID | 1963 | .Sy BUILDID | |
1974 | to | 1964 | to | |
1975 | .Ar buildid . | 1965 | .Ar buildid . | |
1976 | This will also append the build identifier to the name of the | 1966 | This will also append the build identifier to the name of the | |
1977 | .Dq make | 1967 | .Dq make | |
1978 | wrapper script so that the resulting name is of the form | 1968 | wrapper script so that the resulting name is of the form | |
1979 | .Dq Sy \*[toolprefix]make-MACHINE-BUILDID . | 1969 | .Dq Sy \*[toolprefix]make-MACHINE-BUILDID . | |
1980 | . | 1970 | . | |
1981 | .It Fl C Ar cdextras | 1971 | .It Fl C Ar cdextras | |
1982 | Append | 1972 | Append | |
1983 | .Ar cdextras | 1973 | .Ar cdextras | |
1984 | to the | 1974 | to the | |
1985 | .Sy CDEXTRA | 1975 | .Sy CDEXTRA | |
1986 | variable, | 1976 | variable, | |
1987 | which is a space-separated list of files or directories that will be | 1977 | which is a space-separated list of files or directories that will be | |
1988 | added to the CD-ROM image that may be create by the | 1978 | added to the CD-ROM image that may be create by the | |
1989 | .Dq iso-image | 1979 | .Dq iso-image | |
1990 | or | 1980 | or | |
1991 | .Dq iso-image-source | 1981 | .Dq iso-image-source | |
1992 | operations. | 1982 | operations. | |
1993 | Files will be added to the root of the CD-ROM image, whereas directories | 1983 | Files will be added to the root of the CD-ROM image, whereas directories | |
1994 | will be copied recursively. | 1984 | will be copied recursively. | |
1995 | If relative paths are specified, they will be converted to | 1985 | If relative paths are specified, they will be converted to | |
1996 | absolute paths before being used. | 1986 | absolute paths before being used. | |
1997 | Multiple paths may be specified via multiple | 1987 | Multiple paths may be specified via multiple | |
1998 | .Fl C | 1988 | .Fl C | |
1999 | options, or via a single option whose argument contains multiple | 1989 | options, or via a single option whose argument contains multiple | |
2000 | space-separated paths. | 1990 | space-separated paths. | |
2001 | . | 1991 | . | |
2002 | .It Fl c Ar compiler | 1992 | .It Fl c Ar compiler | |
2003 | Select the compiler for the toolchain to build | 1993 | Select the compiler for the toolchain to build | |
2004 | .Nx | 1994 | .Nx | |
2005 | and for inclusion in the | 1995 | and for inclusion in the | |
2006 | .Nx | 1996 | .Nx | |
2007 | distribution. | 1997 | distribution. | |
2008 | Supported choices: | 1998 | Supported choices: | |
2009 | .Bl -inset -offset indent | 1999 | .Bl -inset -offset indent | |
2010 | .It clang | 2000 | .It clang | |
2011 | .It gcc | 2001 | .It gcc | |
2012 | [default] | 2002 | [default] | |
2013 | .El | 2003 | .El | |
2014 | .Pp | 2004 | .Pp | |
2015 | The compiler used to build the toolchain can be different; see | 2005 | The compiler used to build the toolchain can be different; see | |
2016 | .Sy HOST_CC | 2006 | .Sy HOST_CC | |
2017 | and | 2007 | and | |
2018 | .Sy HOST_CXX . | 2008 | .Sy HOST_CXX . | |
2019 | .It Fl D Ar dest | 2009 | .It Fl D Ar dest | |
2020 | Set the value of | 2010 | Set the value of | |
2021 | .Sy DESTDIR | 2011 | .Sy DESTDIR | |
2022 | to | 2012 | to | |
2023 | .Ar dest . | 2013 | .Ar dest . | |
2024 | If a relative path is specified, it will be converted to an | 2014 | If a relative path is specified, it will be converted to an | |
2025 | absolute path before being used. | 2015 | absolute path before being used. | |
2026 | . | 2016 | . | |
2027 | .It Fl E | 2017 | .It Fl E | |
2028 | Set | 2018 | Set | |
2029 | .Sq expert | 2019 | .Sq expert | |
2030 | mode. | 2020 | mode. | |
2031 | This overrides various sanity checks, and allows: | 2021 | This overrides various sanity checks, and allows: | |
2032 | .Sy DESTDIR | 2022 | .Sy DESTDIR | |
2033 | does not have to be set to a non-root path for builds, | 2023 | does not have to be set to a non-root path for builds, | |
2034 | and | 2024 | and | |
2035 | .Sy MKUNPRIVED=yes | 2025 | .Sy MKUNPRIVED=yes | |
2036 | does not have to be set when building as a non-root user. | 2026 | does not have to be set when building as a non-root user. | |
2037 | .Pp | 2027 | .Pp | |
2038 | .Em Note : | 2028 | .Em Note : | |
2039 | It is highly recommended that you know what you are doing when | 2029 | It is highly recommended that you know what you are doing when | |
2040 | you use this option. | 2030 | you use this option. | |
2041 | . | 2031 | . | |
2042 | .It Fl h | 2032 | .It Fl h | |
2043 | Show a help message, and exit. | 2033 | Show a help message, and exit. | |
2044 | . | 2034 | . | |
2045 | .It Fl j Ar njob | 2035 | .It Fl j Ar njob | |
2046 | Run up to | 2036 | Run up to | |
2047 | .Ar njob | 2037 | .Ar njob | |
2048 | .Xr make 1 | 2038 | .Xr make 1 | |
2049 | subjobs in parallel; | 2039 | subjobs in parallel; | |
2050 | passed through to | 2040 | passed through to | |
2051 | .Xr make 1 . | 2041 | .Xr make 1 . | |
2052 | If you see failures for reasons other than running out of memory | 2042 | If you see failures for reasons other than running out of memory | |
2053 | while using | 2043 | while using | |
2054 | .Sy build.sh | 2044 | .Sy build.sh | |
2055 | with | 2045 | with | |
2056 | .Fl j , | 2046 | .Fl j , | |
2057 | please save complete build logs | 2047 | please save complete build logs | |
2058 | so the failures can be analyzed. | 2048 | so the failures can be analyzed. | |
2059 | .Pp | 2049 | .Pp | |
2060 | To achieve the fastest builds, | 2050 | To achieve the fastest builds, | |
2061 | .Fl j | 2051 | .Fl j | |
2062 | values between (1 + the number of CPUs) and (2 * the number of CPUs) | 2052 | values between (1 + the number of CPUs) and (2 * the number of CPUs) | |
2063 | are recommended. | 2053 | are recommended. | |
2064 | Use lower values on machines with limited memory or I/O bandwidth. | 2054 | Use lower values on machines with limited memory or I/O bandwidth. | |
2065 | . | 2055 | . | |
2066 | .It Fl M Ar obj | 2056 | .It Fl M Ar obj | |
2067 | Set | 2057 | Set | |
2068 | .Sy MAKEOBJDIRPREFIX | 2058 | .Sy MAKEOBJDIRPREFIX | |
2069 | to | 2059 | to | |
2070 | .Ar obj . | 2060 | .Ar obj . | |
2071 | Unsets | 2061 | Unsets | |
2072 | .Sy MAKEOBJDIR . | 2062 | .Sy MAKEOBJDIR . | |
2073 | See | 2063 | See | |
2074 | .Dq Fl O Ar obj | 2064 | .Dq Fl O Ar obj | |
2075 | for more information. | 2065 | for more information. | |
2076 | .Pp | 2066 | .Pp | |
2077 | For instance, if the source directory is | 2067 | For instance, if the source directory is | |
2078 | .Pa /usr/src , | 2068 | .Pa /usr/src , | |
2079 | a setting of | 2069 | a setting of | |
2080 | .Dq Fl M Pa /usr/obj | 2070 | .Dq Fl M Pa /usr/obj | |
2081 | will place build-time files under | 2071 | will place build-time files under | |
2082 | .Pa /usr/obj/usr/src/bin , | 2072 | .Pa /usr/obj/usr/src/bin , | |
2083 | .Pa /usr/obj/usr/src/lib , | 2073 | .Pa /usr/obj/usr/src/lib , | |
2084 | .Pa /usr/obj/usr/src/usr.bin , | 2074 | .Pa /usr/obj/usr/src/usr.bin , | |
2085 | and so forth. | 2075 | and so forth. | |
2086 | .Pp | 2076 | .Pp | |
2087 | If a relative path is specified, it will be converted to an | 2077 | If a relative path is specified, it will be converted to an | |
2088 | absolute path before being used. | 2078 | absolute path before being used. | |
2089 | .Sy build.sh | 2079 | .Sy build.sh | |
2090 | imposes the restriction that the argument to the | 2080 | imposes the restriction that the argument to the | |
2091 | .Fl M | 2081 | .Fl M | |
2092 | option must not begin with a | 2082 | option must not begin with a | |
2093 | .Dq \&$ | 2083 | .Dq \&$ | |
2094 | (dollar sign) | 2084 | (dollar sign) | |
2095 | character; otherwise it would be too difficult | 2085 | character; otherwise it would be too difficult | |
2096 | to determine whether the value is an absolute or a relative path. | 2086 | to determine whether the value is an absolute or a relative path. | |
2097 | If the directory does not already exist, | 2087 | If the directory does not already exist, | |
2098 | .Sy build.sh | 2088 | .Sy build.sh | |
2099 | will create it. | 2089 | will create it. | |
2100 | . | 2090 | . | |
2101 | .It Fl m Ar mach | 2091 | .It Fl m Ar mach | |
2102 | Set the value of | 2092 | Set the value of | |
2103 | .Sy MACHINE | 2093 | .Sy MACHINE | |
2104 | to | 2094 | to | |
2105 | .Ar mach , | 2095 | .Ar mach , | |
2106 | unless the | 2096 | unless the | |
2107 | .Ar mach | 2097 | .Ar mach | |
2108 | argument is an alias that refers to a | 2098 | argument is an alias that refers to a | |
2109 | .Sy MACHINE Ns No / Ns Sy MACHINE_ARCH | 2099 | .Sy MACHINE Ns No / Ns Sy MACHINE_ARCH | |
2110 | pair, in which case both | 2100 | pair, in which case both | |
2111 | .Sy MACHINE | 2101 | .Sy MACHINE | |
2112 | and | 2102 | and | |
2113 | .Sy MACHINE_ARCH | 2103 | .Sy MACHINE_ARCH | |
2114 | are set from the alias. | 2104 | are set from the alias. | |
2115 | Such aliases are interpreted entirely by | 2105 | Such aliases are interpreted entirely by | |
2116 | .Sy build.sh ; | 2106 | .Sy build.sh ; | |
2117 | they are not used by any other part of the build system. | 2107 | they are not used by any other part of the build system. | |
2118 | The | 2108 | The | |
2119 | .Sy MACHINE_ARCH | 2109 | .Sy MACHINE_ARCH | |
2120 | setting implied by | 2110 | setting implied by | |
2121 | .Ar mach | 2111 | .Ar mach | |
2122 | will override any value of | 2112 | will override any value of | |
2123 | .Sy MACHINE_ARCH | 2113 | .Sy MACHINE_ARCH | |
2124 | in the process environment, but will not override a value set by the | 2114 | in the process environment, but will not override a value set by the | |
2125 | .Fl a | 2115 | .Fl a | |
2126 | option. | 2116 | option. | |
2127 | All cross builds require | 2117 | All cross builds require | |
2128 | .Fl m , | 2118 | .Fl m , | |
2129 | but if unset on a NetBSD host, the host's value of MACHINE will be | 2119 | but if unset on a NetBSD host, the host's value of MACHINE will be | |
2130 | detected and used automatically. | 2120 | detected and used automatically. | |
2131 | .Pp | 2121 | .Pp | |
2132 | See the | 2122 | See the | |
2133 | .Cm list-arch | 2123 | .Cm list-arch | |
2134 | operation for a way to get a list of valid | 2124 | operation for a way to get a list of valid | |
2135 | .Sy MACHINE | 2125 | .Sy MACHINE | |
2136 | and | 2126 | and | |
2137 | .Sy MACHINE_ARCH | 2127 | .Sy MACHINE_ARCH | |
2138 | settings. | 2128 | settings. | |
2139 | . | 2129 | . | |
2140 | .It Fl N Ar noiselevel | 2130 | .It Fl N Ar noiselevel | |
2141 | Set the | 2131 | Set the | |
2142 | .Dq noisyness | 2132 | .Dq noisyness | |
2143 | level of the build, by setting | 2133 | level of the build, by setting | |
2144 | .Sy MAKEVERBOSE | 2134 | .Sy MAKEVERBOSE | |
2145 | to | 2135 | to | |
2146 | .Ar noiselevel . | 2136 | .Ar noiselevel . | |
2147 | . | 2137 | . | |
2148 | .It Fl n | 2138 | .It Fl n | |
2149 | Show the commands that would be executed by | 2139 | Show the commands that would be executed by | |
2150 | .Sy build.sh , | 2140 | .Sy build.sh , | |
2151 | but do not make any changes. | 2141 | but do not make any changes. | |
2152 | This is similar in concept to | 2142 | This is similar in concept to | |
2153 | .Dq make -n . | 2143 | .Dq make -n . | |
2154 | . | 2144 | . | |
2155 | .It Fl O Ar obj | 2145 | .It Fl O Ar obj | |
2156 | Create an appropriate transform macro for | 2146 | Create an appropriate transform macro for | |
2157 | .Sy MAKEOBJDIR | 2147 | .Sy MAKEOBJDIR | |
2158 | that will place the built object files under | 2148 | that will place the built object files under | |
2159 | .Ar obj . | 2149 | .Ar obj . | |
2160 | Unsets | 2150 | Unsets | |
2161 | .Sy MAKEOBJDIRPREFIX . | 2151 | .Sy MAKEOBJDIRPREFIX . | |
2162 | .Pp | 2152 | .Pp | |
2163 | For instance, a setting of | 2153 | For instance, a setting of | |
2164 | .Dq Fl O Pa /usr/obj | 2154 | .Dq Fl O Pa /usr/obj | |
2165 | will place build-time files under | 2155 | will place build-time files under | |
2166 | .Pa /usr/obj/bin , | 2156 | .Pa /usr/obj/bin , | |
2167 | .Pa /usr/obj/lib , | 2157 | .Pa /usr/obj/lib , | |
2168 | .Pa /usr/obj/usr.bin , | 2158 | .Pa /usr/obj/usr.bin , | |
2169 | and so forth. | 2159 | and so forth. | |
2170 | .Pp | 2160 | .Pp | |
2171 | If a relative path is specified, it will be converted to an | 2161 | If a relative path is specified, it will be converted to an | |
2172 | absolute path before being used. | 2162 | absolute path before being used. | |
2173 | .Sy build.sh | 2163 | .Sy build.sh | |
2174 | imposes the restriction that the argument to the | 2164 | imposes the restriction that the argument to the | |
2175 | .Fl O | 2165 | .Fl O | |
2176 | option must not contain a | 2166 | option must not contain a | |
2177 | .Dq \&$ | 2167 | .Dq \&$ | |
2178 | (dollar sign) | 2168 | (dollar sign) | |
2179 | character. | 2169 | character. | |
2180 | If the directory does not already exist, | 2170 | If the directory does not already exist, | |
2181 | .Sy build.sh | 2171 | .Sy build.sh | |
2182 | will create it. | 2172 | will create it. | |
2183 | .Pp | 2173 | .Pp | |
2184 | In normal use, exactly one of the | 2174 | In normal use, exactly one of the | |
2185 | .Fl M | 2175 | .Fl M | |
2186 | or | 2176 | or | |
2187 | .Fl O | 2177 | .Fl O | |
2188 | options should be specified. | 2178 | options should be specified. | |
2189 | If neither | 2179 | If neither | |
2190 | .Fl M | 2180 | .Fl M | |
2191 | nor | 2181 | nor | |
2192 | .Fl O | 2182 | .Fl O | |
2193 | is specified, then a default object directory will be chosen | 2183 | is specified, then a default object directory will be chosen | |
2194 | according to rules in | 2184 | according to rules in | |
2195 | .Aq bsd.obj.mk . | 2185 | .Aq bsd.obj.mk . | |
2196 | Relying on this default is not recommended because | 2186 | Relying on this default is not recommended because | |
2197 | it is determined by complex rules that are influenced | 2187 | it is determined by complex rules that are influenced | |
2198 | by the values of several variables and | 2188 | by the values of several variables and | |
2199 | by the location of the source directory. | 2189 | by the location of the source directory. | |
2200 | .Pp | 2190 | .Pp | |
2201 | .Em Note : | 2191 | .Em Note : | |
2202 | Placing the | 2192 | Placing the | |
2203 | .Ar obj | 2193 | .Ar obj | |
2204 | directory location outside of the default source tree hierarchy makes | 2194 | directory location outside of the default source tree hierarchy makes | |
2205 | it easier to manually clear out old files in the event the | 2195 | it easier to manually clear out old files in the event the | |
2206 | .Dq make cleandir | 2196 | .Dq make cleandir | |
2207 | operation is unable to do so. | 2197 | operation is unable to do so. | |
2208 | (See | 2198 | (See | |
2209 | .Sx CAVEATS | 2199 | .Sx CAVEATS | |
2210 | below.) | 2200 | below.) | |
2211 | .Pp | 2201 | .Pp | |
2212 | .Em Note : | 2202 | .Em Note : | |
2213 | The use of one of | 2203 | The use of one of | |
2214 | .Fl M | 2204 | .Fl M | |
2215 | or | 2205 | or | |
2216 | .Fl O | 2206 | .Fl O | |
2217 | is the only means of building multiple machine architecture userlands | 2207 | is the only means of building multiple machine architecture userlands | |
2218 | from the same source tree without cleaning between builds (in which | 2208 | from the same source tree without cleaning between builds (in which | |
2219 | case, one would specify distinct | 2209 | case, one would specify distinct | |
2220 | .Ar obj | 2210 | .Ar obj | |
2221 | locations for each). | 2211 | locations for each). | |
2222 | . | 2212 | . | |
2223 | .It Fl o | 2213 | .It Fl o | |
2224 | Set the value of | 2214 | Set the value of | |
2225 | .Sy MKOBJDIRS | 2215 | .Sy MKOBJDIRS | |
2226 | to | 2216 | to | |
2227 | .Dq no . | 2217 | .Dq no . | |
2228 | Otherwise, it will be automatically set to | 2218 | Otherwise, it will be automatically set to | |
2229 | .Dq yes . | 2219 | .Dq yes . | |
2230 | This default is opposite to the behaviour when not using | 2220 | This default is opposite to the behaviour when not using | |
2231 | .Sy build.sh . | 2221 | .Sy build.sh . | |
2232 | . | 2222 | . | |
2233 | .It Fl P | 2223 | .It Fl P | |
2234 | Set the value of | 2224 | Set the value of | |
2235 | .Sy MKREPRO | 2225 | .Sy MKREPRO | |
2236 | and | 2226 | and | |
2237 | .Sy MKREPRO_TIMESTAMP | 2227 | .Sy MKREPRO_TIMESTAMP | |
2238 | to the latest source CVS timestamp for reproducible builds. | 2228 | to the latest source CVS timestamp for reproducible builds. | |
2239 | . | 2229 | . | |
2240 | .It Fl R Ar rel | 2230 | .It Fl R Ar rel | |
2241 | Set the value of | 2231 | Set the value of | |
2242 | .Sy RELEASEDIR | 2232 | .Sy RELEASEDIR | |
2243 | to | 2233 | to | |
2244 | .Ar rel . | 2234 | .Ar rel . | |
2245 | If a relative path is specified, it will be converted to an | 2235 | If a relative path is specified, it will be converted to an | |
2246 | absolute path before being used. | 2236 | absolute path before being used. | |
2247 | . | 2237 | . | |
2248 | .It Fl r | 2238 | .It Fl r | |
2249 | Remove the contents of | 2239 | Remove the contents of | |
2250 | .Sy DESTDIR | 2240 | .Sy DESTDIR | |
2251 | and | 2241 | and | |
2252 | .Sy TOOLDIR | 2242 | .Sy TOOLDIR | |
2253 | before building (provides a clean starting point). | 2243 | before building (provides a clean starting point). | |
2254 | This will skip deleting | 2244 | This will skip deleting | |
2255 | .Sy DESTDIR | 2245 | .Sy DESTDIR | |
2256 | if building on a native system to the root directory. | 2246 | if building on a native system to the root directory. | |
2257 | . | 2247 | . | |
2258 | .It Fl S Ar seed | 2248 | .It Fl S Ar seed | |
2259 | Change the value of | 2249 | Change the value of | |
2260 | .Sy BUILDSEED | 2250 | .Sy BUILDSEED | |
2261 | to | 2251 | to | |
2262 | .Ar seed . | 2252 | .Ar seed . | |
2263 | This should rarely be necessary. | 2253 | This should rarely be necessary. | |
2264 | . | 2254 | . | |
2265 | .It Fl T Ar tools | 2255 | .It Fl T Ar tools | |
2266 | Set the value of | 2256 | Set the value of | |
2267 | .Sy TOOLDIR | 2257 | .Sy TOOLDIR | |
2268 | to | 2258 | to | |
2269 | .Ar tools . | 2259 | .Ar tools . | |
2270 | If a relative path is specified, it will be converted to an | 2260 | If a relative path is specified, it will be converted to an | |
2271 | absolute path before being used. | 2261 | absolute path before being used. | |
2272 | If set, the bootstrap | 2262 | If set, the bootstrap | |
2273 | .Dq make | 2263 | .Dq make | |
2274 | will only be rebuilt if the source files for | 2264 | will only be rebuilt if the source files for | |
2275 | .Xr make 1 | 2265 | .Xr make 1 | |
2276 | have changed. | 2266 | have changed. | |
2277 | . | 2267 | . | |
2278 | .It Fl U | 2268 | .It Fl U | |
2279 | Set | 2269 | Set | |
2280 | .Sy MKUNPRIVED=yes . | 2270 | .Sy MKUNPRIVED=yes . | |
2281 | . | 2271 | . | |
2282 | .It Fl u | 2272 | .It Fl u | |
2283 | Set | 2273 | Set | |
2284 | .Sy MKUPDATE=yes . | 2274 | .Sy MKUPDATE=yes . | |
2285 | . | 2275 | . | |
2286 | .It Xo | 2276 | .It Xo | |
2287 | .Fl V | 2277 | .Fl V | |
2288 | .Sm off | 2278 | .Sm off | |
2289 | .Ar var | 2279 | .Ar var | |
2290 | .Li = | 2280 | .Li = | |
2291 | .Op Ar value | 2281 | .Op Ar value | |
2292 | .Sm on | 2282 | .Sm on | |
2293 | .Xc | 2283 | .Xc | |
2294 | Set the environment variable | 2284 | Set the environment variable | |
2295 | .Ar var | 2285 | .Ar var | |
2296 | to an optional | 2286 | to an optional | |
2297 | .Ar value . | 2287 | .Ar value . | |
2298 | This is propagated to the | 2288 | This is propagated to the | |
2299 | .Sy \*[toolprefix]make | 2289 | .Sy \*[toolprefix]make | |
2300 | wrapper. | 2290 | wrapper. | |
2301 | . | 2291 | . | |
2302 | .It Fl w Ar wrapper | 2292 | .It Fl w Ar wrapper | |
2303 | Create the | 2293 | Create the | |
2304 | .Sy \*[toolprefix]make | 2294 | .Sy \*[toolprefix]make | |
2305 | wrapper script (see below) in a custom location, | 2295 | wrapper script (see below) in a custom location, | |
2306 | specified by | 2296 | specified by | |
2307 | .Ar wrapper . | 2297 | .Ar wrapper . | |
2308 | This allows, for instance, to place the wrapper in | 2298 | This allows, for instance, to place the wrapper in | |
2309 | .Sy PATH | 2299 | .Sy PATH | |
2310 | automatically. | 2300 | automatically. | |
2311 | .Pp | 2301 | .Pp | |
2312 | .Em Note : | 2302 | .Em Note : | |
2313 | .Ar wrapper | 2303 | .Ar wrapper | |
2314 | is the full name of the file, not just a directory name. | 2304 | is the full name of the file, not just a directory name. | |
2315 | If a relative path is specified, it will be converted to an | 2305 | If a relative path is specified, it will be converted to an | |
2316 | absolute path before being used. | 2306 | absolute path before being used. | |
2317 | . | 2307 | . | |
2318 | .It Fl X Ar x11src | 2308 | .It Fl X Ar x11src | |
2319 | Set the value of | 2309 | Set the value of | |
2320 | .Sy X11SRCDIR | 2310 | .Sy X11SRCDIR | |
2321 | to | 2311 | to | |
2322 | .Ar x11src . | 2312 | .Ar x11src . | |
2323 | If a relative path is specified, it will be converted to an | 2313 | If a relative path is specified, it will be converted to an | |
2324 | absolute path before being used. | 2314 | absolute path before being used. | |
2325 | . | 2315 | . | |
2326 | .It Fl x | 2316 | .It Fl x | |
2327 | Set | 2317 | Set | |
2328 | .Sy MKX11=yes . | 2318 | .Sy MKX11=yes . | |
2329 | . | 2319 | . | |
2330 | .It Fl Z Ar var | 2320 | .It Fl Z Ar var | |
2331 | Unset ("zap") the environment variable | 2321 | Unset ("zap") the environment variable | |
2332 | .Ar var . | 2322 | .Ar var . | |
2333 | This is propagated to the | 2323 | This is propagated to the | |
2334 | .Sy \*[toolprefix]make | 2324 | .Sy \*[toolprefix]make | |
2335 | wrapper. | 2325 | wrapper. | |
2336 | . | 2326 | . | |
2337 | .It Fl ? | 2327 | .It Fl ? | |
2338 | Show a help message, and exit. | 2328 | Show a help message, and exit. | |
2339 | . | 2329 | . | |
2340 | .El | 2330 | .El | |
2341 | . | 2331 | . | |
2342 | .Ss The \*q\*[toolprefix]make-MACHINE\*q wrapper script | 2332 | .Ss The \*q\*[toolprefix]make-MACHINE\*q wrapper script | |
2343 | . | 2333 | . | |
2344 | If using the | 2334 | If using the | |
2345 | .Sy build.sh | 2335 | .Sy build.sh | |
2346 | script to build | 2336 | script to build | |
2347 | .Nx , | 2337 | .Nx , | |
2348 | a | 2338 | a | |
2349 | .Sy \*[toolprefix]make-MACHINE | 2339 | .Sy \*[toolprefix]make-MACHINE | |
2350 | script will be created in | 2340 | script will be created in | |
2351 | .Sy TOOLDIR Ns Pa /bin | 2341 | .Sy TOOLDIR Ns Pa /bin | |
2352 | upon the first build to assist in building subtrees on a cross-compile | 2342 | upon the first build to assist in building subtrees on a cross-compile | |
2353 | host. | 2343 | host. | |
2354 | .Pp | 2344 | .Pp | |
2355 | .Sy \*[toolprefix]make-MACHINE | 2345 | .Sy \*[toolprefix]make-MACHINE | |
2356 | can be invoked in lieu of | 2346 | can be invoked in lieu of | |
2357 | .Xr make 1 , | 2347 | .Xr make 1 , | |
2358 | and will instead call the up-to-date version of | 2348 | and will instead call the up-to-date version of | |
2359 | .Dq \*[toolprefix]make | 2349 | .Dq \*[toolprefix]make | |
2360 | installed into | 2350 | installed into | |
2361 | .Sy TOOLDIR Ns Pa /bin | 2351 | .Sy TOOLDIR Ns Pa /bin | |
2362 | with several key variables pre-set, including | 2352 | with several key variables pre-set, including | |
2363 | .Sy MACHINE , MACHINE_ARCH , | 2353 | .Sy MACHINE , MACHINE_ARCH , | |
2364 | and | 2354 | and | |
2365 | .Sy TOOLDIR . | 2355 | .Sy TOOLDIR . | |
2366 | .Sy \*[toolprefix]make-MACHINE | 2356 | .Sy \*[toolprefix]make-MACHINE | |
2367 | will also set variables specified with | 2357 | will also set variables specified with | |
2368 | .Fl V , | 2358 | .Fl V , | |
2369 | and unset variables specified with | 2359 | and unset variables specified with | |
2370 | .Fl Z . | 2360 | .Fl Z . | |
2371 | .Pp | 2361 | .Pp | |
2372 | This script can be symlinked into a directory listed in | 2362 | This script can be symlinked into a directory listed in | |
2373 | .Sy PATH , | 2363 | .Sy PATH , | |
2374 | or called with an absolute path. | 2364 | or called with an absolute path. | |
2375 | . | 2365 | . | |
2376 | .Sh EXAMPLES | 2366 | .Sh EXAMPLES | |
2377 | . | 2367 | . | |
2378 | .Bl -enum | 2368 | .Bl -enum | |
2379 | . | 2369 | . | |
2380 | .It | 2370 | .It | |
2381 | .Li "% ./build.sh [OPTIONS] tools kernel=GENERIC" | 2371 | .Li "% ./build.sh [OPTIONS] tools kernel=GENERIC" | |
2382 | .Pp | 2372 | .Pp | |
2383 | Build a new toolchain, and use the new toolchain to | 2373 | Build a new toolchain, and use the new toolchain to | |
2384 | configure and build a new GENERIC kernel. | 2374 | configure and build a new GENERIC kernel. | |
2385 | . | 2375 | . | |
2386 | .It | 2376 | .It | |
2387 | .Li "% ./build.sh [OPTIONS] -U distribution" | 2377 | .Li "% ./build.sh [OPTIONS] -U distribution" | |
2388 | .Pp | 2378 | .Pp | |
2389 | Using unprivileged mode, | 2379 | Using unprivileged mode, | |
2390 | build a complete distribution to a | 2380 | build a complete distribution to a | |
2391 | .Sy DESTDIR | 2381 | .Sy DESTDIR | |
2392 | directory that | 2382 | directory that | |
2393 | .Sy build.sh | 2383 | .Sy build.sh | |
2394 | selects (and will show). | 2384 | selects (and will show). | |
2395 | . | 2385 | . | |
2396 | .It | 2386 | .It | |
2397 | .Li "# ./build.sh [OPTIONS] -U install=/" | 2387 | .Li "# ./build.sh [OPTIONS] -U install=/" | |
2398 | .Pp | 2388 | .Pp | |
2399 | As root, install to | 2389 | As root, install to | |
2400 | .Pa / | 2390 | .Pa / | |
2401 | the distribution that was built | 2391 | the distribution that was built | |
2402 | by example 2. | 2392 | by example 2. | |
2403 | Even though this is run as root, | 2393 | Even though this is run as root, | |
2404 | .Fl U | 2394 | .Fl U | |
2405 | is required so that the permissions stored in | 2395 | is required so that the permissions stored in | |
2406 | .Sy DESTDIR Ns Pa /METALOG | 2396 | .Sy DESTDIR Ns Pa /METALOG | |
2407 | are correctly applied to the files as they're copied to | 2397 | are correctly applied to the files as they're copied to | |
2408 | .Pa / . | 2398 | .Pa / . | |
2409 | . | 2399 | . | |
2410 | .It | 2400 | .It | |
2411 | .Li "% ./build.sh [OPTIONS] -U -u release" | 2401 | .Li "% ./build.sh [OPTIONS] -U -u release" | |
2412 | .Pp | 2402 | .Pp | |
2413 | Using unprivileged mode, | 2403 | Using unprivileged mode, | |
2414 | build a complete release to | 2404 | build a complete release to | |
2415 | .Sy DESTDIR | 2405 | .Sy DESTDIR | |
2416 | and | 2406 | and | |
2417 | .Sy RELEASEDIR | 2407 | .Sy RELEASEDIR | |
2418 | directories that | 2408 | directories that | |
2419 | .Sy build.sh | 2409 | .Sy build.sh | |
2420 | selects (and will show). | 2410 | selects (and will show). | |
2421 | .Sy MKUPDATE=yes | 2411 | .Sy MKUPDATE=yes | |
2422 | .Pq Fl u | 2412 | .Pq Fl u | |
2423 | is set to prevent the | 2413 | is set to prevent the | |
2424 | .Dq make cleandir , | 2414 | .Dq make cleandir , | |
2425 | so that if this is run after example 2, it doesn't need to redo that | 2415 | so that if this is run after example 2, it doesn't need to redo that | |
2426 | portion of the release build. | 2416 | portion of the release build. | |
2427 | .El | 2417 | .El | |
2428 | . | 2418 | . | |
2429 | .Sh OBSOLETE VARIABLES | 2419 | .Sh OBSOLETE VARIABLES | |
2430 | . | 2420 | . | |
2431 | .Bl -tag -width "NBUILDJOBS" | 2421 | .Bl -tag -width "NBUILDJOBS" | |
2432 | . | 2422 | . | |
2433 | .It Sy NBUILDJOBS | 2423 | .It Sy NBUILDJOBS | |
2434 | Use the | 2424 | Use the | |
2425 | .Nm build.sh | |||
2426 | and | |||
2435 | .Xr make 1 | 2427 | .Xr make 1 | |
2436 | option | 2428 | option | |
2437 | .Fl j | 2429 | .Fl j | |
2438 | instead. | 2430 | instead. | |
2439 | . | 2431 | . | |
2440 | .It Sy USE_NEW_TOOLCHAIN | 2432 | .It Sy USE_NEW_TOOLCHAIN | |
2441 | The new toolchain is now the default. | 2433 | The new toolchain is now the default. | |
2442 | To disable, use | 2434 | To disable, use | |
2443 | .Sy TOOLCHAIN_MISSING=yes . | 2435 | .Sy TOOLCHAIN_MISSING=yes . | |
2444 | .El | 2436 | .El | |
2445 | .Sh SEE ALSO | 2437 | .Sh SEE ALSO | |
2446 | .Xr ar 1 , | 2438 | .Xr ar 1 , | |
2447 | .Xr config 1 , | 2439 | .Xr config 1 , | |
2448 | .Xr ctags 1 , | 2440 | .Xr ctags 1 , | |
2449 | .Xr cvs 1 , | 2441 | .Xr cvs 1 , | |
2450 | .Xr cvslatest 1 , | 2442 | .Xr cvslatest 1 , | |
2451 | .Xr ex 1 , | 2443 | .Xr ex 1 , | |
2452 | .Xr g++ 1 , | 2444 | .Xr g++ 1 , | |
2453 | .Xr gzip 1 , | 2445 | .Xr gzip 1 , | |
2454 | .Xr ident 1 , | 2446 | .Xr ident 1 , | |
2455 | .Xr ld 1 , | 2447 | .Xr ld 1 , | |
2456 | .Xr lint 1 , | 2448 | .Xr lint 1 , | |
2457 | .Xr make 1 , | 2449 | .Xr make 1 , | |
2458 | .Xr mkisofs 1 , | 2450 | .Xr mkisofs 1 , | |
2459 | .Xr sh 1 , | 2451 | .Xr sh 1 , | |
2460 | .Xr uname 1 , | 2452 | .Xr uname 1 , | |
2461 | .Xr vi 1 , | 2453 | .Xr vi 1 , | |
2462 | .Xr options 4 , | 2454 | .Xr options 4 , | |
2463 | .Xr mk.conf 5 , | 2455 | .Xr mk.conf 5 , | |
2464 | .Xr atf 7 , | 2456 | .Xr atf 7 , | |
2465 | .Xr hier 7 , | 2457 | .Xr hier 7 , | |
2466 | .Xr release 7 , | 2458 | .Xr release 7 , | |
2467 | .Xr sysctl 7 , | 2459 | .Xr sysctl 7 , | |
2468 | .Xr etcupdate 8 , | 2460 | .Xr etcupdate 8 , | |
2469 | .Xr installboot 8 , | 2461 | .Xr installboot 8 , | |
2470 | .Xr mount 8 , | 2462 | .Xr mount 8 , | |
2471 | .Xr mtree 8 , | 2463 | .Xr mtree 8 , | |
2472 | .Xr postinstall 8 , | 2464 | .Xr postinstall 8 , | |
2473 | .Xr sysinst 8 , | 2465 | .Xr sysinst 8 , | |
2474 | .Pa pkgsrc/sysutils/cdrtools | 2466 | .Pa pkgsrc/sysutils/cdrtools | |
2475 | . | 2467 | . | |
2476 | .Sh HISTORY | 2468 | .Sh HISTORY | |
2477 | . | 2469 | . | |
2478 | The | 2470 | The | |
2479 | .Nm build.sh | 2471 | .Nm build.sh | |
2480 | based build scheme was introduced for | 2472 | based build scheme was introduced for | |
2481 | .Nx 1.6 | 2473 | .Nx 1.6 | |
2482 | as | 2474 | as | |
2483 | .Sy USE_NEW_TOOLCHAIN , | 2475 | .Sy USE_NEW_TOOLCHAIN , | |
2484 | and re-worked to | 2476 | and re-worked to | |
2485 | .Sy TOOLCHAIN_MISSING | 2477 | .Sy TOOLCHAIN_MISSING | |
2486 | after that. | 2478 | after that. | |
2487 | . | 2479 | . | |
2488 | .Sh CAVEATS | 2480 | .Sh CAVEATS | |
2489 | . | 2481 | . | |
2490 | After significant updates to third-party components in the source | 2482 | After significant updates to third-party components in the source | |
2491 | tree, the | 2483 | tree, the | |
2492 | .Dq make cleandir | 2484 | .Dq make cleandir | |
2493 | operation may be insufficient to clean out old files in object | 2485 | operation may be insufficient to clean out old files in object | |
2494 | directories. | 2486 | directories. | |
2495 | Instead, one may have to manually remove the files. | 2487 | Instead, one may have to manually remove the files. | |
2496 | Consult the | 2488 | Consult the | |
2497 | .Pa UPDATING | 2489 | .Pa UPDATING | |
2498 | file for notices concerning this. | 2490 | file for notices concerning this. |
--- src/etc/Makefile.params 2021/02/14 18:45:44 1.22
+++ src/etc/Makefile.params 2023/06/11 10:43:51 1.23
@@ -1,121 +1,121 @@ | @@ -1,121 +1,121 @@ | |||
1 | # $NetBSD: Makefile.params,v 1.22 2021/02/14 18:45:44 pgoyette Exp $ | 1 | # $NetBSD: Makefile.params,v 1.23 2023/06/11 10:43:51 lukem Exp $ | |
2 | # | 2 | # | |
3 | # Makefile fragment for printing build parameters. | 3 | # Makefile fragment for printing build parameters. | |
4 | # | 4 | # | |
5 | # Public variables: | 5 | # Public variables: | |
6 | # RELEASEVARS | 6 | # RELEASEVARS | |
7 | # List of variables whose value should be printed. | 7 | # List of variables whose value should be printed. | |
8 | # | 8 | # | |
9 | # PRINT_PARAMS | 9 | # PRINT_PARAMS | |
10 | # A command to print the desired variables and values | 10 | # A command to print the desired variables and values | |
11 | # to stdout, without any additional debugging information. | 11 | # to stdout, without any additional debugging information. | |
12 | # Values are printed as single-quoted strings, with | 12 | # Values are printed as single-quoted strings, with | |
13 | # embedded quotes and newlines escaped in a way that's | 13 | # embedded quotes and newlines escaped in a way that's | |
14 | # acceptable to sh(1). Undefined values are printed | 14 | # acceptable to sh(1). Undefined values are printed | |
15 | # as "(undefined)" (without quotation marks). | 15 | # as "(undefined)" (without quotation marks). | |
16 | # | 16 | # | |
17 | # Internal targets: | 17 | # Internal targets: | |
18 | # _params: | 18 | # _params: | |
19 | # Prints the names and values of all the variables | 19 | # Prints the names and values of all the variables | |
20 | # listed in ${RELEASEVARS}. The desired results may be | 20 | # listed in ${RELEASEVARS}. The desired results may be | |
21 | # redirected somewhere other than stdout, for example by | 21 | # redirected somewhere other than stdout, for example by | |
22 | # setting _params_redirect='>&3'. stdout and stderr may | 22 | # setting _params_redirect='>&3'. stdout and stderr may | |
23 | # contain unwanted debugging information, from make and | 23 | # contain unwanted debugging information, from make and | |
24 | # the shell. | 24 | # the shell. | |
25 | # | 25 | # | |
26 | # Internal variables: | 26 | # Internal variables: | |
27 | # _params_redirect: | 27 | # _params_redirect: | |
28 | # If set, this should be a shell redirection specification, such | 28 | # If set, this should be a shell redirection specification, such | |
29 | # as '>&3', controlling where the output from "make _params" will | 29 | # as '>&3', controlling where the output from "make _params" will | |
30 | # be sent. | 30 | # be sent. | |
31 | # | 31 | # | |
32 | # Example: | 32 | # Example: | |
33 | # . ${NETBSDSRCDIR}/etc/Makefile.params | 33 | # . ${NETBSDSRCDIR}/etc/Makefile.params | |
34 | # show-params: .MAKE .PHONY # print params to stdout | 34 | # show-params: .MAKE .PHONY # print params to stdout | |
35 | # @${PRINT_PARAMS} | 35 | # @${PRINT_PARAMS} | |
36 | # | 36 | # | |
37 | 37 | |||
38 | .include <bsd.own.mk> # for some variables | 38 | .include <bsd.own.mk> # for some variables | |
39 | 39 | |||
40 | RELEASEVARS= DISTRIBVER EXTERNAL_TOOLCHAIN HAVE_GCC HAVE_GDB \ | 40 | RELEASEVARS= DISTRIBVER EXTERNAL_TOOLCHAIN HAVE_GCC HAVE_GDB \ | |
41 | HAVE_LLVM HAVE_PCC INSTALLWORLDDIR \ | 41 | HAVE_LLVM HAVE_PCC INSTALLWORLDDIR \ | |
42 | MACHINE MACHINE_ARCH \ | 42 | MACHINE MACHINE_ARCH \ | |
43 | NETBSD_OFFICIAL_RELEASE NOCLEANDIR NODISTRIBDIRS NOINCLUDES \ | 43 | NETBSD_OFFICIAL_RELEASE NOCLEANDIR NODISTRIBDIRS NOINCLUDES \ | |
44 | TOOLCHAIN_MISSING \ | 44 | TOOLCHAIN_MISSING \ | |
45 | USE_HESIOD USE_INET6 USE_JEMALLOC USE_KERBEROS USE_LDAP \ | 45 | USE_HESIOD USE_INET6 USE_JEMALLOC USE_KERBEROS USE_LDAP \ | |
46 | USE_PAM USE_SKEY USE_YP \ | 46 | USE_PAM USE_SKEY USE_YP \ | |
47 | USETOOLS | 47 | USETOOLS | |
48 | 48 | |||
49 | .if ${MKREPRO:Uno} != "yes" | 49 | .if ${MKREPRO:Uno} != "yes" | |
50 | RELEASEVARS+= BSDOBJDIR BSDSRCDIR BUILDID BUILDINFO BUILDSEED \ | 50 | RELEASEVARS+= BSDOBJDIR BSDSRCDIR BUILDID BUILDINFO BUILDSEED \ | |
51 | DESTDIR KERNARCHDIR KERNCONFDIR KERNOBJDIR KERNSRCDIR MAKE \ | 51 | DESTDIR KERNARCHDIR KERNCONFDIR KERNOBJDIR KERNSRCDIR MAKE \ | |
52 | KERNEL_DIR MAKECONF MAKEFLAGS MAKEOBJDIR MAKEOBJDIRPREFIX \ | 52 | KERNEL_DIR MAKECONF MAKEFLAGS MAKEOBJDIR MAKEOBJDIRPREFIX \ | |
53 | MAKEVERBOSE NBUILDJOBS NETBSDSRCDIR OBJMACHINE OBJMACHINE_ARCH \ | 53 | MAKEVERBOSE NETBSDSRCDIR OBJMACHINE OBJMACHINE_ARCH \ | |
54 | RELEASEDIR RELEASEMACHINEDIR TOOLDIR USR_OBJMACHINE X11SRCDIR | 54 | RELEASEDIR RELEASEMACHINEDIR TOOLDIR USR_OBJMACHINE X11SRCDIR | |
55 | .endif | 55 | .endif | |
56 | 56 | |||
57 | RELEASEVARS+= ${_MKVARS.yes} ${_MKVARS.no} | 57 | RELEASEVARS+= ${_MKVARS.yes} ${_MKVARS.no} | |
58 | 58 | |||
59 | # | 59 | # | |
60 | # Duplicate the DISTRIBVER setting from src/etc/Makefile. | 60 | # Duplicate the DISTRIBVER setting from src/etc/Makefile. | |
61 | # | 61 | # | |
62 | .ifndef DISTRIBVER | 62 | .ifndef DISTRIBVER | |
63 | DISTRIBVER!= ${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh | 63 | DISTRIBVER!= ${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh | |
64 | .endif | 64 | .endif | |
65 | 65 | |||
66 | # | 66 | # | |
67 | # _params does the printing. | 67 | # _params does the printing. | |
68 | # | 68 | # | |
69 | _params_redirect?= # empty | 69 | _params_redirect?= # empty | |
70 | 70 | |||
71 | _params: .PHONY | 71 | _params: .PHONY | |
72 | .for var in ${RELEASEVARS:O} | 72 | .for var in ${RELEASEVARS:O} | |
73 | .if defined(${var}) | 73 | .if defined(${var}) | |
74 | @printf "%20s = '%-s'\n" ${var} ${${var}:C/'/'\\\\''/gW:Q} \ | 74 | @printf "%20s = '%-s'\n" ${var} ${${var}:C/'/'\\\\''/gW:Q} \ | |
75 | ${_params_redirect} | 75 | ${_params_redirect} | |
76 | .else | 76 | .else | |
77 | @printf "%20s = (undefined)\n" ${var} \ | 77 | @printf "%20s = (undefined)\n" ${var} \ | |
78 | ${_params_redirect} | 78 | ${_params_redirect} | |
79 | .endif | 79 | .endif | |
80 | .endfor | 80 | .endfor | |
81 | 81 | |||
82 | # PRINT_PARAMS: | 82 | # PRINT_PARAMS: | |
83 | # | 83 | # | |
84 | # The output from the "make _params" can include the following types of | 84 | # The output from the "make _params" can include the following types of | |
85 | # unwanted lines: | 85 | # unwanted lines: | |
86 | # | 86 | # | |
87 | # make -j prints "--- _params ---"; | 87 | # make -j prints "--- _params ---"; | |
88 | # | 88 | # | |
89 | # if MAKEVERBOSE is set to 3 or more then make prints each "printf" | 89 | # if MAKEVERBOSE is set to 3 or more then make prints each "printf" | |
90 | # command in addition to executing it; | 90 | # command in addition to executing it; | |
91 | # | 91 | # | |
92 | # if MAKEVERBOSE is set to 4 then the shell prints each command | 92 | # if MAKEVERBOSE is set to 4 then the shell prints each command | |
93 | # (prefixed with "+"). | 93 | # (prefixed with "+"). | |
94 | # | 94 | # | |
95 | # So the resulting output can look like this: | 95 | # So the resulting output can look like this: | |
96 | # | 96 | # | |
97 | # --- _params --- | 97 | # --- _params --- | |
98 | # + echo 'printf "%20s = '\''%-s'\''\n" BSDOBJDIR /usr/obj' | 98 | # + echo 'printf "%20s = '\''%-s'\''\n" BSDOBJDIR /usr/obj' | |
99 | # printf "%20s = '%-s'\n" BSDOBJDIR /usr/obj | 99 | # printf "%20s = '%-s'\n" BSDOBJDIR /usr/obj | |
100 | # + printf '%20s = '\''%-s'\''\n' BSDOBJDIR /usr/obj | 100 | # + printf '%20s = '\''%-s'\''\n' BSDOBJDIR /usr/obj | |
101 | # BSDOBJDIR = '/usr/obj' | 101 | # BSDOBJDIR = '/usr/obj' | |
102 | # + echo 'printf "%20s = '\''%-s'\''\n" BSDSRCDIR /usr/src' | 102 | # + echo 'printf "%20s = '\''%-s'\''\n" BSDSRCDIR /usr/src' | |
103 | # printf "%20s = '%-s'\n" BSDSRCDIR /usr/src | 103 | # printf "%20s = '%-s'\n" BSDSRCDIR /usr/src | |
104 | # + printf '%20s = '\''%-s'\''\n' BSDSRCDIR /usr/src | 104 | # + printf '%20s = '\''%-s'\''\n' BSDSRCDIR /usr/src | |
105 | # BSDSRCDIR = '/usr/src' | 105 | # BSDSRCDIR = '/usr/src' | |
106 | # [...] | 106 | # [...] | |
107 | # | 107 | # | |
108 | # where what we want is just this: | 108 | # where what we want is just this: | |
109 | # | 109 | # | |
110 | # BSDOBJDIR = '/usr/obj' | 110 | # BSDOBJDIR = '/usr/obj' | |
111 | # BSDSRCDIR = '/usr/src' | 111 | # BSDSRCDIR = '/usr/src' | |
112 | # [...] | 112 | # [...] | |
113 | # | 113 | # | |
114 | # The shell redirections in ${PRINT_PARAMS} ensure that the unwanted | 114 | # The shell redirections in ${PRINT_PARAMS} ensure that the unwanted | |
115 | # noise is discarded (via ">/dev/null"), while the desired information | 115 | # noise is discarded (via ">/dev/null"), while the desired information | |
116 | # ends up on the subshell's stdout (via ">&3" and "3>&1"). The value | 116 | # ends up on the subshell's stdout (via ">&3" and "3>&1"). The value | |
117 | # of _params_redirect is passed in the environment instead of on the | 117 | # of _params_redirect is passed in the environment instead of on the | |
118 | # command line, to prevent it from appearing in MAKEFLAGS (which would | 118 | # command line, to prevent it from appearing in MAKEFLAGS (which would | |
119 | # appear in the output). | 119 | # appear in the output). | |
120 | # | 120 | # | |
121 | PRINT_PARAMS:= (_params_redirect='>&3' ${MAKE} -f ${.PARSEDIR:Q}/${.PARSEFILE:Q} _params 3>&1 >/dev/null) | 121 | PRINT_PARAMS:= (_params_redirect='>&3' ${MAKE} -f ${.PARSEDIR:Q}/${.PARSEFILE:Q} _params 3>&1 >/dev/null) |