| @@ -1,1584 +1,1584 @@ | | | @@ -1,1584 +1,1584 @@ |
1 | .\" $NetBSD: BUILDING.mdoc,v 1.89 2012/05/25 10:47:25 wiz Exp $ | | 1 | .\" $NetBSD: BUILDING.mdoc,v 1.90 2012/09/19 23:06:22 abs Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 2001-2011 The NetBSD Foundation, Inc. | | 3 | .\" Copyright (c) 2001-2011 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 May 25, 2012 | | 36 | .Dd September 19, 2012 |
37 | .Dt BUILDING 8 | | 37 | .Dt BUILDING 8 |
38 | .Os NetBSD | | 38 | .Os NetBSD |
39 | . | | 39 | . |
40 | .Sh NAME | | 40 | .Sh NAME |
41 | . | | 41 | . |
42 | .Nm BUILDING | | 42 | .Nm BUILDING |
43 | .Nd Procedure for building | | 43 | .Nd Procedure for building |
44 | .Nx | | 44 | .Nx |
45 | from source code. | | 45 | from source code. |
46 | . | | 46 | . |
47 | .Sh REQUIREMENTS | | 47 | .Sh REQUIREMENTS |
48 | . | | 48 | . |
49 | .Nx | | 49 | .Nx |
50 | is designed to be buildable on most POSIX-compliant host systems. | | 50 | is designed to be buildable on most POSIX-compliant host systems. |
51 | The basic build procedure is the same whether compiling | | 51 | The basic build procedure is the same whether compiling |
52 | .Em natively | | 52 | .Em natively |
53 | (on the same | | 53 | (on the same |
54 | .Nx | | 54 | .Nx |
55 | architecture) or | | 55 | architecture) or |
56 | .Em cross compiling | | 56 | .Em cross compiling |
57 | (on another architecture or OS). | | 57 | (on another architecture or OS). |
58 | .Pp | | 58 | .Pp |
59 | This source tree contains a special subtree, | | 59 | This source tree contains a special subtree, |
60 | .Dq tools , | | 60 | .Dq tools , |
61 | which uses the host system to create a build toolchain for the target | | 61 | which uses the host system to create a build toolchain for the target |
62 | architecture. | | 62 | architecture. |
63 | The host system must have at least C and C++ | | 63 | The host system must have at least C and C++ |
64 | compilers in order to create the toolchain | | 64 | compilers in order to create the toolchain |
65 | .Nm ( make | | 65 | .Nm ( make |
66 | is not required); all other tools are created as part of the | | 66 | is not required); all other tools are created as part of the |
67 | .Nx | | 67 | .Nx |
68 | build process. | | 68 | build process. |
69 | (See the environment variables section below if you need | | 69 | (See the environment variables section below if you need |
70 | to override or manually select your compilers.) | | 70 | to override or manually select your compilers.) |
71 | . | | 71 | . |
72 | .Sh FILES | | 72 | .Sh FILES |
73 | . | | 73 | . |
74 | .Ss Source tree layout | | 74 | .Ss Source tree layout |
75 | . | | 75 | . |
76 | .Bl -tag -width "BUILDING.mdoc" | | 76 | .Bl -tag -width "BUILDING.mdoc" |
77 | .It Sy doc/BUILDING.mdoc | | 77 | .It Sy doc/BUILDING.mdoc |
78 | This document (in -mdoc troff format; the original copy). | | 78 | This document (in -mdoc troff format; the original copy). |
79 | .It Sy BUILDING | | 79 | .It Sy BUILDING |
80 | This document (in plaintext). | | 80 | This document (in plaintext). |
81 | .It Sy tools/compat/README | | 81 | .It Sy tools/compat/README |
82 | Special notes for cross-hosting a NetBSD build on non-NetBSD platforms. | | 82 | Special notes for cross-hosting a NetBSD build on non-NetBSD platforms. |
83 | .It Sy Makefile | | 83 | .It Sy Makefile |
84 | The main Makefile for | | 84 | The main Makefile for |
85 | .Nx ; | | 85 | .Nx ; |
86 | should only be run for native builds with an appropriately up-to-date | | 86 | should only be run for native builds with an appropriately up-to-date |
87 | version of | | 87 | version of |
88 | .Nx | | 88 | .Nx |
89 | .Xr make 1 . | | 89 | .Xr make 1 . |
90 | (For building from out-of-date systems or on a non-native host, see the | | 90 | (For building from out-of-date systems or on a non-native host, see the |
91 | .Nm build.sh | | 91 | .Nm build.sh |
92 | shell script.) | | 92 | shell script.) |
93 | .It Sy UPDATING | | 93 | .It Sy UPDATING |
94 | Special notes for updating from an earlier revision of | | 94 | Special notes for updating from an earlier revision of |
95 | .Nx . | | 95 | .Nx . |
96 | It is important to read this file before every build of an updated | | 96 | It is important to read this file before every build of an updated |
97 | source tree. | | 97 | source tree. |
98 | .It Sy build.sh | | 98 | .It Sy build.sh |
99 | Bourne-compatible shell script used for building the host build tools | | 99 | Bourne-compatible shell script used for building the host build tools |
100 | and the | | 100 | and the |
101 | .Nx | | 101 | .Nx |
102 | system from scratch. | | 102 | system from scratch. |
103 | Can be used for both native and cross builds, and should be used instead of | | 103 | Can be used for both native and cross builds, and should be used instead of |
104 | .Xr make 1 | | 104 | .Xr make 1 |
105 | for any source tree that is updated and recompiled regularly. | | 105 | for any source tree that is updated and recompiled regularly. |
106 | .It Sy crypto/dist/ , dist/ , gnu/dist/ | | 106 | .It Sy crypto/dist/ , dist/ , gnu/dist/ |
107 | Sources imported verbatim from third parties, without mangling the | | 107 | Sources imported verbatim from third parties, without mangling the |
108 | existing build structure. | | 108 | existing build structure. |
109 | Other source trees in | | 109 | Other source trees in |
110 | .Sy bin | | 110 | .Sy bin |
111 | through | | 111 | through |
112 | .Sy usr.sbin | | 112 | .Sy usr.sbin |
113 | use the | | 113 | use the |
114 | .Nx | | 114 | .Nx |
115 | .Xr make 1 | | 115 | .Xr make 1 |
116 | .Dq reachover | | 116 | .Dq reachover |
117 | Makefile semantics when building these programs for a native host. | | 117 | Makefile semantics when building these programs for a native host. |
118 | .It Sy distrib/ , etc/ | | 118 | .It Sy distrib/ , etc/ |
119 | Sources for items used when making a full release snapshot, such as | | 119 | Sources for items used when making a full release snapshot, such as |
120 | files installed in | | 120 | files installed in |
121 | .Sy DESTDIR Ns Pa /etc | | 121 | .Sy DESTDIR Ns Pa /etc |
122 | on the destination system, boot media, and release notes. | | 122 | on the destination system, boot media, and release notes. |
123 | .It Sy tests/ , regress/ | | 123 | .It Sy tests/ , regress/ |
124 | Regression test harness. | | 124 | Regression test harness. |
125 | Can be cross-compiled, but only run natively. | | 125 | Can be cross-compiled, but only run natively. |
126 | .Pa tests/ | | 126 | .Pa tests/ |
127 | uses the | | 127 | uses the |
128 | .Xr atf 7 | | 128 | .Xr atf 7 |
129 | test framework; | | 129 | test framework; |
130 | .Pa regress/ | | 130 | .Pa regress/ |
131 | contains older tests that have not yet been migrated to | | 131 | contains older tests that have not yet been migrated to |
132 | .Xr atf 7 . | | 132 | .Xr atf 7 . |
133 | .It Sy sys/ | | 133 | .It Sy sys/ |
134 | .Nx | | 134 | .Nx |
135 | kernel sources. | | 135 | kernel sources. |
136 | .It Sy tools/ | | 136 | .It Sy tools/ |
137 | .Dq Reachover | | 137 | .Dq Reachover |
138 | build structure for the host build tools. | | 138 | build structure for the host build tools. |
139 | This has a special method of determining out-of-date status. | | 139 | This has a special method of determining out-of-date status. |
140 | .It Sy bin/ ... usr.sbin/ | | 140 | .It Sy bin/ ... usr.sbin/ |
141 | Sources to the | | 141 | Sources to the |
142 | .Nx | | 142 | .Nx |
143 | userland (non-kernel) programs. | | 143 | userland (non-kernel) programs. |
144 | If any of these directories are missing, they will be skipped during the build. | | 144 | If any of these directories are missing, they will be skipped during the build. |
145 | .It Sy x11/ | | 145 | .It Sy x11/ |
146 | .Dq Reachover | | 146 | .Dq Reachover |
147 | build structure for X11R6; the source is in | | 147 | build structure for X11R6; the source is in |
148 | .Sy X11SRCDIR . | | 148 | .Sy X11SRCDIR . |
149 | .El | | 149 | .El |
150 | . | | 150 | . |
151 | .Ss Build tree layout | | 151 | .Ss Build tree layout |
152 | . | | 152 | . |
153 | The | | 153 | The |
154 | .Nx | | 154 | .Nx |
155 | build tree is described in | | 155 | build tree is described in |
156 | .Xr hier 7 , | | 156 | .Xr hier 7 , |
157 | and the release layout is described in | | 157 | and the release layout is described in |
158 | .Xr release 7 . | | 158 | .Xr release 7 . |
159 | .Pp | | 159 | .Pp |
160 | . | | 160 | . |
161 | .Sh CONFIGURATION | | 161 | .Sh CONFIGURATION |
162 | . | | 162 | . |
163 | .Ss Environment variables | | 163 | .Ss Environment variables |
164 | .. | | 164 | .. |
165 | Several environment variables control the behaviour of | | 165 | Several environment variables control the behaviour of |
166 | .Nx | | 166 | .Nx |
167 | builds. | | 167 | builds. |
168 | . | | 168 | . |
169 | .Bl -tag -width "MAKEOBJDIRPREFIX" | | 169 | .Bl -tag -width "MAKEOBJDIRPREFIX" |
170 | . | | 170 | . |
171 | . | | 171 | . |
172 | .It Sy HOST_SH | | 172 | .It Sy HOST_SH |
173 | Path name to a shell available on the host system | | 173 | Path name to a shell available on the host system |
174 | and suitable for use during the build. | | 174 | and suitable for use during the build. |
175 | The | | 175 | The |
176 | .Nx | | 176 | .Nx |
177 | build system requires a modern Bourne-like shell | | 177 | build system requires a modern Bourne-like shell |
178 | with POSIX-compliant features, | | 178 | with POSIX-compliant features, |
179 | and also requires support for the | | 179 | and also requires support for the |
180 | .Dq local | | 180 | .Dq local |
181 | keyword to declare local variables in shell functions | | 181 | keyword to declare local variables in shell functions |
182 | (which is a widely-implemented but non-standardised feature). | | 182 | (which is a widely-implemented but non-standardised feature). |
183 | .Pp | | 183 | .Pp |
184 | Depending on the host system, a suitable shell may be | | 184 | Depending on the host system, a suitable shell may be |
185 | .Pa /bin/sh , | | 185 | .Pa /bin/sh , |
186 | .Pa /usr/xpg4/bin/sh , | | 186 | .Pa /usr/xpg4/bin/sh , |
187 | .Pa /bin/ksh | | 187 | .Pa /bin/ksh |
188 | (provided it is a variant of ksh that supports the | | 188 | (provided it is a variant of ksh that supports the |
189 | .Dq local | | 189 | .Dq local |
190 | keyword, | | 190 | keyword, |
191 | such as ksh88, but not ksh93), | | 191 | such as ksh88, but not ksh93), |
192 | or | | 192 | or |
193 | .Pa /usr/local/bin/bash . | | 193 | .Pa /usr/local/bin/bash . |
194 | .Pp | | 194 | .Pp |
195 | Most parts of the build require | | 195 | Most parts of the build require |
196 | .Sy HOST_SH | | 196 | .Sy HOST_SH |
197 | to be an absolute path; however, | | 197 | to be an absolute path; however, |
198 | .Nm build.sh | | 198 | .Nm build.sh |
199 | allows it to be a simple command name, which will be converted | | 199 | allows it to be a simple command name, which will be converted |
200 | to an absolute path by searching the | | 200 | to an absolute path by searching the |
201 | .Sy PATH . | | 201 | .Sy PATH . |
202 | . | | 202 | . |
203 | .It Sy HOST_CC | | 203 | .It Sy HOST_CC |
204 | Path name to C compiler used to create the toolchain. | | 204 | Path name to C compiler used to create the toolchain. |
205 | . | | 205 | . |
206 | .It Sy HOST_CXX | | 206 | .It Sy HOST_CXX |
207 | Path name to C++ compiler used to create the toolchain. | | 207 | Path name to C++ compiler used to create the toolchain. |
208 | . | | 208 | . |
209 | .It Sy MACHINE | | 209 | .It Sy MACHINE |
210 | Machine type, e.g., | | 210 | Machine type, e.g., |
211 | .Dq macppc . | | 211 | .Dq macppc . |
212 | . | | 212 | . |
213 | .It Sy MACHINE_ARCH | | 213 | .It Sy MACHINE_ARCH |
214 | Machine architecture, e.g., | | 214 | Machine architecture, e.g., |
215 | .Dq powerpc . | | 215 | .Dq powerpc . |
216 | . | | 216 | . |
217 | .It Sy MAKE | | 217 | .It Sy MAKE |
218 | Path name to invoke | | 218 | Path name to invoke |
219 | .Xr make 1 | | 219 | .Xr make 1 |
220 | as. | | 220 | as. |
221 | . | | 221 | . |
222 | .It Sy MAKEFLAGS | | 222 | .It Sy MAKEFLAGS |
223 | Flags to invoke | | 223 | Flags to invoke |
224 | .Xr make 1 | | 224 | .Xr make 1 |
225 | with. | | 225 | with. |
226 | Note that | | 226 | Note that |
227 | .Sy build.sh | | 227 | .Sy build.sh |
228 | ignores the value of | | 228 | ignores the value of |
229 | .Sy MAKEFLAGS | | 229 | .Sy MAKEFLAGS |
230 | passed in the environment, but allows | | 230 | passed in the environment, but allows |
231 | .Sy MAKEFLAGS | | 231 | .Sy MAKEFLAGS |
232 | to be set via the | | 232 | to be set via the |
233 | .Fl V | | 233 | .Fl V |
234 | option. | | 234 | option. |
235 | . | | 235 | . |
236 | .It Sy MAKEOBJDIR | | 236 | .It Sy MAKEOBJDIR |
237 | Directory to use as the | | 237 | Directory to use as the |
238 | .Sy .OBJDIR | | 238 | .Sy .OBJDIR |
239 | for the current directory. | | 239 | for the current directory. |
240 | The value is subjected to variable expansion by | | 240 | The value is subjected to variable expansion by |
241 | .Xr make 1 . | | 241 | .Xr make 1 . |
242 | Typical usage is to set this variable to a value involving the use of | | 242 | Typical usage is to set this variable to a value involving the use of |
243 | .Sq ${.CURDIR:S...} | | 243 | .Sq ${.CURDIR:S...} |
244 | or | | 244 | or |
245 | .Sq ${.CURDIR:C...} , | | 245 | .Sq ${.CURDIR:C...} , |
246 | to derive the value of | | 246 | to derive the value of |
247 | .Sy .OBJDIR | | 247 | .Sy .OBJDIR |
248 | from the value of | | 248 | from the value of |
249 | .Sy .CURDIR . | | 249 | .Sy .CURDIR . |
250 | Used only if | | 250 | Used only if |
251 | .Sy MAKEOBJDIRPREFIX | | 251 | .Sy MAKEOBJDIRPREFIX |
252 | is not defined. | | 252 | is not defined. |
253 | .Sy MAKEOBJDIR | | 253 | .Sy MAKEOBJDIR |
254 | can be provided only in the environment or via the | | 254 | can be provided only in the environment or via the |
255 | .Fl O | | 255 | .Fl O |
256 | flag of | | 256 | flag of |
257 | .Nm build.sh ; | | 257 | .Nm build.sh ; |
258 | it cannot usefully be set inside a Makefile, including | | 258 | it cannot usefully be set inside a Makefile, including |
259 | .Pa mk.conf | | 259 | .Pa mk.conf |
260 | or | | 260 | or |
261 | .Sy ${MAKECONF} . | | 261 | .Sy ${MAKECONF} . |
262 | . | | 262 | . |
263 | .It Sy MAKEOBJDIRPREFIX | | 263 | .It Sy MAKEOBJDIRPREFIX |
264 | Top level directory of the object directory tree. | | 264 | Top level directory of the object directory tree. |
265 | The value is subjected to variable expansion by | | 265 | The value is subjected to variable expansion by |
266 | .Xr make 1 . | | 266 | .Xr make 1 . |
267 | .Sy build.sh | | 267 | .Sy build.sh |
268 | will create the | | 268 | will create the |
269 | ${MAKEOBJDIRPREFIX} | | 269 | ${MAKEOBJDIRPREFIX} |
270 | directory if necessary, but if | | 270 | directory if necessary, but if |
271 | .Xr make 1 | | 271 | .Xr make 1 |
272 | is used without | | 272 | is used without |
273 | .Sy build.sh , | | 273 | .Sy build.sh , |
274 | then rules in | | 274 | then rules in |
275 | .Aq bsd.obj.mk | | 275 | .Aq bsd.obj.mk |
276 | will abort the build if the | | 276 | will abort the build if the |
277 | ${MAKEOBJDIRPREFIX} | | 277 | ${MAKEOBJDIRPREFIX} |
278 | directory does not exist. | | 278 | directory does not exist. |
279 | If the value is defined and valid, then | | 279 | If the value is defined and valid, then |
280 | ${MAKEOBJDIRPREFIX}/${.CURDIR} | | 280 | ${MAKEOBJDIRPREFIX}/${.CURDIR} |
281 | is used as the | | 281 | is used as the |
282 | .Sy .OBJDIR | | 282 | .Sy .OBJDIR |
283 | for the current directory. | | 283 | for the current directory. |
284 | The current directory may be read only. | | 284 | The current directory may be read only. |
285 | .Sy MAKEOBJDIRPREFIX | | 285 | .Sy MAKEOBJDIRPREFIX |
286 | can be provided only in the environment or via the | | 286 | can be provided only in the environment or via the |
287 | .Fl M | | 287 | .Fl M |
288 | flag of | | 288 | flag of |
289 | .Nm build.sh ; | | 289 | .Nm build.sh ; |
290 | it cannot usefully be set inside a Makefile, including | | 290 | it cannot usefully be set inside a Makefile, including |
291 | .Pa mk.conf | | 291 | .Pa mk.conf |
292 | or | | 292 | or |
293 | .Sy ${MAKECONF} . | | 293 | .Sy ${MAKECONF} . |
294 | . | | 294 | . |
295 | .El | | 295 | .El |
296 | . | | 296 | . |
297 | .Ss \*qmake\*q variables | | 297 | .Ss \*qmake\*q variables |
298 | . | | 298 | . |
299 | .de YorN | | 299 | .de YorN |
300 | Can be set to | | 300 | Can be set to |
301 | .Dq yes | | 301 | .Dq yes |
302 | or | | 302 | or |
303 | .Dq no . | | 303 | .Dq no . |
304 | .. | | 304 | .. |
305 | .de DFLT | | 305 | .de DFLT |
306 | .Pp | | 306 | .Pp |
307 | .Em Default : | | 307 | .Em Default : |
308 | .. | | 308 | .. |
309 | .de DFLTu | | 309 | .de DFLTu |
310 | .DFLT | | 310 | .DFLT |
311 | Unset. | | 311 | Unset. |
312 | .. | | 312 | .. |
313 | .de DFLTy | | 313 | .de DFLTy |
314 | .DFLT | | 314 | .DFLT |
315 | .Dq yes | | 315 | .Dq yes |
316 | .. | | 316 | .. |
317 | .de DFLTn | | 317 | .de DFLTn |
318 | .DFLT | | 318 | .DFLT |
319 | .Dq no | | 319 | .Dq no |
320 | .. | | 320 | .. |
321 | Several variables control the behavior of | | 321 | Several variables control the behavior of |
322 | .Nx | | 322 | .Nx |
323 | builds. | | 323 | builds. |
324 | Unless otherwise specified, these variables may be set in | | 324 | Unless otherwise specified, these variables may be set in |
325 | either the process environment or the | | 325 | either the process environment or the |
326 | .Xr make 1 | | 326 | .Xr make 1 |
327 | configuration file specified by | | 327 | configuration file specified by |
328 | .Sy MAKECONF . | | 328 | .Sy MAKECONF . |
329 | . | | 329 | . |
330 | .Bl -tag -width "MKCATPAGES" | | 330 | .Bl -tag -width "MKCATPAGES" |
331 | . | | 331 | . |
332 | .It Sy BUILDID | | 332 | .It Sy BUILDID |
333 | Identifier for the build. | | 333 | Identifier for the build. |
334 | The identifier will be appended to | | 334 | The identifier will be appended to |
335 | object directory names, and can be consulted in the | | 335 | object directory names, and can be consulted in the |
336 | .Xr make 1 | | 336 | .Xr make 1 |
337 | configuration file in order to set additional build parameters, | | 337 | configuration file in order to set additional build parameters, |
338 | such as compiler flags. | | 338 | such as compiler flags. |
339 | . | | 339 | . |
340 | .It Sy BUILDSEED | | 340 | .It Sy BUILDSEED |
341 | GCC uses random numbers when compiling C++ code. | | 341 | GCC uses random numbers when compiling C++ code. |
342 | This variable seeds the gcc random number generator using | | 342 | This variable seeds the gcc random number generator using |
343 | the -frandom-seed flag with this value. | | 343 | the -frandom-seed flag with this value. |
344 | By default, it is set to NetBSD-(majorversion). | | 344 | By default, it is set to NetBSD-(majorversion). |
345 | Using a fixed value causes C++ binaries to be the same when | | 345 | Using a fixed value causes C++ binaries to be the same when |
346 | built from the same sources, resulting in identical (reproducible) builds. | | 346 | built from the same sources, resulting in identical (reproducible) builds. |
347 | Additional information is available in the GCC | | 347 | Additional information is available in the GCC |
348 | documentation of -frandom-seed. | | 348 | documentation of -frandom-seed. |
349 | . | | 349 | . |
350 | .It Sy DESTDIR | | 350 | .It Sy DESTDIR |
351 | Directory to contain the built | | 351 | Directory to contain the built |
352 | .Nx | | 352 | .Nx |
353 | system. | | 353 | system. |
354 | If set, special options are passed to the compilation tools to | | 354 | If set, special options are passed to the compilation tools to |
355 | prevent their default use of the host system's | | 355 | prevent their default use of the host system's |
356 | .Sy /usr/include , /usr/lib , | | 356 | .Sy /usr/include , /usr/lib , |
357 | and so forth. | | 357 | and so forth. |
358 | This pathname must be an absolute path, and should | | 358 | This pathname must be an absolute path, and should |
359 | .Em not | | 359 | .Em not |
360 | end with a slash | | 360 | end with a slash |
361 | .Pq / | | 361 | .Pq / |
362 | character. | | 362 | character. |
363 | (For installation into the system's root directory, set | | 363 | (For installation into the system's root directory, set |
364 | .Sy DESTDIR | | 364 | .Sy DESTDIR |
365 | to an empty string, not to | | 365 | to an empty string, not to |
366 | .Dq / ) . | | 366 | .Dq / ) . |
367 | The directory must reside on a file system which supports long file | | 367 | The directory must reside on a file system which supports long file |
368 | names and hard links. | | 368 | names and hard links. |
369 | .DFLT | | 369 | .DFLT |
370 | Empty string if | | 370 | Empty string if |
371 | .Sy USETOOLS | | 371 | .Sy USETOOLS |
372 | is | | 372 | is |
373 | .Dq yes ; | | 373 | .Dq yes ; |
374 | unset otherwise. | | 374 | unset otherwise. |
375 | .Pp | | 375 | .Pp |
376 | .Em Note : | | 376 | .Em Note : |
377 | .Sy build.sh | | 377 | .Sy build.sh |
378 | will provide a default of | | 378 | will provide a default of |
379 | .Pa destdir. Ns Sy MACHINE | | 379 | .Pa destdir. Ns Sy MACHINE |
380 | (in the top-level | | 380 | (in the top-level |
381 | .Sy .OBJDIR ) | | 381 | .Sy .OBJDIR ) |
382 | unless run in | | 382 | unless run in |
383 | .Sq expert | | 383 | .Sq expert |
384 | mode. | | 384 | mode. |
385 | . | | 385 | . |
386 | .It Sy MAKECONF | | 386 | .It Sy MAKECONF |
387 | The name of the | | 387 | The name of the |
388 | .Xr make 1 | | 388 | .Xr make 1 |
389 | configuration file. | | 389 | configuration file. |
390 | .Em Only settable in the process environment. | | 390 | .Em Only settable in the process environment. |
391 | .DFLT | | 391 | .DFLT |
392 | .Dq /etc/mk.conf | | 392 | .Dq /etc/mk.conf |
393 | . | | 393 | . |
394 | .It Sy MAKEVERBOSE | | 394 | .It Sy MAKEVERBOSE |
395 | Level of verbosity of status messages. | | 395 | Level of verbosity of status messages. |
396 | Supported values: | | 396 | Supported values: |
397 | .Bl -tag -width xxx | | 397 | .Bl -tag -width xxx |
398 | .It 0 | | 398 | .It 0 |
399 | No descriptive messages or commands executed by | | 399 | No descriptive messages or commands executed by |
400 | .Xr make 1 | | 400 | .Xr make 1 |
401 | are shown. | | 401 | are shown. |
402 | .It 1 | | 402 | .It 1 |
403 | Brief messages are shown describing what is being done, | | 403 | Brief messages are shown describing what is being done, |
404 | but the actual commands executed by | | 404 | but the actual commands executed by |
405 | .Xr make 1 | | 405 | .Xr make 1 |
406 | are not displayed. | | 406 | are not displayed. |
407 | .It 2 | | 407 | .It 2 |
408 | Descriptive messages are shown as above (prefixed with a | | 408 | Descriptive messages are shown as above (prefixed with a |
409 | .Sq # ) , | | 409 | .Sq # ) , |
410 | and ordinary commands performed by | | 410 | and ordinary commands performed by |
411 | .Xr make 1 | | 411 | .Xr make 1 |
412 | are displayed. | | 412 | are displayed. |
413 | .It 3 | | 413 | .It 3 |
414 | In addition to the above, all commands performed by | | 414 | In addition to the above, all commands performed by |
415 | .Xr make 1 | | 415 | .Xr make 1 |
416 | are displayed, even if they would ordinarily have been hidden | | 416 | are displayed, even if they would ordinarily have been hidden |
417 | through use of the | | 417 | through use of the |
418 | .Dq \&@ | | 418 | .Dq \&@ |
419 | prefix in the relevant makefile. | | 419 | prefix in the relevant makefile. |
420 | .It 4 | | 420 | .It 4 |
421 | In addition to the above, commands executed by | | 421 | In addition to the above, commands executed by |
422 | .Xr make 1 | | 422 | .Xr make 1 |
423 | are traced through use of the | | 423 | are traced through use of the |
424 | .Xr sh 1 | | 424 | .Xr sh 1 |
425 | .Dq Fl x | | 425 | .Dq Fl x |
426 | flag. | | 426 | flag. |
427 | .El | | 427 | .El |
428 | .DFLT | | 428 | .DFLT |
429 | 2 | | 429 | 2 |
430 | . | | 430 | . |
431 | .It Sy MKCATPAGES | | 431 | .It Sy MKCATPAGES |
432 | .YorN | | 432 | .YorN |
433 | Indicates whether preformatted plaintext manual pages will be created | | 433 | Indicates whether preformatted plaintext manual pages will be created |
434 | during a build. | | 434 | during a build. |
435 | .DFLTy | | 435 | .DFLTy |
436 | . | | 436 | . |
437 | .It Sy MKCRYPTO | | 437 | .It Sy MKCRYPTO |
438 | .YorN | | 438 | .YorN |
439 | Indicates whether cryptographic code will be included in a build; | | 439 | Indicates whether cryptographic code will be included in a build; |
440 | provided for the benefit of countries that do not allow strong | | 440 | provided for the benefit of countries that do not allow strong |
441 | cryptography. | | 441 | cryptography. |
442 | Will not affect use of the standard low-security password encryption system, | | 442 | Will not affect use of the standard low-security password encryption system, |
443 | .Xr crypt 3 . | | 443 | .Xr crypt 3 . |
444 | .DFLTy | | 444 | .DFLTy |
445 | . | | 445 | . |
446 | .It Sy MKDOC | | 446 | .It Sy MKDOC |
447 | .YorN | | 447 | .YorN |
448 | Indicates whether system documentation destined for | | 448 | Indicates whether system documentation destined for |
449 | .Sy DESTDIR Ns Pa /usr/share/doc | | 449 | .Sy DESTDIR Ns Pa /usr/share/doc |
450 | will be installed during a build. | | 450 | will be installed during a build. |
451 | .DFLTy | | 451 | .DFLTy |
452 | . | | 452 | . |
453 | .It Sy MKHTML | | 453 | .It Sy MKHTML |
454 | .YorN | | 454 | .YorN |
455 | Indicates whether preformatted HTML manual pages will be built | | 455 | Indicates whether preformatted HTML manual pages will be built |
456 | and installed | | 456 | and installed |
457 | .DFLTy | | 457 | .DFLTy |
458 | . | | 458 | . |
459 | .It Sy MKHOSTOBJ | | 459 | .It Sy MKHOSTOBJ |
460 | .YorN | | 460 | .YorN |
461 | If set to | | 461 | If set to |
462 | .Dq yes , | | 462 | .Dq yes , |
463 | then for programs intended to be run on the compile host, | | 463 | then for programs intended to be run on the compile host, |
464 | the name, release, and architecture of the host operating system | | 464 | the name, release, and architecture of the host operating system |
465 | will be suffixed to the name of the object directory created by | | 465 | will be suffixed to the name of the object directory created by |
466 | .Dq make obj . | | 466 | .Dq make obj . |
467 | (This allows multiple host systems to compile NetBSD for a single target.) | | 467 | (This allows multiple host systems to compile NetBSD for a single target.) |
468 | If set to | | 468 | If set to |
469 | .Dq no , | | 469 | .Dq no , |
470 | then programs built to be run on the compile host will use the same | | 470 | then programs built to be run on the compile host will use the same |
471 | object directory names as programs built to be run on the target. | | 471 | object directory names as programs built to be run on the target. |
472 | .DFLTn | | 472 | .DFLTn |
473 | . | | 473 | . |
474 | .It Sy MKINFO | | 474 | .It Sy MKINFO |
475 | .YorN | | 475 | .YorN |
476 | Indicates whether GNU Info files, used for the documentation for | | 476 | Indicates whether GNU Info files, used for the documentation for |
477 | most of the compilation tools, will be created and installed during a | | 477 | most of the compilation tools, will be created and installed during a |
478 | build. | | 478 | build. |
479 | .DFLTy | | 479 | .DFLTy |
480 | . | | 480 | . |
481 | .It Sy MKKMOD | | 481 | .It Sy MKKMOD |
482 | .YorN | | 482 | .YorN |
483 | Indicates whether kernel modules are built and installed. | | 483 | Indicates whether kernel modules are built and installed. |
484 | .DFLTy | | 484 | .DFLTy |
485 | . | | 485 | . |
486 | .It Sy MKLINT | | 486 | .It Sy MKLINT |
487 | .YorN | | 487 | .YorN |
488 | Indicates whether | | 488 | Indicates whether |
489 | .Xr lint 1 | | 489 | .Xr lint 1 |
490 | will be run against portions of the | | 490 | will be run against portions of the |
491 | .Nx | | 491 | .Nx |
492 | source code during the build, and whether lint libraries will be | | 492 | source code during the build, and whether lint libraries will be |
493 | installed into | | 493 | installed into |
494 | .Sy DESTDIR Ns Pa /usr/libdata/lint . | | 494 | .Sy DESTDIR Ns Pa /usr/libdata/lint . |
495 | .DFLTy | | 495 | .DFLTy |
496 | . | | 496 | . |
497 | .It Sy MKMAN | | 497 | .It Sy MKMAN |
498 | .YorN | | 498 | .YorN |
499 | Indicates whether manual pages will be installed during a build. | | 499 | Indicates whether manual pages will be installed during a build. |
500 | .DFLTy | | 500 | .DFLTy |
501 | . | | 501 | . |
502 | .It Sy MKNLS | | 502 | .It Sy MKNLS |
503 | .YorN | | 503 | .YorN |
504 | Indicates whether Native Language System locale zone files will be | | 504 | Indicates whether Native Language System locale zone files will be |
505 | compiled and installed during a build. | | 505 | compiled and installed during a build. |
506 | .DFLTy | | 506 | .DFLTy |
507 | . | | 507 | . |
508 | .It Sy MKOBJ | | 508 | .It Sy MKOBJ |
509 | .YorN | | 509 | .YorN |
510 | Indicates whether object directories will be created when running | | 510 | Indicates whether object directories will be created when running |
511 | .Dq make obj . | | 511 | .Dq make obj . |
512 | If set to | | 512 | If set to |
513 | .Dq no , | | 513 | .Dq no , |
514 | then all built files will be located inside the regular source tree. | | 514 | then all built files will be located inside the regular source tree. |
515 | .DFLTy | | 515 | .DFLTy |
516 | .Pp | | 516 | .Pp |
517 | Note that setting | | 517 | Note that setting |
518 | .Sy MKOBJ | | 518 | .Sy MKOBJ |
519 | to | | 519 | to |
520 | .Dq no | | 520 | .Dq no |
521 | is not recommended and may cause problems when updating the tree with | | 521 | is not recommended and may cause problems when updating the tree with |
522 | .Xr cvs 1 . | | 522 | .Xr cvs 1 . |
523 | . | | 523 | . |
524 | .It Sy MKPIC | | 524 | .It Sy MKPIC |
525 | .YorN | | 525 | .YorN |
526 | Indicates whether shared objects and libraries will be created and | | 526 | Indicates whether shared objects and libraries will be created and |
527 | installed during a build. | | 527 | installed during a build. |
528 | If set to | | 528 | If set to |
529 | .Dq no , | | 529 | .Dq no , |
530 | the entire built system will be statically linked. | | 530 | the entire built system will be statically linked. |
531 | .DFLT | | 531 | .DFLT |
532 | Platform dependent. | | 532 | Platform dependent. |
533 | As of this writing, all platforms except | | 533 | As of this writing, all platforms except |
534 | .Sy sh3 | | 534 | .Sy sh3 |
535 | default to | | 535 | default to |
536 | .Dq yes . | | 536 | .Dq yes . |
537 | . | | 537 | . |
538 | .It Sy MKPICINSTALL | | 538 | .It Sy MKPICINSTALL |
539 | .YorN | | 539 | .YorN |
540 | Indicates whether the | | 540 | Indicates whether the |
541 | .Xr ar 1 | | 541 | .Xr ar 1 |
542 | format libraries | | 542 | format libraries |
543 | .Sy ( lib*_pic.a ) , | | 543 | .Sy ( lib*_pic.a ) , |
544 | used to generate shared libraries, are installed during a build. | | 544 | used to generate shared libraries, are installed during a build. |
545 | .DFLTy | | 545 | .DFLTy |
546 | . | | 546 | . |
547 | .It Sy MKPROFILE | | 547 | .It Sy MKPROFILE |
548 | .YorN | | 548 | .YorN |
549 | Indicates whether profiled libraries | | 549 | Indicates whether profiled libraries |
550 | .Sy ( lib*_p.a ) | | 550 | .Sy ( lib*_p.a ) |
551 | will be built and installed during a build. | | 551 | will be built and installed during a build. |
552 | .DFLT | | 552 | .DFLT |
553 | .Dq yes ; | | 553 | .Dq yes ; |
554 | however, some platforms turn off | | 554 | however, some platforms turn off |
555 | .Sy MKPROFILE | | 555 | .Sy MKPROFILE |
556 | by default at times due to toolchain problems with profiled code. | | 556 | by default at times due to toolchain problems with profiled code. |
557 | . | | 557 | . |
558 | .It Sy MKREPRO | | 558 | .It Sy MKREPRO |
559 | .YorN | | 559 | .YorN |
560 | Create reproducable builds. | | 560 | Create reproducable builds. |
561 | This enables different switches to make two builds from the same | | 561 | This enables different switches to make two builds from the same |
562 | source tree result in the same build results. | | 562 | source tree result in the same build results. |
563 | .DFLTn | | 563 | .DFLTn |
564 | . | | 564 | . |
565 | .It Sy MKSHARE | | 565 | .It Sy MKSHARE |
566 | .YorN | | 566 | .YorN |
567 | Indicates whether files destined to reside in | | 567 | Indicates whether files destined to reside in |
568 | .Sy DESTDIR Ns Pa /usr/share | | 568 | .Sy DESTDIR Ns Pa /usr/share |
569 | will be built and installed during a build. | | 569 | will be built and installed during a build. |
570 | If set to | | 570 | If set to |
571 | .Dq no , | | 571 | .Dq no , |
572 | then all of | | 572 | then all of |
573 | .Sy MKCATPAGES , MKDOC , MKINFO , MKMAN , | | 573 | .Sy MKCATPAGES , MKDOC , MKINFO , MKMAN , |
574 | and | | 574 | and |
575 | .Sy MKNLS | | 575 | .Sy MKNLS |
576 | will be set to | | 576 | will be set to |
577 | .Dq no | | 577 | .Dq no |
578 | unconditionally. | | 578 | unconditionally. |
579 | .DFLTy | | 579 | .DFLTy |
580 | . | | 580 | . |
581 | .It Sy MKSTRIPIDENT | | 581 | .It Sy MKSTRIPIDENT |
582 | .YorN | | 582 | .YorN |
583 | Indicates whether program binaries and shared libraries should be built | | 583 | Indicates whether RCS IDs, for use with |
584 | to include RCS IDs for use with | | 584 | .Xr ident 1 , |
585 | .Xr ident 1 . | | 585 | should be stripped from program binaries and shared libraries. |
586 | .DFLTn | | 586 | .DFLTn |
587 | . | | 587 | . |
588 | .It Sy MKUNPRIVED | | 588 | .It Sy MKUNPRIVED |
589 | .YorN | | 589 | .YorN |
590 | Indicates whether an unprivileged install will occur. | | 590 | Indicates whether an unprivileged install will occur. |
591 | The user, group, permissions, and file flags, will not be set on | | 591 | The user, group, permissions, and file flags, will not be set on |
592 | the installed items; instead the information will be appended to | | 592 | the installed items; instead the information will be appended to |
593 | a file called | | 593 | a file called |
594 | .Pa METALOG | | 594 | .Pa METALOG |
595 | in | | 595 | in |
596 | .Sy DESTDIR . | | 596 | .Sy DESTDIR . |
597 | The contents of | | 597 | The contents of |
598 | .Pa METALOG | | 598 | .Pa METALOG |
599 | are used during the generation of the distribution tar files to ensure | | 599 | are used during the generation of the distribution tar files to ensure |
600 | that the appropriate file ownership is stored. | | 600 | that the appropriate file ownership is stored. |
601 | .DFLTn | | 601 | .DFLTn |
602 | . | | 602 | . |
603 | .It Sy MKUPDATE | | 603 | .It Sy MKUPDATE |
604 | .YorN | | 604 | .YorN |
605 | Indicates whether all install operations intended to write to | | 605 | Indicates whether all install operations intended to write to |
606 | .Sy DESTDIR | | 606 | .Sy DESTDIR |
607 | will compare file timestamps before installing, and skip the install | | 607 | will compare file timestamps before installing, and skip the install |
608 | phase if the destination files are up-to-date. | | 608 | phase if the destination files are up-to-date. |
609 | This also has implications on full builds (see next subsection). | | 609 | This also has implications on full builds (see next subsection). |
610 | .DFLTn | | 610 | .DFLTn |
611 | . | | 611 | . |
612 | .It Sy MKX11 | | 612 | .It Sy MKX11 |
613 | .YorN | | 613 | .YorN |
614 | Indicates whether X11 is built from | | 614 | Indicates whether X11 is built from |
615 | .Sy X11SRCDIR . | | 615 | .Sy X11SRCDIR . |
616 | .DFLTn | | 616 | .DFLTn |
617 | . | | 617 | . |
618 | .It Sy TOOLDIR | | 618 | .It Sy TOOLDIR |
619 | Directory to hold the host tools, once built. | | 619 | Directory to hold the host tools, once built. |
620 | If specified, must be an absolute path. | | 620 | If specified, must be an absolute path. |
621 | This directory should be unique to a given host system and | | 621 | This directory should be unique to a given host system and |
622 | .Nx | | 622 | .Nx |
623 | source tree. | | 623 | source tree. |
624 | (However, multiple targets may share the same | | 624 | (However, multiple targets may share the same |
625 | .Sy TOOLDIR ; | | 625 | .Sy TOOLDIR ; |
626 | the target-dependent files have unique names.) If unset, a default based | | 626 | the target-dependent files have unique names.) If unset, a default based |
627 | on the | | 627 | on the |
628 | .Xr uname 1 | | 628 | .Xr uname 1 |
629 | information of the host platform will be created in the | | 629 | information of the host platform will be created in the |
630 | .Sy .OBJDIR | | 630 | .Sy .OBJDIR |
631 | of | | 631 | of |
632 | .Pa src . | | 632 | .Pa src . |
633 | .DFLTu | | 633 | .DFLTu |
634 | . | | 634 | . |
635 | .It Sy USETOOLS | | 635 | .It Sy USETOOLS |
636 | Indicates whether the tools specified by | | 636 | Indicates whether the tools specified by |
637 | .Sy TOOLDIR | | 637 | .Sy TOOLDIR |
638 | should be used as part of a build in progress. | | 638 | should be used as part of a build in progress. |
639 | Must be set to | | 639 | Must be set to |
640 | .Dq yes | | 640 | .Dq yes |
641 | if cross-compiling. | | 641 | if cross-compiling. |
642 | .Bl -tag -width "never" | | 642 | .Bl -tag -width "never" |
643 | .It Sy yes | | 643 | .It Sy yes |
644 | Use the tools from | | 644 | Use the tools from |
645 | .Sy TOOLDIR . | | 645 | .Sy TOOLDIR . |
646 | .It Sy no | | 646 | .It Sy no |
647 | Do not use the tools from | | 647 | Do not use the tools from |
648 | .Sy TOOLDIR , | | 648 | .Sy TOOLDIR , |
649 | but refuse to build native compilation tool components that are | | 649 | but refuse to build native compilation tool components that are |
650 | version-specific for that tool. | | 650 | version-specific for that tool. |
651 | .It Sy never | | 651 | .It Sy never |
652 | Do not use the tools from | | 652 | Do not use the tools from |
653 | .Sy TOOLDIR , | | 653 | .Sy TOOLDIR , |
654 | even when building native tool components. | | 654 | even when building native tool components. |
655 | This is similar to the traditional | | 655 | This is similar to the traditional |
656 | .Nx | | 656 | .Nx |
657 | build method, but does | | 657 | build method, but does |
658 | .Em not | | 658 | .Em not |
659 | verify that the compilation tools in use are up-to-date enough in order | | 659 | verify that the compilation tools in use are up-to-date enough in order |
660 | to build the tree successfully. | | 660 | to build the tree successfully. |
661 | This may cause build or runtime problems when building the whole | | 661 | This may cause build or runtime problems when building the whole |
662 | .Nx | | 662 | .Nx |
663 | source tree. | | 663 | source tree. |
664 | .El | | 664 | .El |
665 | .DFLT | | 665 | .DFLT |
666 | .Dq yes , | | 666 | .Dq yes , |
667 | unless | | 667 | unless |
668 | .Sy TOOLCHAIN_MISSING | | 668 | .Sy TOOLCHAIN_MISSING |
669 | is set to | | 669 | is set to |
670 | .Dq yes . | | 670 | .Dq yes . |
671 | .Pp | | 671 | .Pp |
672 | .Sy USETOOLS | | 672 | .Sy USETOOLS |
673 | is also set to | | 673 | is also set to |
674 | .Dq no | | 674 | .Dq no |
675 | when using | | 675 | when using |
676 | .Aq bsd.*.mk | | 676 | .Aq bsd.*.mk |
677 | outside the | | 677 | outside the |
678 | .Nx | | 678 | .Nx |
679 | source tree. | | 679 | source tree. |
680 | . | | 680 | . |
681 | .It Sy X11SRCDIR | | 681 | .It Sy X11SRCDIR |
682 | Directory containing the X11R6 source. | | 682 | Directory containing the X11R6 source. |
683 | If specified, must be an absolute path. | | 683 | If specified, must be an absolute path. |
684 | The main X11R6 source is found in | | 684 | The main X11R6 source is found in |
685 | .Sy X11SRCDIR Ns Pa /xfree/xc . | | 685 | .Sy X11SRCDIR Ns Pa /xfree/xc . |
686 | .DFLT | | 686 | .DFLT |
687 | .Sy NETBSDRCDIR Ns Pa /../xsrc , | | 687 | .Sy NETBSDRCDIR Ns Pa /../xsrc , |
688 | if that exists; otherwise | | 688 | if that exists; otherwise |
689 | .Pa /usr/xsrc . | | 689 | .Pa /usr/xsrc . |
690 | . | | 690 | . |
691 | .It Sy X11FLAVOUR | | 691 | .It Sy X11FLAVOUR |
692 | The style of X11 cross-built, set to either | | 692 | The style of X11 cross-built, set to either |
693 | .Dq Xorg | | 693 | .Dq Xorg |
694 | or | | 694 | or |
695 | .Dq XFree86 . | | 695 | .Dq XFree86 . |
696 | .DFLT | | 696 | .DFLT |
697 | .Dq Xorg | | 697 | .Dq Xorg |
698 | on amd64, i386, macppc, shark and sparc64 platforms, | | 698 | on amd64, i386, macppc, shark and sparc64 platforms, |
699 | .Dq XFree86 | | 699 | .Dq XFree86 |
700 | on everything else. | | 700 | on everything else. |
701 | . | | 701 | . |
702 | .El | | 702 | .El |
703 | . | | 703 | . |
704 | .Ss \*qmake\*q variables for full builds | | 704 | .Ss \*qmake\*q variables for full builds |
705 | These variables only affect the top level | | 705 | These variables only affect the top level |
706 | .Dq Makefile | | 706 | .Dq Makefile |
707 | and do not affect manually building subtrees of the | | 707 | and do not affect manually building subtrees of the |
708 | .Nx | | 708 | .Nx |
709 | source code. | | 709 | source code. |
710 | . | | 710 | . |
711 | .Bl -tag -width "INSTALLWORLDDIR" | | 711 | .Bl -tag -width "INSTALLWORLDDIR" |
712 | . | | 712 | . |
713 | .It Sy INSTALLWORLDDIR | | 713 | .It Sy INSTALLWORLDDIR |
714 | Location for the | | 714 | Location for the |
715 | .Dq make installworld | | 715 | .Dq make installworld |
716 | target to install to. | | 716 | target to install to. |
717 | If specified, must be an absolute path. | | 717 | If specified, must be an absolute path. |
718 | .DFLT | | 718 | .DFLT |
719 | .Dq / | | 719 | .Dq / |
720 | . | | 720 | . |
721 | .It Sy MKOBJDIRS | | 721 | .It Sy MKOBJDIRS |
722 | .YorN | | 722 | .YorN |
723 | Indicates whether object directories will be created automatically | | 723 | Indicates whether object directories will be created automatically |
724 | (via a | | 724 | (via a |
725 | .Dq make obj | | 725 | .Dq make obj |
726 | pass) at the start of a build. | | 726 | pass) at the start of a build. |
727 | .DFLTn | | 727 | .DFLTn |
728 | .Pp | | 728 | .Pp |
729 | If using | | 729 | If using |
730 | .Sy build.sh , | | 730 | .Sy build.sh , |
731 | the default is | | 731 | the default is |
732 | .Dq yes . | | 732 | .Dq yes . |
733 | This may be set back to | | 733 | This may be set back to |
734 | .Dq no | | 734 | .Dq no |
735 | by giving | | 735 | by giving |
736 | .Sy build.sh | | 736 | .Sy build.sh |
737 | the | | 737 | the |
738 | .Fl o | | 738 | .Fl o |
739 | option. | | 739 | option. |
740 | . | | 740 | . |
741 | .It Sy MKUPDATE | | 741 | .It Sy MKUPDATE |
742 | .YorN | | 742 | .YorN |
743 | If set, then in addition to the effects described for | | 743 | If set, then in addition to the effects described for |
744 | .Sy MKUPDATE=yes | | 744 | .Sy MKUPDATE=yes |
745 | above, this implies the effects of | | 745 | above, this implies the effects of |
746 | .Sy NOCLEANDIR | | 746 | .Sy NOCLEANDIR |
747 | (i.e., | | 747 | (i.e., |
748 | .Dq make cleandir | | 748 | .Dq make cleandir |
749 | is avoided). | | 749 | is avoided). |
750 | .DFLTn | | 750 | .DFLTn |
751 | .Pp | | 751 | .Pp |
752 | If using | | 752 | If using |
753 | .Sy build.sh , | | 753 | .Sy build.sh , |
754 | this may be set by giving the | | 754 | this may be set by giving the |
755 | .Fl u | | 755 | .Fl u |
756 | option. | | 756 | option. |
757 | . | | 757 | . |
758 | .It Sy NBUILDJOBS | | 758 | .It Sy NBUILDJOBS |
759 | Now obsolete. | | 759 | Now obsolete. |
760 | Use the | | 760 | Use the |
761 | .Xr make 1 | | 761 | .Xr make 1 |
762 | option | | 762 | option |
763 | .Fl j , | | 763 | .Fl j , |
764 | instead. | | 764 | instead. |
765 | See below. | | 765 | See below. |
766 | .DFLTu | | 766 | .DFLTu |
767 | . | | 767 | . |
768 | .It Sy NOCLEANDIR | | 768 | .It Sy NOCLEANDIR |
769 | If set, avoids the | | 769 | If set, avoids the |
770 | .Dq make cleandir | | 770 | .Dq make cleandir |
771 | phase of a full build. | | 771 | phase of a full build. |
772 | This has the effect of allowing only changed | | 772 | This has the effect of allowing only changed |
773 | files in a source tree to be recompiled. | | 773 | files in a source tree to be recompiled. |
774 | This can speed up builds when updating only a few files in the tree. | | 774 | This can speed up builds when updating only a few files in the tree. |
775 | .DFLTu | | 775 | .DFLTu |
776 | .Pp | | 776 | .Pp |
777 | See also | | 777 | See also |
778 | .Sy MKUPDATE . | | 778 | .Sy MKUPDATE . |
779 | . | | 779 | . |
780 | .It Sy NODISTRIBDIRS | | 780 | .It Sy NODISTRIBDIRS |
781 | If set, avoids the | | 781 | If set, avoids the |
782 | .Dq make distrib-dirs | | 782 | .Dq make distrib-dirs |
783 | phase of a full build. | | 783 | phase of a full build. |
784 | This skips running | | 784 | This skips running |
785 | .Xr mtree 8 | | 785 | .Xr mtree 8 |
786 | on | | 786 | on |
787 | .Sy DESTDIR , | | 787 | .Sy DESTDIR , |
788 | useful on systems where building as an unprivileged user, or where it is | | 788 | useful on systems where building as an unprivileged user, or where it is |
789 | known that the system-wide mtree files have not changed. | | 789 | known that the system-wide mtree files have not changed. |
790 | .DFLTu | | 790 | .DFLTu |
791 | . | | 791 | . |
792 | .It Sy NOINCLUDES | | 792 | .It Sy NOINCLUDES |
793 | If set, avoids the | | 793 | If set, avoids the |
794 | .Dq make includes | | 794 | .Dq make includes |
795 | phase of a full build. | | 795 | phase of a full build. |
796 | This has the effect of preventing | | 796 | This has the effect of preventing |
797 | .Xr make 1 | | 797 | .Xr make 1 |
798 | from thinking that some programs are out-of-date simply because the | | 798 | from thinking that some programs are out-of-date simply because the |
799 | system include files have changed. | | 799 | system include files have changed. |
800 | However, this option should not be used when updating the entire | | 800 | However, this option should not be used when updating the entire |
801 | .Nx | | 801 | .Nx |
802 | source tree arbitrarily; it is suggested to use | | 802 | source tree arbitrarily; it is suggested to use |
803 | .Sy MKUPDATE=yes | | 803 | .Sy MKUPDATE=yes |
804 | instead in that case. | | 804 | instead in that case. |
805 | .DFLTu | | 805 | .DFLTu |
806 | . | | 806 | . |
807 | .It Sy RELEASEDIR | | 807 | .It Sy RELEASEDIR |
808 | If set, specifies the directory to which a | | 808 | If set, specifies the directory to which a |
809 | .Xr release 7 | | 809 | .Xr release 7 |
810 | layout will be written at the end of a | | 810 | layout will be written at the end of a |
811 | .Dq make release . | | 811 | .Dq make release . |
812 | If specified, must be an absolute path. | | 812 | If specified, must be an absolute path. |
813 | .DFLTu | | 813 | .DFLTu |
814 | .Pp | | 814 | .Pp |
815 | .Em Note : | | 815 | .Em Note : |
816 | .Sy build.sh | | 816 | .Sy build.sh |
817 | will provide a default of | | 817 | will provide a default of |
818 | .Pa releasedir | | 818 | .Pa releasedir |
819 | (in the top-level | | 819 | (in the top-level |
820 | .Sy .OBJDIR ) | | 820 | .Sy .OBJDIR ) |
821 | unless run in | | 821 | unless run in |
822 | .Sq expert | | 822 | .Sq expert |
823 | mode. | | 823 | mode. |
824 | . | | 824 | . |
825 | .El | | 825 | .El |
826 | . | | 826 | . |
827 | .Sh BUILDING | | 827 | .Sh BUILDING |
828 | . | | 828 | . |
829 | .Ss \*qmake\*q command line options | | 829 | .Ss \*qmake\*q command line options |
830 | This is not a summary of all the options available to | | 830 | This is not a summary of all the options available to |
831 | .Xr make 1 ; | | 831 | .Xr make 1 ; |
832 | only the options used most frequently with | | 832 | only the options used most frequently with |
833 | .Nx | | 833 | .Nx |
834 | builds are listed here. | | 834 | builds are listed here. |
835 | . | | 835 | . |
836 | .Bl -tag -width "var=value" | | 836 | .Bl -tag -width "var=value" |
837 | . | | 837 | . |
838 | .It Fl j Ar njob | | 838 | .It Fl j Ar njob |
839 | Run up to | | 839 | Run up to |
840 | .Ar njob | | 840 | .Ar njob |
841 | .Xr make 1 | | 841 | .Xr make 1 |
842 | subjobs in parallel. | | 842 | subjobs in parallel. |
843 | Makefiles should use .WAIT or have explicit dependencies | | 843 | Makefiles should use .WAIT or have explicit dependencies |
844 | as necessary to enforce build ordering. | | 844 | as necessary to enforce build ordering. |
845 | . | | 845 | . |
846 | .It Fl m Ar dir | | 846 | .It Fl m Ar dir |
847 | Specify the default directory for searching for system Makefile | | 847 | Specify the default directory for searching for system Makefile |
848 | segments, mainly the | | 848 | segments, mainly the |
849 | .Aq bsd.*.mk | | 849 | .Aq bsd.*.mk |
850 | files. | | 850 | files. |
851 | When building any full | | 851 | When building any full |
852 | .Nx | | 852 | .Nx |
853 | source tree, this should be set to the | | 853 | source tree, this should be set to the |
854 | .Dq share/mk | | 854 | .Dq share/mk |
855 | directory in the source tree. | | 855 | directory in the source tree. |
856 | This is set automatically when building from the top level, or when using | | 856 | This is set automatically when building from the top level, or when using |
857 | .Sy build.sh . | | 857 | .Sy build.sh . |
858 | . | | 858 | . |
859 | .It Fl n | | 859 | .It Fl n |
860 | Display the commands that would have been executed, but do not | | 860 | Display the commands that would have been executed, but do not |
861 | actually execute them. | | 861 | actually execute them. |
862 | This will still cause recursion to take place. | | 862 | This will still cause recursion to take place. |
863 | . | | 863 | . |
864 | .It Fl V Ar var | | 864 | .It Fl V Ar var |
865 | Print | | 865 | Print |
866 | .Xr make 1 Ns 's | | 866 | .Xr make 1 Ns 's |
867 | idea of the value of | | 867 | idea of the value of |
868 | .Ar var . | | 868 | .Ar var . |
869 | Does not build any targets. | | 869 | Does not build any targets. |
870 | . | | 870 | . |
871 | .It Em var=value | | 871 | .It Em var=value |
872 | Set the variable | | 872 | Set the variable |
873 | .Em var | | 873 | .Em var |
874 | to | | 874 | to |
875 | .Em value , | | 875 | .Em value , |
876 | overriding any setting specified by the process environment, the | | 876 | overriding any setting specified by the process environment, the |
877 | .Sy MAKECONF | | 877 | .Sy MAKECONF |
878 | configuration file, or the system Makefile segments. | | 878 | configuration file, or the system Makefile segments. |
879 | . | | 879 | . |
880 | .El | | 880 | .El |
881 | . | | 881 | . |
882 | .Ss \*qmake\*q targets | | 882 | .Ss \*qmake\*q targets |
883 | . | | 883 | . |
884 | These default targets may be built by running | | 884 | These default targets may be built by running |
885 | .Xr make 1 | | 885 | .Xr make 1 |
886 | in any subtree of the | | 886 | in any subtree of the |
887 | .Nx | | 887 | .Nx |
888 | source code. | | 888 | source code. |
889 | It is recommended that none of these be used from the top | | 889 | It is recommended that none of these be used from the top |
890 | level Makefile; as a specific exception, | | 890 | level Makefile; as a specific exception, |
891 | .Dq make obj | | 891 | .Dq make obj |
892 | and | | 892 | and |
893 | .Dq make cleandir | | 893 | .Dq make cleandir |
894 | are useful in that context. | | 894 | are useful in that context. |
895 | . | | 895 | . |
896 | .Bl -tag -width "dependall" | | 896 | .Bl -tag -width "dependall" |
897 | . | | 897 | . |
898 | .It Sy all | | 898 | .It Sy all |
899 | Build programs, libraries, and preformatted documentation. | | 899 | Build programs, libraries, and preformatted documentation. |
900 | . | | 900 | . |
901 | .It Sy clean | | 901 | .It Sy clean |
902 | Remove program and library object code files. | | 902 | Remove program and library object code files. |
903 | . | | 903 | . |
904 | .It Sy cleandir | | 904 | .It Sy cleandir |
905 | Same as | | 905 | Same as |
906 | .Sy clean , | | 906 | .Sy clean , |
907 | but also remove preformatted documentation, dependency files generated | | 907 | but also remove preformatted documentation, dependency files generated |
908 | by | | 908 | by |
909 | .Dq make depend , | | 909 | .Dq make depend , |
910 | and any other files known to be created at build time. | | 910 | and any other files known to be created at build time. |
911 | . | | 911 | . |
912 | .It Sy depend | | 912 | .It Sy depend |
913 | Create dependency files | | 913 | Create dependency files |
914 | .Sy ( .depend ) | | 914 | .Sy ( .depend ) |
915 | containing more detailed information about the dependencies of source | | 915 | containing more detailed information about the dependencies of source |
916 | code on header files. | | 916 | code on header files. |
917 | Allows programs to be recompiled automatically when a dependency changes. | | 917 | Allows programs to be recompiled automatically when a dependency changes. |
918 | . | | 918 | . |
919 | .It Sy dependall | | 919 | .It Sy dependall |
920 | Does a | | 920 | Does a |
921 | .Dq make depend | | 921 | .Dq make depend |
922 | immediately followed by a | | 922 | immediately followed by a |
923 | .Dq make all . | | 923 | .Dq make all . |
924 | This improves cache locality of the build since both passes read the source | | 924 | This improves cache locality of the build since both passes read the source |
925 | files in their entirety. | | 925 | files in their entirety. |
926 | . | | 926 | . |
927 | .It Sy distclean | | 927 | .It Sy distclean |
928 | Synonym for | | 928 | Synonym for |
929 | .Sy cleandir . | | 929 | .Sy cleandir . |
930 | . | | 930 | . |
931 | .It Sy includes | | 931 | .It Sy includes |
932 | Build and install system header files. | | 932 | Build and install system header files. |
933 | Typically needed before any system libraries or programs can be built. | | 933 | Typically needed before any system libraries or programs can be built. |
934 | . | | 934 | . |
935 | .It Sy install | | 935 | .It Sy install |
936 | Install programs, libraries, and documentation into | | 936 | Install programs, libraries, and documentation into |
937 | .Sy DESTDIR . | | 937 | .Sy DESTDIR . |
938 | Few files will be installed to | | 938 | Few files will be installed to |
939 | .Sy DESTDIR Ns Pa /dev , | | 939 | .Sy DESTDIR Ns Pa /dev , |
940 | .Sy DESTDIR Ns Pa /etc , | | 940 | .Sy DESTDIR Ns Pa /etc , |
941 | .Sy DESTDIR Ns Pa /root | | 941 | .Sy DESTDIR Ns Pa /root |
942 | or | | 942 | or |
943 | .Sy DESTDIR Ns Pa /var | | 943 | .Sy DESTDIR Ns Pa /var |
944 | in order to prevent user supplied configuration data from being overwritten. | | 944 | in order to prevent user supplied configuration data from being overwritten. |
945 | .It Sy lint | | 945 | .It Sy lint |
946 | Run | | 946 | Run |
947 | .Xr lint 1 | | 947 | .Xr lint 1 |
948 | against the C source code, where appropriate, and generate | | 948 | against the C source code, where appropriate, and generate |
949 | system-installed lint libraries. | | 949 | system-installed lint libraries. |
950 | . | | 950 | . |
951 | .It Sy obj | | 951 | .It Sy obj |
952 | Create object directories to be used for built files, instead of | | 952 | Create object directories to be used for built files, instead of |
953 | building directly in the source tree. | | 953 | building directly in the source tree. |
954 | . | | 954 | . |
955 | .It Sy tags | | 955 | .It Sy tags |
956 | Create | | 956 | Create |
957 | .Xr ctags 1 | | 957 | .Xr ctags 1 |
958 | searchable function lists usable by the | | 958 | searchable function lists usable by the |
959 | .Xr ex 1 | | 959 | .Xr ex 1 |
960 | and | | 960 | and |
961 | .Xr vi 1 | | 961 | .Xr vi 1 |
962 | text editors. | | 962 | text editors. |
963 | . | | 963 | . |
964 | .El | | 964 | .El |
965 | . | | 965 | . |
966 | .Ss \*qmake\*q targets for the top level | | 966 | .Ss \*qmake\*q targets for the top level |
967 | . | | 967 | . |
968 | Additional | | 968 | Additional |
969 | .Xr make 1 | | 969 | .Xr make 1 |
970 | targets are usable specifically from the top source level to facilitate | | 970 | targets are usable specifically from the top source level to facilitate |
971 | building the entire | | 971 | building the entire |
972 | .Nx | | 972 | .Nx |
973 | source tree. | | 973 | source tree. |
974 | . | | 974 | . |
975 | .Bl -tag -width "distribution" | | 975 | .Bl -tag -width "distribution" |
976 | . | | 976 | . |
977 | .It Sy build | | 977 | .It Sy build |
978 | Build the entire | | 978 | Build the entire |
979 | .Nx | | 979 | .Nx |
980 | system (except the kernel). | | 980 | system (except the kernel). |
981 | This orders portions of the source tree such that prerequisites | | 981 | This orders portions of the source tree such that prerequisites |
982 | will be built in the proper order. | | 982 | will be built in the proper order. |
983 | . | | 983 | . |
984 | .It Sy distribution | | 984 | .It Sy distribution |
985 | Do a | | 985 | Do a |
986 | .Dq make build , | | 986 | .Dq make build , |
987 | and then install a full distribution (which does not include a kernel) into | | 987 | and then install a full distribution (which does not include a kernel) into |
988 | .Sy DESTDIR , | | 988 | .Sy DESTDIR , |
989 | including files in | | 989 | including files in |
990 | .Sy DESTDIR Ns Pa /dev , | | 990 | .Sy DESTDIR Ns Pa /dev , |
991 | .Sy DESTDIR Ns Pa /etc , | | 991 | .Sy DESTDIR Ns Pa /etc , |
992 | .Sy DESTDIR Ns Pa /root | | 992 | .Sy DESTDIR Ns Pa /root |
993 | and | | 993 | and |
994 | .Sy DESTDIR Ns Pa /var . | | 994 | .Sy DESTDIR Ns Pa /var . |
995 | . | | 995 | . |
996 | .It Sy buildworld | | 996 | .It Sy buildworld |
997 | As per | | 997 | As per |
998 | .Dq make distribution , | | 998 | .Dq make distribution , |
999 | except that it ensures that | | 999 | except that it ensures that |
1000 | .Sy DESTDIR | | 1000 | .Sy DESTDIR |
1001 | is not the root directory. | | 1001 | is not the root directory. |
1002 | . | | 1002 | . |
1003 | .It Sy installworld | | 1003 | .It Sy installworld |
1004 | Install the distribution from | | 1004 | Install the distribution from |
1005 | .Sy DESTDIR | | 1005 | .Sy DESTDIR |
1006 | to | | 1006 | to |
1007 | .Sy INSTALLWORLDDIR , | | 1007 | .Sy INSTALLWORLDDIR , |
1008 | which defaults to the root directory. | | 1008 | which defaults to the root directory. |
1009 | Ensures that | | 1009 | Ensures that |
1010 | .Sy INSTALLWORLDDIR | | 1010 | .Sy INSTALLWORLDDIR |
1011 | is not the root directory if cross compiling. | | 1011 | is not the root directory if cross compiling. |
1012 | .Pp | | 1012 | .Pp |
1013 | The | | 1013 | The |
1014 | .Sy INSTALLSETS | | 1014 | .Sy INSTALLSETS |
1015 | environment variable may be set to a space-separated list of | | 1015 | environment variable may be set to a space-separated list of |
1016 | distribution sets to be installed. | | 1016 | distribution sets to be installed. |
1017 | By default, all sets except | | 1017 | By default, all sets except |
1018 | .Dq etc | | 1018 | .Dq etc |
1019 | and | | 1019 | and |
1020 | .Dq xetc | | 1020 | .Dq xetc |
1021 | are installed, so most files in | | 1021 | are installed, so most files in |
1022 | .Sy INSTALLWORLDDIR Ns Pa /etc | | 1022 | .Sy INSTALLWORLDDIR Ns Pa /etc |
1023 | will not be installed or modified. | | 1023 | will not be installed or modified. |
1024 | .Pp | | 1024 | .Pp |
1025 | .Em Note : | | 1025 | .Em Note : |
1026 | Before performing this operation with | | 1026 | Before performing this operation with |
1027 | .Sy INSTALLWORLDDIR Ns = Ns Pa / , | | 1027 | .Sy INSTALLWORLDDIR Ns = Ns Pa / , |
1028 | it is highly recommended that you upgrade your kernel and reboot. | | 1028 | it is highly recommended that you upgrade your kernel and reboot. |
1029 | After performing this operation, | | 1029 | After performing this operation, |
1030 | it is recommended that you use | | 1030 | it is recommended that you use |
1031 | .Xr etcupdate 8 | | 1031 | .Xr etcupdate 8 |
1032 | to update files in | | 1032 | to update files in |
1033 | .Sy INSTALLWORLDDIR Ns Pa /etc | | 1033 | .Sy INSTALLWORLDDIR Ns Pa /etc |
1034 | and that you use | | 1034 | and that you use |
1035 | .Xr postinstall 8 | | 1035 | .Xr postinstall 8 |
1036 | to check for inconsistencies (and possibly to fix them). | | 1036 | to check for inconsistencies (and possibly to fix them). |
1037 | .It Sy sets | | 1037 | .It Sy sets |
1038 | Create distribution sets from | | 1038 | Create distribution sets from |
1039 | .Sy DESTDIR | | 1039 | .Sy DESTDIR |
1040 | into | | 1040 | into |
1041 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/sets . | | 1041 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/sets . |
1042 | Should be run after | | 1042 | Should be run after |
1043 | .Dq make distribution , | | 1043 | .Dq make distribution , |
1044 | as | | 1044 | as |
1045 | .Dq make build | | 1045 | .Dq make build |
1046 | alone does not install all of the required files. | | 1046 | alone does not install all of the required files. |
1047 | . | | 1047 | . |
1048 | .It Sy sourcesets | | 1048 | .It Sy sourcesets |
1049 | Create source sets of the source tree into | | 1049 | Create source sets of the source tree into |
1050 | .Sy RELEASEDIR Ns Pa /source/sets . | | 1050 | .Sy RELEASEDIR Ns Pa /source/sets . |
1051 | . | | 1051 | . |
1052 | .It Sy syspkgs | | 1052 | .It Sy syspkgs |
1053 | Create syspkgs from | | 1053 | Create syspkgs from |
1054 | .Sy DESTDIR | | 1054 | .Sy DESTDIR |
1055 | into | | 1055 | into |
1056 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/syspkgs . | | 1056 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/syspkgs . |
1057 | Should be run after | | 1057 | Should be run after |
1058 | .Dq make distribution , | | 1058 | .Dq make distribution , |
1059 | as | | 1059 | as |
1060 | .Dq make build | | 1060 | .Dq make build |
1061 | alone does not install all of the required files. | | 1061 | alone does not install all of the required files. |
1062 | . | | 1062 | . |
1063 | .It Sy release | | 1063 | .It Sy release |
1064 | Do a | | 1064 | Do a |
1065 | .Dq make distribution , | | 1065 | .Dq make distribution , |
1066 | build kernels, distribution media, and install sets | | 1066 | build kernels, distribution media, and install sets |
1067 | (this as per | | 1067 | (this as per |
1068 | .Dq make sets ) , | | 1068 | .Dq make sets ) , |
1069 | and | | 1069 | and |
1070 | then package the system into a standard release layout as described by | | 1070 | then package the system into a standard release layout as described by |
1071 | .Xr release 7 . | | 1071 | .Xr release 7 . |
1072 | This requires that | | 1072 | This requires that |
1073 | .Sy RELEASEDIR | | 1073 | .Sy RELEASEDIR |
1074 | be set (see above). | | 1074 | be set (see above). |
1075 | . | | 1075 | . |
1076 | .It Sy iso-image | | 1076 | .It Sy iso-image |
1077 | Create a | | 1077 | Create a |
1078 | .Nx | | 1078 | .Nx |
1079 | installation CD-ROM image in the | | 1079 | installation CD-ROM image in the |
1080 | .Sy RELEASEDIR Ns Pa /iso | | 1080 | .Sy RELEASEDIR Ns Pa /iso |
1081 | directory. | | 1081 | directory. |
1082 | The CD-ROM file system will have a layout as described in | | 1082 | The CD-ROM file system will have a layout as described in |
1083 | .Xr release 7 . | | 1083 | .Xr release 7 . |
1084 | .Pp | | 1084 | .Pp |
1085 | For most machine types, the CD-ROM will be bootable, and will automatically | | 1085 | For most machine types, the CD-ROM will be bootable, and will automatically |
1086 | run the | | 1086 | run the |
1087 | .Xr sysinst 8 | | 1087 | .Xr sysinst 8 |
1088 | menu-based installation program, which can be used to install or upgrade a | | 1088 | menu-based installation program, which can be used to install or upgrade a |
1089 | .Nx | | 1089 | .Nx |
1090 | system. | | 1090 | system. |
1091 | Bootable CD-ROMs also contain tools that may be useful in | | 1091 | Bootable CD-ROMs also contain tools that may be useful in |
1092 | repairing a damaged | | 1092 | repairing a damaged |
1093 | .Nx | | 1093 | .Nx |
1094 | installation. | | 1094 | installation. |
1095 | .Pp | | 1095 | .Pp |
1096 | Before | | 1096 | Before |
1097 | .Dq make iso-image | | 1097 | .Dq make iso-image |
1098 | is attempted, RELEASEDIR must be populated by | | 1098 | is attempted, RELEASEDIR must be populated by |
1099 | .Dq make release | | 1099 | .Dq make release |
1100 | or equivalent. | | 1100 | or equivalent. |
1101 | .Pp | | 1101 | .Pp |
1102 | Note that other, smaller, CD-ROM images may be created in the | | 1102 | Note that other, smaller, CD-ROM images may be created in the |
1103 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/cdrom | | 1103 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/cdrom |
1104 | directory by | | 1104 | directory by |
1105 | .Dq "make release" . | | 1105 | .Dq "make release" . |
1106 | These smaller images usually contain the same tools as the larger images in | | 1106 | These smaller images usually contain the same tools as the larger images in |
1107 | .Sy RELEASEDIR Ns Pa /iso , | | 1107 | .Sy RELEASEDIR Ns Pa /iso , |
1108 | but do not contain additional content such as the distribution sets. | | 1108 | but do not contain additional content such as the distribution sets. |
1109 | .Pp | | 1109 | .Pp |
1110 | Note that the mac68k port still uses an older method of creating | | 1110 | Note that the mac68k port still uses an older method of creating |
1111 | CD-ROM images. | | 1111 | CD-ROM images. |
1112 | This requires the | | 1112 | This requires the |
1113 | .Xr mkisofs 1 | | 1113 | .Xr mkisofs 1 |
1114 | utility, which is not part of | | 1114 | utility, which is not part of |
1115 | .Nx , | | 1115 | .Nx , |
1116 | but which can be installed from | | 1116 | but which can be installed from |
1117 | .Pa pkgsrc/sysutils/cdrtools . | | 1117 | .Pa pkgsrc/sysutils/cdrtools . |
1118 | . | | 1118 | . |
1119 | .It Sy iso-image-source | | 1119 | .It Sy iso-image-source |
1120 | Create a | | 1120 | Create a |
1121 | .Nx | | 1121 | .Nx |
1122 | installation CD-ROM image in the | | 1122 | installation CD-ROM image in the |
1123 | .Sy RELEASEDIR Ns Pa /iso | | 1123 | .Sy RELEASEDIR Ns Pa /iso |
1124 | directory. | | 1124 | directory. |
1125 | The CD-ROM file system will have a layout as described in | | 1125 | The CD-ROM file system will have a layout as described in |
1126 | .Xr release 7 . | | 1126 | .Xr release 7 . |
1127 | It will have top level directories for the machine type and source. | | 1127 | It will have top level directories for the machine type and source. |
1128 | .Pp | | 1128 | .Pp |
1129 | For most machine types, the CD-ROM will be bootable, and will automatically | | 1129 | For most machine types, the CD-ROM will be bootable, and will automatically |
1130 | run the | | 1130 | run the |
1131 | .Xr sysinst 8 | | 1131 | .Xr sysinst 8 |
1132 | menu-based installation program, which can be used to install or upgrade a | | 1132 | menu-based installation program, which can be used to install or upgrade a |
1133 | .Nx | | 1133 | .Nx |
1134 | system. | | 1134 | system. |
1135 | Bootable CD-ROMs also contain tools that may be useful in | | 1135 | Bootable CD-ROMs also contain tools that may be useful in |
1136 | repairing a damaged | | 1136 | repairing a damaged |
1137 | .Nx | | 1137 | .Nx |
1138 | installation. | | 1138 | installation. |
1139 | .Pp | | 1139 | .Pp |
1140 | Before | | 1140 | Before |
1141 | .Dq make iso-image-source | | 1141 | .Dq make iso-image-source |
1142 | is attempted, RELEASEDIR must be populated by | | 1142 | is attempted, RELEASEDIR must be populated by |
1143 | .Dq make sourcesets release | | 1143 | .Dq make sourcesets release |
1144 | or equivalent. | | 1144 | or equivalent. |
1145 | .Pp | | 1145 | .Pp |
1146 | Note that other, smaller, CD-ROM images may be created in the | | 1146 | Note that other, smaller, CD-ROM images may be created in the |
1147 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/cdrom | | 1147 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/cdrom |
1148 | directory by | | 1148 | directory by |
1149 | .Dq make release . | | 1149 | .Dq make release . |
1150 | These smaller images usually contain the same tools as the larger images in | | 1150 | These smaller images usually contain the same tools as the larger images in |
1151 | .Sy RELEASEDIR Ns Pa /iso , | | 1151 | .Sy RELEASEDIR Ns Pa /iso , |
1152 | but do not contain additional content such as the distribution sets. | | 1152 | but do not contain additional content such as the distribution sets. |
1153 | .Pp | | 1153 | .Pp |
1154 | Note that the mac68k port still uses an older method of creating | | 1154 | Note that the mac68k port still uses an older method of creating |
1155 | CD-ROM images. | | 1155 | CD-ROM images. |
1156 | This requires the | | 1156 | This requires the |
1157 | .Xr mkisofs 1 | | 1157 | .Xr mkisofs 1 |
1158 | utility, which is not part of | | 1158 | utility, which is not part of |
1159 | .Nx , | | 1159 | .Nx , |
1160 | but which can be installed from | | 1160 | but which can be installed from |
1161 | .Pa pkgsrc/sysutils/cdrtools . | | 1161 | .Pa pkgsrc/sysutils/cdrtools . |
1162 | . | | 1162 | . |
1163 | .It Sy install-image | | 1163 | .It Sy install-image |
1164 | Create a bootable | | 1164 | Create a bootable |
1165 | .Nx | | 1165 | .Nx |
1166 | installation disk image in the | | 1166 | installation disk image in the |
1167 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/installimage | | 1167 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/installimage |
1168 | directory. | | 1168 | directory. |
1169 | The installation disk image is suitable for copying to | | 1169 | The installation disk image is suitable for copying to |
1170 | bootable USB flash memory sticks, etc., for machines which | | 1170 | bootable USB flash memory sticks, etc., for machines which |
1171 | are able to boot from such devices. | | 1171 | are able to boot from such devices. |
1172 | The file system in the bootable disk image will have a layout | | 1172 | The file system in the bootable disk image will have a layout |
1173 | as described in | | 1173 | as described in |
1174 | .Xr release 7 . | | 1174 | .Xr release 7 . |
1175 | .Pp | | 1175 | .Pp |
1176 | The installation image is bootable, and will automatically | | 1176 | The installation image is bootable, and will automatically |
1177 | run the | | 1177 | run the |
1178 | .Xr sysinst 8 | | 1178 | .Xr sysinst 8 |
1179 | menu-based installation program, which can be used to install or upgrade a | | 1179 | menu-based installation program, which can be used to install or upgrade a |
1180 | .Nx | | 1180 | .Nx |
1181 | system. | | 1181 | system. |
1182 | The image also contains tools that may be | | 1182 | The image also contains tools that may be |
1183 | useful in repairing a damaged | | 1183 | useful in repairing a damaged |
1184 | .Nx | | 1184 | .Nx |
1185 | installation. | | 1185 | installation. |
1186 | .Pp | | 1186 | .Pp |
1187 | Before | | 1187 | Before |
1188 | .Dq make install-image | | 1188 | .Dq make install-image |
1189 | is attempted, | | 1189 | is attempted, |
1190 | .Sy RELEASEDIR | | 1190 | .Sy RELEASEDIR |
1191 | must be populated by | | 1191 | must be populated by |
1192 | .Dq make release | | 1192 | .Dq make release |
1193 | or equivalent. | | 1193 | or equivalent. |
1194 | The build must have been performed with | | 1194 | The build must have been performed with |
1195 | .Sy MKUNPRIVED=yes | | 1195 | .Sy MKUNPRIVED=yes |
1196 | because | | 1196 | because |
1197 | .Dq make install-image | | 1197 | .Dq make install-image |
1198 | relies on information in | | 1198 | relies on information in |
1199 | .Sy DESTDIR Ns Pa /METALOG . | | 1199 | .Sy DESTDIR Ns Pa /METALOG . |
1200 | . | | 1200 | . |
1201 | .It live-image | | 1201 | .It live-image |
1202 | Create | | 1202 | Create |
1203 | .Nx | | 1203 | .Nx |
1204 | live images in the | | 1204 | live images in the |
1205 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/liveimage | | 1205 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/liveimage |
1206 | directory. | | 1206 | directory. |
1207 | The live image contains all necessary files | | 1207 | The live image contains all necessary files |
1208 | to boot | | 1208 | to boot |
1209 | .Nx | | 1209 | .Nx |
1210 | up to multi-user mode, including all files | | 1210 | up to multi-user mode, including all files |
1211 | which should be extracted during installation, | | 1211 | which should be extracted during installation, |
1212 | .Nx | | 1212 | .Nx |
1213 | disklabel, bootloaders, etc. | | 1213 | disklabel, bootloaders, etc. |
1214 | .Pp | | 1214 | .Pp |
1215 | The live image is suitable for use as a disk image in | | 1215 | The live image is suitable for use as a disk image in |
1216 | virtual machine environments such as QEMU, | | 1216 | virtual machine environments such as QEMU, |
1217 | and also useful to boot | | 1217 | and also useful to boot |
1218 | .Nx | | 1218 | .Nx |
1219 | from a USB flash memory stick | | 1219 | from a USB flash memory stick |
1220 | on a real machine, without the need for installation. | | 1220 | on a real machine, without the need for installation. |
1221 | .Pp | | 1221 | .Pp |
1222 | Before | | 1222 | Before |
1223 | .Dq make live-image | | 1223 | .Dq make live-image |
1224 | is attempted, RELEASEDIR must be populated by | | 1224 | is attempted, RELEASEDIR must be populated by |
1225 | .Dq make release | | 1225 | .Dq make release |
1226 | or equivalent. | | 1226 | or equivalent. |
1227 | The build must have been performed with | | 1227 | The build must have been performed with |
1228 | .Sy MKUNPRIVED=yes | | 1228 | .Sy MKUNPRIVED=yes |
1229 | because | | 1229 | because |
1230 | .Dq make install-image | | 1230 | .Dq make install-image |
1231 | relies on information in | | 1231 | relies on information in |
1232 | .Sy DESTDIR Ns Pa /METALOG . | | 1232 | .Sy DESTDIR Ns Pa /METALOG . |
1233 | . | | 1233 | . |
1234 | .It Sy regression-tests | | 1234 | .It Sy regression-tests |
1235 | Can only be run after building the regression tests in the directory | | 1235 | Can only be run after building the regression tests in the directory |
1236 | .Dq regress . | | 1236 | .Dq regress . |
1237 | Runs those compiled regression tests on the local host. | | 1237 | Runs those compiled regression tests on the local host. |
1238 | Note that most tests are now managed instead using | | 1238 | Note that most tests are now managed instead using |
1239 | .Xr atf 7 ; | | 1239 | .Xr atf 7 ; |
1240 | this target should probably run those as well but currently does not. | | 1240 | this target should probably run those as well but currently does not. |
1241 | . | | 1241 | . |
1242 | .El | | 1242 | .El |
1243 | . | | 1243 | . |
1244 | .Ss The \*qbuild.sh\*q script | | 1244 | .Ss The \*qbuild.sh\*q script |
1245 | . | | 1245 | . |
1246 | This script file is a shell script designed to build the | | 1246 | This script file is a shell script designed to build the |
1247 | entire | | 1247 | entire |
1248 | .Nx | | 1248 | .Nx |
1249 | system on any host with a suitable modern shell and some common | | 1249 | system on any host with a suitable modern shell and some common |
1250 | utilities. | | 1250 | utilities. |
1251 | The required shell features are described under the | | 1251 | The required shell features are described under the |
1252 | .Sy HOST_SH | | 1252 | .Sy HOST_SH |
1253 | variable. | | 1253 | variable. |
1254 | .Pp | | 1254 | .Pp |
1255 | If a host system's default shell does support the required | | 1255 | If a host system's default shell does support the required |
1256 | features, then we suggest that you explicitly specify | | 1256 | features, then we suggest that you explicitly specify |
1257 | a suitable shell using a command like | | 1257 | a suitable shell using a command like |
1258 | .Bd -unfilled -offset indent | | 1258 | .Bd -unfilled -offset indent |
1259 | .Li /path/to/suitable/shell build.sh Op Ar options | | 1259 | .Li /path/to/suitable/shell build.sh Op Ar options |
1260 | .Ed | | 1260 | .Ed |
1261 | .Pp | | 1261 | .Pp |
1262 | The above command will usually enable | | 1262 | The above command will usually enable |
1263 | .Nm build.sh | | 1263 | .Nm build.sh |
1264 | to automatically set | | 1264 | to automatically set |
1265 | .Sy HOST_SH Ns Cm = Ns Pa /path/to/suitable/shell , | | 1265 | .Sy HOST_SH Ns Cm = Ns Pa /path/to/suitable/shell , |
1266 | but if that fails, then the following set of commands may be used instead: | | 1266 | but if that fails, then the following set of commands may be used instead: |
1267 | .Bd -unfilled -offset indent | | 1267 | .Bd -unfilled -offset indent |
1268 | .Li HOST_SH= Ns Va /path/to/suitable/shell | | 1268 | .Li HOST_SH= Ns Va /path/to/suitable/shell |
1269 | .Li export HOST_SH | | 1269 | .Li export HOST_SH |
1270 | .Li ${HOST_SH} build.sh Op Ar options | | 1270 | .Li ${HOST_SH} build.sh Op Ar options |
1271 | .Ed | | 1271 | .Ed |
1272 | .Pp | | 1272 | .Pp |
1273 | If | | 1273 | If |
1274 | .Sy build.sh | | 1274 | .Sy build.sh |
1275 | detects that it is being executed under an unsuitable shell, it attempts | | 1275 | detects that it is being executed under an unsuitable shell, it attempts |
1276 | to exec a suitable shell instead, or prints an error message. | | 1276 | to exec a suitable shell instead, or prints an error message. |
1277 | If | | 1277 | If |
1278 | .Sy HOST_SH | | 1278 | .Sy HOST_SH |
1279 | is not set explicitly, then | | 1279 | is not set explicitly, then |
1280 | .Nm build.sh | | 1280 | .Nm build.sh |
1281 | sets a default using heuristics dependent on the host platform, | | 1281 | sets a default using heuristics dependent on the host platform, |
1282 | or from the shell under which | | 1282 | or from the shell under which |
1283 | .Nm build.sh | | 1283 | .Nm build.sh |
1284 | is executed (if that can be determined), | | 1284 | is executed (if that can be determined), |
1285 | or using the first copy of | | 1285 | or using the first copy of |
1286 | .Pa sh | | 1286 | .Pa sh |
1287 | found in | | 1287 | found in |
1288 | .Sy PATH . | | 1288 | .Sy PATH . |
1289 | .Pp | | 1289 | .Pp |
1290 | All cross-compile builds, and most native builds, of the entire system | | 1290 | All cross-compile builds, and most native builds, of the entire system |
1291 | should make use of | | 1291 | should make use of |
1292 | .Sy build.sh | | 1292 | .Sy build.sh |
1293 | rather than just running | | 1293 | rather than just running |
1294 | .Dq make . | | 1294 | .Dq make . |
1295 | This way, the | | 1295 | This way, the |
1296 | .Xr make 1 | | 1296 | .Xr make 1 |
1297 | program will be bootstrapped properly, in case the host system has an | | 1297 | program will be bootstrapped properly, in case the host system has an |
1298 | older or incompatible | | 1298 | older or incompatible |
1299 | .Dq make | | 1299 | .Dq make |
1300 | program. | | 1300 | program. |
1301 | .Pp | | 1301 | .Pp |
1302 | When compiling the entire system via | | 1302 | When compiling the entire system via |
1303 | .Sy build.sh , | | 1303 | .Sy build.sh , |
1304 | many | | 1304 | many |
1305 | .Xr make 1 | | 1305 | .Xr make 1 |
1306 | variables are set for you in order to help encapsulate the build | | 1306 | variables are set for you in order to help encapsulate the build |
1307 | process. | | 1307 | process. |
1308 | In the list of options below, variables that are automatically set by | | 1308 | In the list of options below, variables that are automatically set by |
1309 | .Sy build.sh | | 1309 | .Sy build.sh |
1310 | are noted where applicable. | | 1310 | are noted where applicable. |
1311 | . | | 1311 | . |
1312 | .Pp | | 1312 | .Pp |
1313 | The following operations are supported by | | 1313 | The following operations are supported by |
1314 | .Sy build.sh : | | 1314 | .Sy build.sh : |
1315 | . | | 1315 | . |
1316 | .Bl -tag -width "distribution" | | 1316 | .Bl -tag -width "distribution" |
1317 | . | | 1317 | . |
1318 | .It Sy build | | 1318 | .It Sy build |
1319 | Build the system as per | | 1319 | Build the system as per |
1320 | .Dq make build . | | 1320 | .Dq make build . |
1321 | Before the main part of the build commences, this command runs the | | 1321 | Before the main part of the build commences, this command runs the |
1322 | .Sy obj | | 1322 | .Sy obj |
1323 | operation (unless the | | 1323 | operation (unless the |
1324 | .Fl o | | 1324 | .Fl o |
1325 | option is given), | | 1325 | option is given), |
1326 | .Dq make cleandir | | 1326 | .Dq make cleandir |
1327 | (unless the | | 1327 | (unless the |
1328 | .Fl u | | 1328 | .Fl u |
1329 | option is given), | | 1329 | option is given), |
1330 | and the | | 1330 | and the |
1331 | .Sy tools | | 1331 | .Sy tools |
1332 | operation. | | 1332 | operation. |
1333 | . | | 1333 | . |
1334 | .It Sy distribution | | 1334 | .It Sy distribution |
1335 | Build a full distribution as per | | 1335 | Build a full distribution as per |
1336 | .Dq make distribution . | | 1336 | .Dq make distribution . |
1337 | This command first runs the | | 1337 | This command first runs the |
1338 | .Sy build | | 1338 | .Sy build |
1339 | operation. | | 1339 | operation. |
1340 | . | | 1340 | . |
1341 | .It Sy release | | 1341 | .It Sy release |
1342 | Build a full release as per | | 1342 | Build a full release as per |
1343 | .Dq make release . | | 1343 | .Dq make release . |
1344 | This command first runs the | | 1344 | This command first runs the |
1345 | .Sy distribution | | 1345 | .Sy distribution |
1346 | operation. | | 1346 | operation. |
1347 | . | | 1347 | . |
1348 | .It Sy makewrapper | | 1348 | .It Sy makewrapper |
1349 | Create the | | 1349 | Create the |
1350 | .Sy \*[toolprefix]make-MACHINE | | 1350 | .Sy \*[toolprefix]make-MACHINE |
1351 | wrapper. | | 1351 | wrapper. |
1352 | This operation is automatically performed for any of the other | | 1352 | This operation is automatically performed for any of the other |
1353 | operations. | | 1353 | operations. |
1354 | . | | 1354 | . |
1355 | .It Sy cleandir | | 1355 | .It Sy cleandir |
1356 | Perform | | 1356 | Perform |
1357 | .Dq make cleandir . | | 1357 | .Dq make cleandir . |
1358 | . | | 1358 | . |
1359 | .It Sy obj | | 1359 | .It Sy obj |
1360 | Perform | | 1360 | Perform |
1361 | .Dq make obj . | | 1361 | .Dq make obj . |
1362 | . | | 1362 | . |
1363 | .It Sy tools | | 1363 | .It Sy tools |
1364 | Build and install the host tools from | | 1364 | Build and install the host tools from |
1365 | .Pa src/tools . | | 1365 | .Pa src/tools . |
1366 | This command will first run | | 1366 | This command will first run |
1367 | .Dq make obj | | 1367 | .Dq make obj |
1368 | and | | 1368 | and |
1369 | .Dq make cleandir | | 1369 | .Dq make cleandir |
1370 | in the | | 1370 | in the |
1371 | .Pa tools | | 1371 | .Pa tools |
1372 | subdirectory unless the | | 1372 | subdirectory unless the |
1373 | .Fl o | | 1373 | .Fl o |
1374 | or | | 1374 | or |
1375 | .Fl u | | 1375 | .Fl u |
1376 | options (respectively) are given. | | 1376 | options (respectively) are given. |
1377 | . | | 1377 | . |
1378 | .It Sy install Ns = Ns Ar idir | | 1378 | .It Sy install Ns = Ns Ar idir |
1379 | Install the contents of | | 1379 | Install the contents of |
1380 | .Sy DESTDIR | | 1380 | .Sy DESTDIR |
1381 | to | | 1381 | to |
1382 | .Ar idir , | | 1382 | .Ar idir , |
1383 | using | | 1383 | using |
1384 | .Dq make installworld . | | 1384 | .Dq make installworld . |
1385 | Note that files that are part of the | | 1385 | Note that files that are part of the |
1386 | .Dq etc | | 1386 | .Dq etc |
1387 | or | | 1387 | or |
1388 | .Dq xetc | | 1388 | .Dq xetc |
1389 | sets will not be installed, unless overridden by | | 1389 | sets will not be installed, unless overridden by |
1390 | the INSTALLSETS environment variable. | | 1390 | the INSTALLSETS environment variable. |
1391 | . | | 1391 | . |
1392 | .It Sy kernel Ns = Ns Ar kconf | | 1392 | .It Sy kernel Ns = Ns Ar kconf |
1393 | Build a new kernel. | | 1393 | Build a new kernel. |
1394 | The | | 1394 | The |
1395 | .Ar kconf | | 1395 | .Ar kconf |
1396 | argument is the name of a configuration file suitable | | 1396 | argument is the name of a configuration file suitable |
1397 | for use by | | 1397 | for use by |
1398 | .Xr config 1 . | | 1398 | .Xr config 1 . |
1399 | If | | 1399 | If |
1400 | .Ar kconf | | 1400 | .Ar kconf |
1401 | does not contain any | | 1401 | does not contain any |
1402 | .Sq / | | 1402 | .Sq / |
1403 | characters, the configuration file is expected to be found in the | | 1403 | characters, the configuration file is expected to be found in the |
1404 | .Sy KERNCONFDIR | | 1404 | .Sy KERNCONFDIR |
1405 | directory, which is typically | | 1405 | directory, which is typically |
1406 | .Sy sys/arch/MACHINE/conf . | | 1406 | .Sy sys/arch/MACHINE/conf . |
1407 | The new kernel will be built in a subdirectory of | | 1407 | The new kernel will be built in a subdirectory of |
1408 | .Sy KERNOBJDIR , | | 1408 | .Sy KERNOBJDIR , |
1409 | which is typically | | 1409 | which is typically |
1410 | .Sy sys/arch/MACHINE/compile | | 1410 | .Sy sys/arch/MACHINE/compile |
1411 | or an associated object directory. | | 1411 | or an associated object directory. |
1412 | .Pp | | 1412 | .Pp |
1413 | This command does | | 1413 | This command does |
1414 | .Em not | | 1414 | .Em not |
1415 | imply the | | 1415 | imply the |
1416 | .Sy tools | | 1416 | .Sy tools |
1417 | command; run the | | 1417 | command; run the |
1418 | .Sy tools | | 1418 | .Sy tools |
1419 | command first unless it is | | 1419 | command first unless it is |
1420 | .Em certain | | 1420 | .Em certain |
1421 | that the tools already exist and are up to date. | | 1421 | that the tools already exist and are up to date. |
1422 | .Pp | | 1422 | .Pp |
1423 | This command will run | | 1423 | This command will run |
1424 | .Dq make cleandir | | 1424 | .Dq make cleandir |
1425 | on the kernel in question first unless the | | 1425 | on the kernel in question first unless the |
1426 | .Fl u | | 1426 | .Fl u |
1427 | option is given. | | 1427 | option is given. |
1428 | . | | 1428 | . |
1429 | .It Sy modules | | 1429 | .It Sy modules |
1430 | This command will build kernel modules and install them into | | 1430 | This command will build kernel modules and install them into |
1431 | .Sy DESTDIR . | | 1431 | .Sy DESTDIR . |
1432 | . | | 1432 | . |
1433 | .It Sy releasekernel Ns = Ns Ar kconf | | 1433 | .It Sy releasekernel Ns = Ns Ar kconf |
1434 | Install a | | 1434 | Install a |
1435 | .Xr gzip 1 Ns ed | | 1435 | .Xr gzip 1 Ns ed |
1436 | copy of the kernel previously built by | | 1436 | copy of the kernel previously built by |
1437 | .Sy kernel Ns = Ns Ar kconf | | 1437 | .Sy kernel Ns = Ns Ar kconf |
1438 | into | | 1438 | into |
1439 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/kernel , | | 1439 | .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/kernel , |
1440 | usually as | | 1440 | usually as |
1441 | .Pa netbsd- Ns Ar kconf Ns Pa .gz , | | 1441 | .Pa netbsd- Ns Ar kconf Ns Pa .gz , |
1442 | although the | | 1442 | although the |
1443 | .Dq Pa netbsd | | 1443 | .Dq Pa netbsd |
1444 | prefix is determined from the | | 1444 | prefix is determined from the |
1445 | .Dq Sy config | | 1445 | .Dq Sy config |
1446 | directives in | | 1446 | directives in |
1447 | .Ar kconf . | | 1447 | .Ar kconf . |
1448 | . | | 1448 | . |
1449 | .It Sy sets | | 1449 | .It Sy sets |
1450 | Perform | | 1450 | Perform |
1451 | .Dq make sets . | | 1451 | .Dq make sets . |
1452 | . | | 1452 | . |
1453 | .It Sy sourcesets | | 1453 | .It Sy sourcesets |
1454 | Perform | | 1454 | Perform |
1455 | .Dq make sourcesets . | | 1455 | .Dq make sourcesets . |
1456 | . | | 1456 | . |
1457 | .It Sy syspkgs | | 1457 | .It Sy syspkgs |
1458 | Perform | | 1458 | Perform |
1459 | .Dq make syspkgs . | | 1459 | .Dq make syspkgs . |
1460 | . | | 1460 | . |
1461 | .It Sy iso-image | | 1461 | .It Sy iso-image |
1462 | Perform | | 1462 | Perform |
1463 | .Dq make iso-image . | | 1463 | .Dq make iso-image . |
1464 | . | | 1464 | . |
1465 | .It Sy iso-image-source | | 1465 | .It Sy iso-image-source |
1466 | Perform | | 1466 | Perform |
1467 | .Dq make iso-image-source . | | 1467 | .Dq make iso-image-source . |
1468 | . | | 1468 | . |
1469 | .It Sy install-image | | 1469 | .It Sy install-image |
1470 | Perform | | 1470 | Perform |
1471 | .Dq make install-image . | | 1471 | .Dq make install-image . |
1472 | . | | 1472 | . |
1473 | .It Sy live-image | | 1473 | .It Sy live-image |
1474 | Perform | | 1474 | Perform |
1475 | .Dq make live-image . | | 1475 | .Dq make live-image . |
1476 | . | | 1476 | . |
1477 | .El | | 1477 | .El |
1478 | . | | 1478 | . |
1479 | .Pp | | 1479 | .Pp |
1480 | The following command line options alter the behaviour of the | | 1480 | The following command line options alter the behaviour of the |
1481 | .Sy build.sh | | 1481 | .Sy build.sh |
1482 | operations described above: | | 1482 | operations described above: |
1483 | . | | 1483 | . |
1484 | .Bl -tag -width "-T tools" | | 1484 | .Bl -tag -width "-T tools" |
1485 | . | | 1485 | . |
1486 | .It Fl a Ar arch | | 1486 | .It Fl a Ar arch |
1487 | Set the value of | | 1487 | Set the value of |
1488 | .Sy MACHINE_ARCH | | 1488 | .Sy MACHINE_ARCH |
1489 | to | | 1489 | to |
1490 | .Ar arch . | | 1490 | .Ar arch . |
1491 | . | | 1491 | . |
1492 | .It Fl B Ar buildid | | 1492 | .It Fl B Ar buildid |
1493 | Set the value of | | 1493 | Set the value of |
1494 | .Sy BUILDID | | 1494 | .Sy BUILDID |
1495 | to | | 1495 | to |
1496 | .Ar buildid . | | 1496 | .Ar buildid . |
1497 | This will also append the build identifier to the name of the | | 1497 | This will also append the build identifier to the name of the |
1498 | .Dq make | | 1498 | .Dq make |
1499 | wrapper script so that the resulting name is of the form | | 1499 | wrapper script so that the resulting name is of the form |
1500 | .Dq Sy \*[toolprefix]make-MACHINE-BUILDID . | | 1500 | .Dq Sy \*[toolprefix]make-MACHINE-BUILDID . |
1501 | . | | 1501 | . |
1502 | .It Fl C Ar cdextras | | 1502 | .It Fl C Ar cdextras |
1503 | Append | | 1503 | Append |
1504 | .Ar cdextras | | 1504 | .Ar cdextras |
1505 | to the | | 1505 | to the |
1506 | .Sy CDEXTRA | | 1506 | .Sy CDEXTRA |
1507 | variable, | | 1507 | variable, |
1508 | which is a space-separated list of files or directories that will be | | 1508 | which is a space-separated list of files or directories that will be |
1509 | added to the CD-ROM image that may be create by the | | 1509 | added to the CD-ROM image that may be create by the |
1510 | .Dq iso-image | | 1510 | .Dq iso-image |
1511 | or | | 1511 | or |
1512 | .Dq iso-image-source | | 1512 | .Dq iso-image-source |
1513 | operations. | | 1513 | operations. |
1514 | Files will be added to the root of the CD-ROM image, whereas directories | | 1514 | Files will be added to the root of the CD-ROM image, whereas directories |
1515 | will be copied recursively. | | 1515 | will be copied recursively. |
1516 | If relative paths are specified, they will be converted to | | 1516 | If relative paths are specified, they will be converted to |
1517 | absolute paths before being used. | | 1517 | absolute paths before being used. |
1518 | Multiple paths may be specified via multiple | | 1518 | Multiple paths may be specified via multiple |
1519 | .Fl C | | 1519 | .Fl C |
1520 | options, or via a single option whose argument contains multiple | | 1520 | options, or via a single option whose argument contains multiple |
1521 | space-separated paths. | | 1521 | space-separated paths. |
1522 | . | | 1522 | . |
1523 | .It Fl D Ar dest | | 1523 | .It Fl D Ar dest |
1524 | Set the value of | | 1524 | Set the value of |
1525 | .Sy DESTDIR | | 1525 | .Sy DESTDIR |
1526 | to | | 1526 | to |
1527 | .Ar dest . | | 1527 | .Ar dest . |
1528 | If a relative path is specified, it will be converted to an | | 1528 | If a relative path is specified, it will be converted to an |
1529 | absolute path before being used. | | 1529 | absolute path before being used. |
1530 | . | | 1530 | . |
1531 | .It Fl E | | 1531 | .It Fl E |
1532 | Set | | 1532 | Set |
1533 | .Sq expert | | 1533 | .Sq expert |
1534 | mode. | | 1534 | mode. |
1535 | This overrides various sanity checks, and allows: | | 1535 | This overrides various sanity checks, and allows: |
1536 | .Sy DESTDIR | | 1536 | .Sy DESTDIR |
1537 | does not have to be set to a non-root path for builds, | | 1537 | does not have to be set to a non-root path for builds, |
1538 | and | | 1538 | and |
1539 | .Sy MKUNPRIVED=yes | | 1539 | .Sy MKUNPRIVED=yes |
1540 | does not have to be set when building as a non-root user. | | 1540 | does not have to be set when building as a non-root user. |
1541 | .Pp | | 1541 | .Pp |
1542 | .Em Note : | | 1542 | .Em Note : |
1543 | It is highly recommended that you know what you are doing when | | 1543 | It is highly recommended that you know what you are doing when |
1544 | you use this option. | | 1544 | you use this option. |
1545 | . | | 1545 | . |
1546 | .It Fl h | | 1546 | .It Fl h |
1547 | Print a help message. | | 1547 | Print a help message. |
1548 | . | | 1548 | . |
1549 | .It Fl j Ar njob | | 1549 | .It Fl j Ar njob |
1550 | Run up to | | 1550 | Run up to |
1551 | .Ar njob | | 1551 | .Ar njob |
1552 | .Xr make 1 | | 1552 | .Xr make 1 |
1553 | subjobs in parallel; | | 1553 | subjobs in parallel; |
1554 | passed through to | | 1554 | passed through to |
1555 | .Xr make 1 . | | 1555 | .Xr make 1 . |
1556 | If you see failures for reasons other than running out of memory | | 1556 | If you see failures for reasons other than running out of memory |
1557 | while using | | 1557 | while using |
1558 | .Sy build.sh | | 1558 | .Sy build.sh |
1559 | with | | 1559 | with |
1560 | .Fl j , | | 1560 | .Fl j , |
1561 | please save complete build logs | | 1561 | please save complete build logs |
1562 | so the failures can be analyzed. | | 1562 | so the failures can be analyzed. |
1563 | .Pp | | 1563 | .Pp |
1564 | To achieve the fastest builds, | | 1564 | To achieve the fastest builds, |
1565 | .Fl j | | 1565 | .Fl j |
1566 | values between (1 + the number of CPUs) and (2 * the number of CPUs) | | 1566 | values between (1 + the number of CPUs) and (2 * the number of CPUs) |
1567 | are recommended. | | 1567 | are recommended. |
1568 | Use lower values on machines with limited memory or I/O bandwidth. | | 1568 | Use lower values on machines with limited memory or I/O bandwidth. |
1569 | . | | 1569 | . |
1570 | .It Fl M Ar obj | | 1570 | .It Fl M Ar obj |
1571 | Set | | 1571 | Set |
1572 | .Sy MAKEOBJDIRPREFIX | | 1572 | .Sy MAKEOBJDIRPREFIX |
1573 | to | | 1573 | to |
1574 | .Ar obj . | | 1574 | .Ar obj . |
1575 | Unsets | | 1575 | Unsets |
1576 | .Sy MAKEOBJDIR . | | 1576 | .Sy MAKEOBJDIR . |
1577 | See | | 1577 | See |
1578 | .Dq Fl O obj | | 1578 | .Dq Fl O obj |
1579 | for more information. | | 1579 | for more information. |
1580 | .Pp | | 1580 | .Pp |
1581 | For instance, if the source directory is | | 1581 | For instance, if the source directory is |
1582 | .Pa /usr/src , | | 1582 | .Pa /usr/src , |
1583 | a setting of | | 1583 | a setting of |
1584 | .Dq Fl M Pa /usr/obj | | 1584 | .Dq Fl M Pa /usr/obj |