xref: /netbsd-src/doc/BUILDING.mdoc (revision 13890d5a3ff94c63919e6818d52332ad578fd7ac)
1*13890d5aSrillig.\"	$NetBSD: BUILDING.mdoc,v 1.150 2024/04/26 17:38:44 rillig Exp $
2d7d0f414Slukem.\"
3b9abc1c5Slukem.\" Copyright (c) 2001-2023 The NetBSD Foundation, Inc.
4d7d0f414Slukem.\" All rights reserved.
5d7d0f414Slukem.\"
6d7d0f414Slukem.\" This code is derived from software contributed to The NetBSD Foundation
731b7057fSlukem.\" by Todd Vierling and Luke Mewburn.
8d7d0f414Slukem.\"
9d7d0f414Slukem.\" Redistribution and use in source and binary forms, with or without
10d7d0f414Slukem.\" modification, are permitted provided that the following conditions
11d7d0f414Slukem.\" are met:
12d7d0f414Slukem.\" 1. Redistributions of source code must retain the above copyright
13d7d0f414Slukem.\"    notice, this list of conditions and the following disclaimer.
14d7d0f414Slukem.\" 2. Redistributions in binary form must reproduce the above copyright
15d7d0f414Slukem.\"    notice, this list of conditions and the following disclaimer in the
16d7d0f414Slukem.\"    documentation and/or other materials provided with the distribution.
17d7d0f414Slukem.\"
18d7d0f414Slukem.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19d7d0f414Slukem.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20d7d0f414Slukem.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21d7d0f414Slukem.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22d7d0f414Slukem.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23d7d0f414Slukem.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24d7d0f414Slukem.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25d7d0f414Slukem.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26d7d0f414Slukem.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27d7d0f414Slukem.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28d7d0f414Slukem.\" POSSIBILITY OF SUCH DAMAGE.
29d7d0f414Slukem.\"
305f70d1f9Sapb.\" NOTE: After changing this file, run "make regen" in the src/doc
315f70d1f9Sapb.\" directory, and check in both src/BUILDING and src/doc/BUILDING.mdoc.
32d7d0f414Slukem.\"
336ac63dc2Slukem.\" Toolchain prefix for commands
346ac63dc2Slukem.ds toolprefix nb
356ac63dc2Slukem.
36cc95aaefSlukem.Dd July 21, 2023
37d7d0f414Slukem.Dt BUILDING 8
38d7d0f414Slukem.Os NetBSD
39f26a4cc9Slukem.\" turn off hyphenation
40f26a4cc9Slukem.hym 999
41d7d0f414Slukem.
429a7d9639Suwe.\" if this file is processed with real roff (doc.tmac)
439a7d9639Suwe.\" now that the tmac files have been lazily read,
449a7d9639Suwe.\" we can override ``quotes'' with "quotes" for ascii output
459a7d9639Suwe.ie '\*[Lq]'``' \{\
469a7d9639Suwe.ds Lq \*q
479a7d9639Suwe.ds Rq \*q
489a7d9639Suwe.\}
499a7d9639Suwe.\" and disable hyphenation
509a7d9639Suwe.nr hyphen-flags 0
519a7d9639Suwe.
52d7d0f414Slukem.Sh NAME
53d7d0f414Slukem.
54d7d0f414Slukem.Nm BUILDING
55d7d0f414Slukem.Nd Procedure for building
56d7d0f414Slukem.Nx
57105457a1Slukemfrom source code
58d7d0f414Slukem.
59d7d0f414Slukem.Sh REQUIREMENTS
60d7d0f414Slukem.
61d7d0f414Slukem.Nx
62d7d0f414Slukemis designed to be buildable on most POSIX-compliant host systems.
63d7d0f414SlukemThe basic build procedure is the same whether compiling
64d7d0f414Slukem.Em natively
65d7d0f414Slukem(on the same
66d7d0f414Slukem.Nx
67d7d0f414Slukemarchitecture) or
68d7d0f414Slukem.Em cross compiling
69d7d0f414Slukem(on another architecture or OS).
70d7d0f414Slukem.Pp
713cb563b3SlukemThis source tree contains the
723cb563b3Slukem.Sy build.sh
733cb563b3Slukemshell script which supports both native and cross builds of
743cb563b3Slukem.Nx .
753cb563b3Slukem.Pp
76d7d0f414SlukemThis source tree contains a special subtree,
77d7d0f414Slukem.Dq tools ,
78d7d0f414Slukemwhich uses the host system to create a build toolchain for the target
7967990135Swizarchitecture.
8067990135SwizThe host system must have at least C and C++
81d7d0f414Slukemcompilers in order to create the toolchain
823cb563b3Slukem.Xr ( make 1
833cb563b3Slukemis not required); all other tools
843cb563b3Slukem(including
853cb563b3Slukem.Xr make 1
863cb563b3Slukemas
873cb563b3Slukem.Sy \*[toolprefix]make )
883cb563b3Slukemare created as part of the
89d7d0f414Slukem.Nx
90d7d0f414Slukembuild process.
91b9abc1c5Slukem(See the
92b9abc1c5Slukem.Sx Environment variables
93b9abc1c5Slukemsection below if you need
94ff1c165dSreedto override or manually select your compilers.)
956aba6b16Slukem.Pp
966aba6b16Slukem.Em Note :
976aba6b16SlukemWithin this document, cross-references to manual pages are to the
986aba6b16Slukem.Nx
996aba6b16Slukemmanual pages, not the host system manual pages.
1006aba6b16SlukemThe
1016aba6b16Slukem.Xr mdoc 7
1026aba6b16Slukemsource
1036aba6b16Slukemto the
1046aba6b16Slukem.Nx
1056aba6b16Slukemmanual pages can be found within the source tree,
1066aba6b16Slukemand these and can be formatted with
1076aba6b16Slukem.Xr mandoc 1
1086aba6b16Slukemor
1096aba6b16Slukem.Xr nroff 1
1106aba6b16Slukemif those are available on the host system.
1116aba6b16SlukemThe
1126aba6b16Slukem.Nx
1136aba6b16Slukemmanual pages are also available at
1146aba6b16Slukem.Lk https://man.netbsd.org
115d7d0f414Slukem.
116d7d0f414Slukem.Sh FILES
117d7d0f414Slukem.
118d7d0f414Slukem.Ss Source tree layout
119d7d0f414Slukem.
120d7d0f414Slukem.Bl -tag -width "BUILDING.mdoc"
121f26a4cc9Slukem.
1220a35378dSwiz.It Pa BUILDING
123d7d0f414SlukemThis document (in plaintext).
124f26a4cc9SlukemGenerated from
125f26a4cc9Slukem.Pa doc/BUILDING.mdoc .
126f26a4cc9Slukem.
1270a35378dSwiz.It Pa Makefile
128d7d0f414SlukemThe main Makefile for
129d7d0f414Slukem.Nx ;
130d7d0f414Slukemshould only be run for native builds with an appropriately up-to-date
131d7d0f414Slukemversion of
132d7d0f414Slukem.Nx
133d7d0f414Slukem.Xr make 1 .
134105457a1SlukemIntended for expert use with knowledge of its shortcomings,
135105457a1Slukemit has been superseded by the
1363cb563b3Slukem.Sy build.sh
1372b6d2cc8Ssevanshell script as the recommended means for building
1382b6d2cc8Ssevan.Nx .
139f26a4cc9Slukem.
1400a35378dSwiz.It Pa UPDATING
141d7d0f414SlukemSpecial notes for updating from an earlier revision of
142d7d0f414Slukem.Nx .
143d7d0f414SlukemIt is important to read this file before every build of an updated
144d7d0f414Slukemsource tree.
145f26a4cc9Slukem.
1460a35378dSwiz.It Pa build.sh
147d7d0f414SlukemBourne-compatible shell script used for building the host build tools
148d7d0f414Slukemand the
149d7d0f414Slukem.Nx
15067990135Swizsystem from scratch.
15167990135SwizCan be used for both native and cross builds, and should be used instead of
152d7d0f414Slukem.Xr make 1
1532b6d2cc8Ssevanas it performs additional checks to prevent common issues going undetected, such
1542b6d2cc8Ssevanas building with an outdated version of
1552b6d2cc8Ssevan.Xr make 1 .
156f26a4cc9Slukem.
1570a35378dSwiz.It Pa crypto/dist/ , dist/ , gnu/dist/
158d7d0f414SlukemSources imported verbatim from third parties, without mangling the
15967990135Swizexisting build structure.
16067990135SwizOther source trees in
1613cb563b3Slukem.Pa bin
162d7d0f414Slukemthrough
1633cb563b3Slukem.Pa usr.sbin
164d7d0f414Slukemuse the
165d7d0f414Slukem.Nx
166d7d0f414Slukem.Xr make 1
167d7d0f414Slukem.Dq reachover
168d7d0f414SlukemMakefile semantics when building these programs for a native host.
169f26a4cc9Slukem.
170f26a4cc9Slukem.It Pa distrib/ , etc/
171f26a4cc9SlukemSources for items used when making a full release snapshot, such as
172f26a4cc9Slukemfiles installed in
173f26a4cc9Slukem.Sy DESTDIR Ns Pa /etc
174f26a4cc9Slukemon the destination system, boot media, and release notes.
175f26a4cc9Slukem.
176f26a4cc9Slukem.It Pa doc/BUILDING.mdoc
1776aba6b16SlukemThe source to this document, in
1786aba6b16Slukem.Xr mdoc 7
1796aba6b16Slukemformat.
180f26a4cc9SlukemUsed to generate
181f26a4cc9Slukem.Pa BUILDING .
182f26a4cc9Slukem.
183747c3deeSlukem.It Pa external/ , sys/external/
1848800a5edSmartinSources and build infrastructure for components imported (mostly) unchanged
1858800a5edSmartinfrom upstream maintainers, sorted by applicable license.
1860a35378dSwizThis is (slowly) replacing the
1870a35378dSwiz.Pa crypto/dist ,
1880a35378dSwiz.Pa dist ,
1890a35378dSwizand
1900a35378dSwiz.Pa gnu/dist
1910a35378dSwizdirectories.
192f26a4cc9Slukem.
193f26a4cc9Slukem.It Pa external/mit/xorg/
194f26a4cc9Slukem.Dq Reachover
195f26a4cc9Slukembuild structure for modular Xorg; the source is in
196f26a4cc9Slukem.Sy X11SRCDIR .
197f26a4cc9Slukem.
1983cb563b3Slukem.It Pa mk.conf
1993cb563b3SlukemOptional source tree specific
2003cb563b3Slukem.Xr mk.conf 5 ,
2013cb563b3Slukemused (if present) instead of
2023cb563b3Slukem.Pa /etc/mk.conf
2033cb563b3Slukemunless
2043cb563b3Slukem.Sy MAKECONF
2053cb563b3Slukemis defined.
2063cb563b3Slukem.Pp
2073cb563b3Slukem.Em Note :
2083cb563b3SlukemNot part of the
2093cb563b3Slukem.Nx
2103cb563b3Slukemsource repository.
2113cb563b3Slukem.
212f26a4cc9Slukem.It Pa regress/ , tests/
21367990135SwizRegression test harness.
21467990135SwizCan be cross-compiled, but only run natively.
215000424deSdholland.Pa tests/
216000424deSdhollanduses the
217000424deSdholland.Xr atf 7
218000424deSdhollandtest framework;
219000424deSdholland.Pa regress/
220000424deSdhollandcontains older tests that have not yet been migrated to
221000424deSdholland.Xr atf 7 .
222f26a4cc9Slukem.
2230a35378dSwiz.It Pa sys/
224d7d0f414Slukem.Nx
225d7d0f414Slukemkernel sources.
226f26a4cc9Slukem.
2270a35378dSwiz.It Pa tools/
228d7d0f414Slukem.Dq Reachover
22967990135Swizbuild structure for the host build tools.
23067990135SwizThis has a special method of determining out-of-date status.
231f26a4cc9Slukem.
232f26a4cc9Slukem.It Pa tools/compat/README
233f26a4cc9SlukemSpecial notes for cross-hosting a NetBSD build on non-NetBSD platforms.
234f26a4cc9Slukem.
235f26a4cc9Slukem.It Other directories including Pa bin/ ... usr.sbin/
236d7d0f414SlukemSources to the
237d7d0f414Slukem.Nx
23867990135Swizuserland (non-kernel) programs.
23967990135SwizIf any of these directories are missing, they will be skipped during the build.
240f26a4cc9Slukem.
241d7d0f414Slukem.El
242d7d0f414Slukem.
243d7d0f414Slukem.Ss Build tree layout
244d7d0f414Slukem.
245d7d0f414SlukemThe
246d7d0f414Slukem.Nx
247d7d0f414Slukembuild tree is described in
2486aba6b16Slukem.Xr hier 7
2492b1fd041Slukem(whose
2502b1fd041Slukem.Xr mdoc 7
2512b1fd041Slukemsource is in
2526aba6b16Slukem.Pa share/man/man7/hier.7 ) ,
253d7d0f414Slukemand the release layout is described in
2546aba6b16Slukem.Xr release 7
2552b1fd041Slukem(whose
2562b1fd041Slukem.Xr mdoc 7
2572b1fd041Slukemsource is in
2586aba6b16Slukem.Pa share/man/man7/release.7 ) .
259d7d0f414Slukem.
260d7d0f414Slukem.Sh CONFIGURATION
261d7d0f414Slukem.
262d7d0f414Slukem.Ss Environment variables
263efd3bc66Swiz.
26423c02a69Slukem.de DFLT
26523c02a69Slukem.Pp
26623c02a69Slukem.Em Default :
26723c02a69Slukem..
268f26a4cc9Slukem.de DFLTn
269f26a4cc9Slukem.DFLT
2706aba6b16Slukem.Dq no .
271f26a4cc9Slukem..
27223c02a69Slukem.de DFLTu
27323c02a69Slukem.DFLT
27423c02a69SlukemUnset.
27523c02a69Slukem..
27623c02a69Slukem.de DFLTy
27723c02a69Slukem.DFLT
2786aba6b16Slukem.Dq yes .
27923c02a69Slukem..
280f26a4cc9Slukem.de NODEF
281f26a4cc9Slukem.Pp
282f26a4cc9SlukemForced to
28323c02a69Slukem.Dq no
284f26a4cc9Slukemif
285f26a4cc9Slukem.Sy \\$*
286f26a4cc9Slukemis defined,
287f26a4cc9Slukemusually in the Makefile before any
288f26a4cc9Slukem.Xr make 1
289f26a4cc9Slukem.Cm \&.include
290f26a4cc9Slukemdirectives.
29123c02a69Slukem..
292f26a4cc9Slukem.de NOVAR
293f26a4cc9Slukem.Pp
294f26a4cc9SlukemForced to
295f26a4cc9Slukem.Dq no
296f26a4cc9Slukemif
297f26a4cc9Slukem.Sy \\$* .
298f26a4cc9Slukem..
299f26a4cc9Slukem.de YorN
300f26a4cc9SlukemCan be set to
301f26a4cc9Slukem.Dq yes
302f26a4cc9Slukemor
303f26a4cc9Slukem.Dq no .
304f26a4cc9Slukem..
305f26a4cc9Slukem.
306d7d0f414SlukemSeveral environment variables control the behaviour of
307d7d0f414Slukem.Nx
308d7d0f414Slukembuilds.
309d7d0f414Slukem.
3105166ed0bSlukem.Bl -tag -width 14n
3115166ed0bSlukem.
3125166ed0bSlukem.\" These entries are sorted alphabetically.
313d7d0f414Slukem.
314f26a4cc9Slukem.It Sy HOST_CC
315f26a4cc9SlukemPath name to C compiler used to create the toolchain.
3166aba6b16Slukem.DFLT
3176aba6b16Slukem.Dq cc .
318f26a4cc9Slukem.
319f26a4cc9Slukem.It Sy HOST_CFLAGS
320f26a4cc9SlukemFlags passed to the host C compiler.
3216aba6b16Slukem.DFLT
3226aba6b16Slukem.Dq \&-O .
3236aba6b16Slukem.
3246aba6b16Slukem.It Sy HOST_CPPFLAGS
3256aba6b16SlukemFlags passed to the host C/C++ pre-processor.
3266aba6b16Slukem.DFLTu
327f26a4cc9Slukem.
328f26a4cc9Slukem.It Sy HOST_CXX
329f26a4cc9SlukemPath name to C++ compiler used to create the toolchain.
3306aba6b16Slukem.DFLT
3316aba6b16SlukemUnset, but defaults to
3326aba6b16Slukem.Dq c++
3336aba6b16Slukemwhere required.
334f26a4cc9Slukem.
335f26a4cc9Slukem.It Sy HOST_CXXFLAGS
336f26a4cc9SlukemFlags passed to the host C++ compiler.
3376aba6b16Slukem.DFLTu
338ff1c165dSreed.
339be15399dSapb.It Sy HOST_SH
34037b9b22eSapbPath name to a shell available on the host system
34137b9b22eSapband suitable for use during the build.
34237b9b22eSapbThe
34337b9b22eSapb.Nx
34437b9b22eSapbbuild system requires a modern Bourne-like shell
34537b9b22eSapbwith POSIX-compliant features,
34637b9b22eSapband also requires support for the
34737b9b22eSapb.Dq local
34837b9b22eSapbkeyword to declare local variables in shell functions
34937b9b22eSapb(which is a widely-implemented but non-standardised feature).
35037b9b22eSapb.Pp
35137b9b22eSapbDepending on the host system, a suitable shell may be
35237b9b22eSapb.Pa /bin/sh ,
35337b9b22eSapb.Pa /usr/xpg4/bin/sh ,
35437b9b22eSapb.Pa /bin/ksh
35537b9b22eSapb(provided it is a variant of ksh that supports the
35637b9b22eSapb.Dq local
35737b9b22eSapbkeyword,
35837b9b22eSapbsuch as ksh88, but not ksh93),
35937b9b22eSapbor
36037b9b22eSapb.Pa /usr/local/bin/bash .
36137b9b22eSapb.Pp
36237b9b22eSapbMost parts of the build require
36337b9b22eSapb.Sy HOST_SH
36437b9b22eSapbto be an absolute path; however,
3653cb563b3Slukem.Sy build.sh
36637b9b22eSapballows it to be a simple command name, which will be converted
36737b9b22eSapbto an absolute path by searching the
3686aba6b16Slukem.Ev PATH .
3696aba6b16Slukem.DFLT
3706aba6b16Slukem.Dq sh .
371be15399dSapb.
372b9abc1c5Slukem.It Sy INSTALLBOOT_UBOOT_PATHS
373b9abc1c5SlukemA colon-separated list of search paths used by
374b9abc1c5Slukem.Xr installboot 8
375b9abc1c5Slukemto find U-Boot packages.
3766aba6b16Slukem.DFLTu
377b9abc1c5Slukem.
378d7d0f414Slukem.It Sy MACHINE
379000424deSdhollandMachine type, e.g.,
380000424deSdholland.Dq macppc .
3816aba6b16Slukem.DFLTu
382d7d0f414Slukem.
383d7d0f414Slukem.It Sy MACHINE_ARCH
384000424deSdhollandMachine architecture, e.g.,
385000424deSdholland.Dq powerpc .
3866aba6b16Slukem.DFLTu
387d7d0f414Slukem.
388d7d0f414Slukem.It Sy MAKE
389d7d0f414SlukemPath name to invoke
390d7d0f414Slukem.Xr make 1
391d7d0f414Slukemas.
3926aba6b16Slukem.DFLT
3936aba6b16Slukem.Dq make .
394d7d0f414Slukem.
395105457a1Slukem.It Sy MAKECONF
396105457a1SlukemThe name of the
397105457a1Slukem.Xr make 1
398105457a1Slukemconfiguration file.
399105457a1SlukemSee
400a9756fb6Slukem.Sx make variables
401105457a1Slukemand
402105457a1Slukem.Xr mk.conf 5 .
403105457a1Slukem.Pp
404105457a1Slukem.Em Note :
405105457a1SlukemOnly settable in the process environment.
406105457a1Slukem.DFLT
4073cb563b3Slukem.Dq Pa /etc/mk.conf ,
4083cb563b3Slukemalthough
4093cb563b3Slukem.Sy build.sh
4103cb563b3Slukemwill set the default to the full path to
4113cb563b3Slukem.Pa mk.conf
4123cb563b3Slukemif the latter is present in the same directory as
4133cb563b3Slukem.Sy build.sh .
414105457a1Slukem.
415d7d0f414Slukem.It Sy MAKEFLAGS
416d7d0f414SlukemFlags to invoke
417d7d0f414Slukem.Xr make 1
418d7d0f414Slukemwith.
419f26a4cc9Slukem.Pp
420f26a4cc9Slukem.Em Note :
421a4d06577Sapb.Sy build.sh
422a4d06577Sapbignores the value of
423a4d06577Sapb.Sy MAKEFLAGS
424a4d06577Sapbpassed in the environment, but allows
425a4d06577Sapb.Sy MAKEFLAGS
426a4d06577Sapbto be set via the
427a4d06577Sapb.Fl V
428a4d06577Sapboption.
4296aba6b16Slukem.DFLT
4306aba6b16Slukem.Dq \&-X
4316aba6b16Slukemon systems with a small
4326aba6b16Slukem.Dv ARG_MAX
4336aba6b16Slukem(Cygwin, Darwin, FreeBSD);
4346aba6b16Slukemotherwise unset.
435d7d0f414Slukem.
436d7d0f414Slukem.It Sy MAKEOBJDIR
437d7d0f414SlukemDirectory to use as the
438d7d0f414Slukem.Sy .OBJDIR
439d7d0f414Slukemfor the current directory.
44024f8b531SapbThe value is subjected to variable expansion by
44124f8b531Sapb.Xr make 1 .
442ca568b57SapbTypical usage is to set this variable to a value involving the use of
443ca568b57Sapb.Sq ${.CURDIR:S...}
444ca568b57Sapbor
445ca568b57Sapb.Sq ${.CURDIR:C...} ,
446ca568b57Sapbto derive the value of
447ca568b57Sapb.Sy .OBJDIR
448ca568b57Sapbfrom the value of
449ca568b57Sapb.Sy .CURDIR .
450d7d0f414SlukemUsed only if
451d7d0f414Slukem.Sy MAKEOBJDIRPREFIX
452d7d0f414Slukemis not defined.
453105457a1Slukem.Pp
454105457a1Slukem.Em Note :
455d7d0f414Slukem.Sy MAKEOBJDIR
456ca568b57Sapbcan be provided only in the environment or via the
4573af5adacSlukem.Fl O
4580bd7fd87Slukemflag of
4593cb563b3Slukem.Sy build.sh ;
460105457a1Slukemit cannot usefully be set inside a Makefile, including in
461105457a1Slukem.Xr mk.conf 5
4628f2ea05aSmrgor
463105457a1Slukem.Sy MAKECONF .
4646aba6b16Slukem.DFLTu
465d7d0f414Slukem.
466d7d0f414Slukem.It Sy MAKEOBJDIRPREFIX
467d7d0f414SlukemTop level directory of the object directory tree.
46882825222SapbThe value is subjected to variable expansion by
46982825222Sapb.Xr make 1 .
47082825222Sapb.Sy build.sh
47182825222Sapbwill create the
47282825222Sapb${MAKEOBJDIRPREFIX}
47382825222Sapbdirectory if necessary, but if
47482825222Sapb.Xr make 1
47582825222Sapbis used without
47682825222Sapb.Sy build.sh ,
47782825222Sapbthen rules in
47882825222Sapb.Aq bsd.obj.mk
47982825222Sapbwill abort the build if the
48082825222Sapb${MAKEOBJDIRPREFIX}
48182825222Sapbdirectory does not exist.
48282825222SapbIf the value is defined and valid, then
483d7d0f414Slukem${MAKEOBJDIRPREFIX}/${.CURDIR}
484d7d0f414Slukemis used as the
485d7d0f414Slukem.Sy .OBJDIR
486d7d0f414Slukemfor the current directory.
487d7d0f414SlukemThe current directory may be read only.
488105457a1Slukem.Pp
489105457a1Slukem.Em Note :
490d7d0f414Slukem.Sy MAKEOBJDIRPREFIX
491ca568b57Sapbcan be provided only in the environment or via the
4920bd7fd87Slukem.Fl M
4930bd7fd87Slukemflag of
4943cb563b3Slukem.Sy build.sh ;
495105457a1Slukemit cannot usefully be set inside a Makefile, including in
496105457a1Slukem.Xr mk.conf 5
4978f2ea05aSmrgor
498105457a1Slukem.Sy MAKECONF .
4996aba6b16Slukem.DFLTu
50023c02a69Slukem.
5016aba6b16Slukem.It Ev TMPDIR
50223c02a69SlukemTop-level directory to store temporary directories used by
50323c02a69Slukem.Sy build.sh
50423c02a69Slukembefore paths to other directories such as
50523c02a69Slukem.Sy .OBJDIR
50623c02a69Slukemcan be determined.
50723c02a69Slukem.Pp
50823c02a69Slukem.Em Note :
50923c02a69SlukemMust support execution of binaries.
51023c02a69SlukemI.e., without
51123c02a69Slukem.Xr mount 8 Ns 's
51223c02a69Slukem.Fl o
5133cb563b3Slukem.Cm noexec
51423c02a69Slukemoption.
51523c02a69Slukem.DFLT
5166aba6b16Slukem.Dq Pa /tmp .
51723c02a69Slukem.
518d7d0f414Slukem.El
519d7d0f414Slukem.
520a9756fb6Slukem.Ss make variables
521d7d0f414Slukem.
5222b1fd041SlukemVariables that control the behavior of
523d7d0f414Slukem.Nx
5246aba6b16Slukembuilds are documented in
5256aba6b16Slukem.Xr mk.conf 5
5262b1fd041Slukem(whose
5272b1fd041Slukem.Xr mdoc 7
5282b1fd041Slukemsource is in
5296aba6b16Slukem.Pa share/man/man5/mk.conf.5 ) .
5306aba6b16Slukem.Pp
53167990135SwizUnless otherwise specified, these variables may be set in
532d7d0f414Slukemeither the process environment or the
533d7d0f414Slukem.Xr make 1
534105457a1Slukemconfiguration file
535105457a1Slukem.Xr mk.conf 5
536105457a1Slukemspecified by
537d7d0f414Slukem.Sy MAKECONF .
538cc95aaefSlukem.Pp
539cc95aaefSlukem.Em Note :
540cc95aaefSlukemVariables set in the environment, either directly or via
541cc95aaefSlukem.Sy build.sh
542cc95aaefSlukemoptions to set specific values in the
543cc95aaefSlukem.Sy \*[toolprefix]make- Ns Sy MACHINE
544cc95aaefSlukemwrapper script do not override variables set in the
545cc95aaefSlukem.Xr mk.conf 5
546cc95aaefSlukemfile.
547cc95aaefSlukemTo allow variables in
548cc95aaefSlukem.Xr mk.conf 5
549cc95aaefSlukemto be overridden by the environment or
550cc95aaefSlukem.Sy build.sh
551cc95aaefSlukemoptions, define the variables using the
552cc95aaefSlukem.Dq Li ?=
553cc95aaefSlukem.Xr make 1
554cc95aaefSlukemvariable assignment operator.
555cc95aaefSlukemFor example,
556cc95aaefSlukem.Bd -unfilled -offset indent
557cc95aaefSlukem.Li MAKEVERBOSE?=1
558cc95aaefSlukem.Ed
559a9756fb6Slukem.Pp
560a9756fb6SlukemThe supported
561a9756fb6Slukem.Xr mk.conf 5
562a9756fb6Slukemmake variables are:
563a9756fb6Slukem.\" Keep in sync with share/man/man5/mk.conf.5 section NETBSD SYSTEM VARIABLES
564a9756fb6Slukem.Bd -ragged -offset indent
565a9756fb6Slukem.Sy BSDOBJDIR ,
566a9756fb6Slukem.Sy BSDSRCDIR ,
567a9756fb6Slukem.Sy BUILD ,
568a9756fb6Slukem.Sy BUILDID ,
569a9756fb6Slukem.Sy BUILDINFO ,
570a9756fb6Slukem.Sy BUILDSEED ,
571a9756fb6Slukem.Sy CDEXTRA ,
572a9756fb6Slukem.Sy CONFIGOPTS ,
573a9756fb6Slukem.Sy COPTS ,
574a9756fb6Slukem.Sy CPUFLAGS ,
575a9756fb6Slukem.Sy DESTDIR ,
576a9756fb6Slukem.Sy EXTERNAL_TOOLCHAIN ,
577a9756fb6Slukem.Sy INSTALLBOOT_BOARDS ,
578a9756fb6Slukem.Sy INSTALLWORLDDIR ,
579a9756fb6Slukem.Sy KERNARCHDIR ,
580a9756fb6Slukem.Sy KERNCONFDIR ,
581a9756fb6Slukem.Sy KERNEL_DIR ,
582a9756fb6Slukem.Sy KERNOBJDIR ,
583a9756fb6Slukem.Sy KERNSRCDIR ,
584a9756fb6Slukem.Sy LOCALTIME ,
585a9756fb6Slukem.Sy MAKEVERBOSE ,
586a9756fb6Slukem.Sy MKAMDGPUFIRMWARE ,
587a9756fb6Slukem.Sy MKARGON2 ,
588a9756fb6Slukem.Sy MKARZERO ,
589a9756fb6Slukem.Sy MKATF ,
590a9756fb6Slukem.Sy MKBINUTILS ,
591a9756fb6Slukem.Sy MKBSDGREP ,
592a9756fb6Slukem.Sy MKBSDTAR ,
593a9756fb6Slukem.Sy MKCATPAGES ,
594a9756fb6Slukem.Sy MKCLEANSRC ,
595a9756fb6Slukem.Sy MKCLEANVERIFY ,
596a9756fb6Slukem.Sy MKCOMPAT ,
597a9756fb6Slukem.Sy MKCOMPATMODULES ,
598a9756fb6Slukem.Sy MKCOMPATTESTS ,
599a9756fb6Slukem.Sy MKCOMPATX11 ,
600a9756fb6Slukem.Sy MKCOMPLEX ,
601a9756fb6Slukem.Sy MKCROSSGDB ,
602a9756fb6Slukem.Sy MKCTF ,
603a9756fb6Slukem.Sy MKCVS ,
604a9756fb6Slukem.Sy MKCXX ,
605a9756fb6Slukem.Sy MKDEBUG ,
606a9756fb6Slukem.Sy MKDEBUGKERNEL ,
607a9756fb6Slukem.Sy MKDEBUGLIB ,
608a9756fb6Slukem.Sy MKDEBUGTOOLS ,
609a9756fb6Slukem.Sy MKDEPINCLUDES ,
610a9756fb6Slukem.Sy MKDOC ,
611a9756fb6Slukem.Sy MKDTB ,
612a9756fb6Slukem.Sy MKDTC ,
613a9756fb6Slukem.Sy MKDTRACE ,
614a9756fb6Slukem.Sy MKDYNAMICROOT ,
615a9756fb6Slukem.Sy MKFIRMWARE ,
616a9756fb6Slukem.Sy MKGCC ,
617a9756fb6Slukem.Sy MKGCCCMDS ,
618a9756fb6Slukem.Sy MKGDB ,
619a9756fb6Slukem.Sy MKGROFF ,
620a9756fb6Slukem.Sy MKGROFFHTMLDOC ,
621a9756fb6Slukem.Sy MKHESIOD ,
622a9756fb6Slukem.Sy MKHOSTOBJ ,
623a9756fb6Slukem.Sy MKHTML ,
624a9756fb6Slukem.Sy MKIEEEFP ,
625a9756fb6Slukem.Sy MKINET6 ,
626a9756fb6Slukem.Sy MKINFO ,
627a9756fb6Slukem.Sy MKIPFILTER ,
628a9756fb6Slukem.Sy MKISCSI ,
629a9756fb6Slukem.Sy MKKERBEROS ,
630a9756fb6Slukem.Sy MKKMOD ,
631a9756fb6Slukem.Sy MKKYUA ,
632a9756fb6Slukem.Sy MKLDAP ,
633a9756fb6Slukem.Sy MKLIBCSANITIZER ,
634a9756fb6Slukem.Sy MKLIBCXX ,
635a9756fb6Slukem.Sy MKLIBSTDCXX ,
636a9756fb6Slukem.Sy MKLINKLIB ,
637a9756fb6Slukem.Sy MKLINT ,
638a9756fb6Slukem.Sy MKLLVM ,
639a9756fb6Slukem.Sy MKLLVMRT ,
640a9756fb6Slukem.Sy MKLVM ,
641a9756fb6Slukem.Sy MKMAKEMANDB ,
642a9756fb6Slukem.Sy MKMAN ,
643a9756fb6Slukem.Sy MKMANDOC ,
644a9756fb6Slukem.Sy MKMANZ ,
645a9756fb6Slukem.Sy MKMDNS ,
646a9756fb6Slukem.Sy MKNLS ,
647a9756fb6Slukem.Sy MKNOUVEAUFIRMWARE ,
648a9756fb6Slukem.Sy MKNPF ,
649a9756fb6Slukem.Sy MKNSD ,
650a9756fb6Slukem.Sy MKOBJ ,
651a9756fb6Slukem.Sy MKOBJDIRS ,
652a9756fb6Slukem.Sy MKPAM ,
653a9756fb6Slukem.Sy MKPCC ,
654a9756fb6Slukem.Sy MKPF ,
655a9756fb6Slukem.Sy MKPIC ,
656a9756fb6Slukem.Sy MKPICINSTALL ,
657a9756fb6Slukem.Sy MKPICLIB ,
658a9756fb6Slukem.Sy MKPIE ,
659a9756fb6Slukem.Sy MKPIGZGZIP ,
660a9756fb6Slukem.Sy MKPOSTFIX ,
661a9756fb6Slukem.Sy MKPROFILE ,
662a9756fb6Slukem.Sy MKRADEONFIRMWARE ,
663a9756fb6Slukem.Sy MKRELRO ,
664a9756fb6Slukem.Sy MKREPRO ,
665a9756fb6Slukem.Sy MKREPRO_TIMESTAMP ,
666a9756fb6Slukem.Sy MKRUMP ,
667a9756fb6Slukem.Sy MKSANITIZER ,
668a9756fb6Slukem.Sy MKSHARE ,
669a9756fb6Slukem.Sy MKSKEY ,
670a9756fb6Slukem.Sy MKSLJIT ,
671a9756fb6Slukem.Sy MKSOFTFLOAT ,
672a9756fb6Slukem.Sy MKSTATICLIB ,
673a9756fb6Slukem.Sy MKSTATICPIE ,
674a9756fb6Slukem.Sy MKSTRIPIDENT ,
675a9756fb6Slukem.Sy MKSTRIPSYM ,
676a9756fb6Slukem.Sy MKTEGRAFIRMWARE ,
677a9756fb6Slukem.Sy MKTPM ,
678a9756fb6Slukem.Sy MKUNBOUND ,
679a9756fb6Slukem.Sy MKUNPRIVED ,
680a9756fb6Slukem.Sy MKUPDATE ,
681a9756fb6Slukem.Sy MKX11 ,
682a9756fb6Slukem.Sy MKX11FONTS ,
683a9756fb6Slukem.Sy MKX11MOTIF ,
684a9756fb6Slukem.Sy MKXORG_SERVER ,
685a9756fb6Slukem.Sy MKYP ,
686a9756fb6Slukem.Sy MKZFS ,
687a9756fb6Slukem.Sy NETBSDSRCDIR ,
688a9756fb6Slukem.Sy NETBSD_OFFICIAL_RELEASE ,
689a9756fb6Slukem.Sy NOCLEANDIR ,
690a9756fb6Slukem.Sy NODISTRIBDIRS ,
691a9756fb6Slukem.Sy NOINCLUDES ,
692a9756fb6Slukem.Sy OBJMACHINE ,
693a9756fb6Slukem.Sy RELEASEDIR ,
694a9756fb6Slukem.Sy RUMPUSER_THREADS ,
695a9756fb6Slukem.Sy RUMP_CURLWP ,
696a9756fb6Slukem.Sy RUMP_DEBUG ,
697a9756fb6Slukem.Sy RUMP_DIAGNOSTIC ,
698a9756fb6Slukem.Sy RUMP_KTRACE ,
699a9756fb6Slukem.Sy RUMP_LOCKDEBUG ,
700a9756fb6Slukem.Sy RUMP_LOCKS_UP ,
701a9756fb6Slukem.Sy RUMP_NBCOMPAT ,
702a9756fb6Slukem.Sy RUMP_VIRTIF ,
703a9756fb6Slukem.Sy RUMP_VNODE_LOCKDEBUG ,
704a9756fb6Slukem.Sy TOOLCHAIN_MISSING ,
705a9756fb6Slukem.Sy TOOLDIR ,
706a9756fb6Slukem.Sy USETOOLS ,
707a9756fb6Slukem.Sy USE_FORT ,
708a9756fb6Slukem.Sy USE_HESIOD ,
709a9756fb6Slukem.Sy USE_INET6 ,
710a9756fb6Slukem.Sy USE_JEMALLOC ,
711a9756fb6Slukem.Sy USE_KERBEROS ,
712a9756fb6Slukem.Sy USE_LDAP ,
713a9756fb6Slukem.Sy USE_LIBCSANITIZER ,
714a9756fb6Slukem.Sy USE_PAM ,
715a9756fb6Slukem.Sy USE_PIGZGZIP ,
716a9756fb6Slukem.Sy USE_SANITIZER ,
717a9756fb6Slukem.Sy USE_SKEY ,
718a9756fb6Slukem.Sy USE_SSP ,
719a9756fb6Slukem.Sy USE_XZ_SETS ,
720a9756fb6Slukem.Sy USE_YP ,
721a9756fb6Slukem.Sy X11MOTIFPATH ,
722a9756fb6Slukem.Sy X11SRCDIR .
723a9756fb6Slukem.Ed
724a9756fb6Slukem.Pp
725a9756fb6SlukemThe obsolete
726a9756fb6Slukem.Xr mk.conf 5
727a9756fb6Slukemmake variables are:
728a9756fb6Slukem.\" Keep in sync with share/man/man5/mk.conf.5 section OBSOLETE VARIABLES
729a9756fb6Slukem.Bd -ragged -offset indent
730a9756fb6Slukem.Sy EXTSRCSRCDIR ,
731a9756fb6Slukem.Sy MKBFD ,
732a9756fb6Slukem.Sy MKCRYPTO ,
733a9756fb6Slukem.Sy MKEXTSRC ,
734a9756fb6Slukem.Sy MKKDEBUG ,
735a9756fb6Slukem.Sy MKKERBEROS4 ,
736a9756fb6Slukem.Sy MKLLD ,
737a9756fb6Slukem.Sy MKLLDB ,
738a9756fb6Slukem.Sy MKMCLINKER ,
739a9756fb6Slukem.Sy MKPERFUSE ,
740a9756fb6Slukem.Sy MKTOOLSDEBUG ,
741a9756fb6Slukem.Sy NBUILDJOBS ,
742a9756fb6Slukem.Sy SHAREDSTRINGS ,
743a9756fb6Slukem.Sy USE_COMBINE ,
744a9756fb6Slukem.Sy USE_NEW_TOOLCHAIN .
745a9756fb6Slukem.Ed
746d7d0f414Slukem.
747d7d0f414Slukem.Sh BUILDING
748d7d0f414Slukem.
749a9756fb6Slukem.Ss make command line options
7504113b00aSjmcThis is not a summary of all the options available to
751d7d0f414Slukem.Xr make 1 ;
752d7d0f414Slukemonly the options used most frequently with
753d7d0f414Slukem.Nx
754d7d0f414Slukembuilds are listed here.
755d7d0f414Slukem.
756d7d0f414Slukem.Bl -tag -width "var=value"
757d7d0f414Slukem.
7584f856ef5Slukem.It Fl j Ar njob
759d7d0f414SlukemRun up to
7604f856ef5Slukem.Ar njob
761d7d0f414Slukem.Xr make 1
762d7d0f414Slukemsubjobs in parallel.
7634113b00aSjmcMakefiles should use .WAIT or have explicit dependencies
764d7d0f414Slukemas necessary to enforce build ordering.
765d7d0f414Slukem.
7664f856ef5Slukem.It Fl m Ar dir
767d7d0f414SlukemSpecify the default directory for searching for system Makefile
768d7d0f414Slukemsegments, mainly the
769d7d0f414Slukem.Aq bsd.*.mk
77067990135Swizfiles.
77167990135SwizWhen building any full
772d7d0f414Slukem.Nx
773d7d0f414Slukemsource tree, this should be set to the
7740a35378dSwiz.Dq Pa share/mk
77567990135Swizdirectory in the source tree.
776000424deSdhollandThis is set automatically when building from the top level, or when using
777000424deSdholland.Sy build.sh .
778d7d0f414Slukem.
7794f856ef5Slukem.It Fl n
7809d6c4a26SlukemShow the commands that would have been executed, but do not
78167990135Swizactually execute them.
78267990135SwizThis will still cause recursion to take place.
783d7d0f414Slukem.
78455c70d75Szuntum.It Fl V Ar var
7859d6c4a26SlukemShow
786d7d0f414Slukem.Xr make 1 Ns 's
787d7d0f414Slukemidea of the value of
7884f856ef5Slukem.Ar var .
789d7d0f414SlukemDoes not build any targets.
790d7d0f414Slukem.
7919d6c4a26Slukem.It Ar var Ns Sy = Ns Ar value
792d7d0f414SlukemSet the variable
7939d6c4a26Slukem.Ar var
794d7d0f414Slukemto
7959d6c4a26Slukem.Ar value ,
796d7d0f414Slukemoverriding any setting specified by the process environment, the
797d7d0f414Slukem.Sy MAKECONF
798d7d0f414Slukemconfiguration file, or the system Makefile segments.
799d7d0f414Slukem.
800d7d0f414Slukem.El
801d7d0f414Slukem.
802a9756fb6Slukem.Ss make targets
803d7d0f414Slukem.
804d7d0f414SlukemThese default targets may be built by running
805d7d0f414Slukem.Xr make 1
806d7d0f414Slukemin any subtree of the
807d7d0f414Slukem.Nx
80867990135Swizsource code.
80967990135SwizIt is recommended that none of these be used from the top
810d7d0f414Slukemlevel Makefile; as a specific exception,
811d7d0f414Slukem.Dq make obj
812d7d0f414Slukemand
813d7d0f414Slukem.Dq make cleandir
814d7d0f414Slukemare useful in that context.
815d7d0f414Slukem.
816d7d0f414Slukem.Bl -tag -width "dependall"
817d7d0f414Slukem.
818d7d0f414Slukem.It Sy all
819d7d0f414SlukemBuild programs, libraries, and preformatted documentation.
820d7d0f414Slukem.
821d7d0f414Slukem.It Sy clean
822d7d0f414SlukemRemove program and library object code files.
823d7d0f414Slukem.
824d7d0f414Slukem.It Sy cleandir
825d7d0f414SlukemSame as
826d7d0f414Slukem.Sy clean ,
827d7d0f414Slukembut also remove preformatted documentation, dependency files generated
828d7d0f414Slukemby
829d7d0f414Slukem.Dq make depend ,
830d7d0f414Slukemand any other files known to be created at build time.
831d7d0f414Slukem.
832d7d0f414Slukem.It Sy depend
833d7d0f414SlukemCreate dependency files
8343cb563b3Slukem.Pa ( .depend )
835d7d0f414Slukemcontaining more detailed information about the dependencies of source
83667990135Swizcode on header files.
83767990135SwizAllows programs to be recompiled automatically when a dependency changes.
838d7d0f414Slukem.
839d7d0f414Slukem.It Sy dependall
840d7d0f414SlukemDoes a
841d7d0f414Slukem.Dq make depend
842d7d0f414Slukemimmediately followed by a
843d7d0f414Slukem.Dq make all .
844d7d0f414SlukemThis improves cache locality of the build since both passes read the source
845d7d0f414Slukemfiles in their entirety.
846d7d0f414Slukem.
847e26864a9Slukem.It Sy distclean
848e26864a9SlukemSynonym for
849e26864a9Slukem.Sy cleandir .
850e26864a9Slukem.
851d7d0f414Slukem.It Sy includes
85267990135SwizBuild and install system header files.
85367990135SwizTypically needed before any system libraries or programs can be built.
854d7d0f414Slukem.
855d7d0f414Slukem.It Sy install
856d7d0f414SlukemInstall programs, libraries, and documentation into
857d7d0f414Slukem.Sy DESTDIR .
858d7d0f414SlukemFew files will be installed to
85934e5de79Slukem.Sy DESTDIR Ns Pa /dev ,
86034e5de79Slukem.Sy DESTDIR Ns Pa /etc ,
86134e5de79Slukem.Sy DESTDIR Ns Pa /root
862d7d0f414Slukemor
86334e5de79Slukem.Sy DESTDIR Ns Pa /var
864d7d0f414Slukemin order to prevent user supplied configuration data from being overwritten.
865d7d0f414Slukem.It Sy lint
866d7d0f414SlukemRun
867d7d0f414Slukem.Xr lint 1
868d7d0f414Slukemagainst the C source code, where appropriate, and generate
869d7d0f414Slukemsystem-installed lint libraries.
870d7d0f414Slukem.
871d7d0f414Slukem.It Sy obj
872d7d0f414SlukemCreate object directories to be used for built files, instead of
873d7d0f414Slukembuilding directly in the source tree.
874d7d0f414Slukem.
875d7d0f414Slukem.It Sy tags
876d7d0f414SlukemCreate
877d7d0f414Slukem.Xr ctags 1
878d7d0f414Slukemsearchable function lists usable by the
879d7d0f414Slukem.Xr ex 1
880d7d0f414Slukemand
881d7d0f414Slukem.Xr vi 1
882d7d0f414Slukemtext editors.
883d7d0f414Slukem.
884d7d0f414Slukem.El
885d7d0f414Slukem.
886a9756fb6Slukem.Ss make targets for the top level
887d7d0f414Slukem.
888d7d0f414SlukemAdditional
889d7d0f414Slukem.Xr make 1
890d7d0f414Slukemtargets are usable specifically from the top source level to facilitate
891d7d0f414Slukembuilding the entire
892d7d0f414Slukem.Nx
893d7d0f414Slukemsource tree.
894d7d0f414Slukem.
8951c855902Slukem.Bl -tag -width "distribution"
896d7d0f414Slukem.
897d7d0f414Slukem.It Sy build
898d7d0f414SlukemBuild the entire
899d7d0f414Slukem.Nx
90009831171Sreedsystem (except the kernel).
90167990135SwizThis orders portions of the source tree such that prerequisites
902d7d0f414Slukemwill be built in the proper order.
903d7d0f414Slukem.
9041c855902Slukem.It Sy distribution
9051c855902SlukemDo a
9061c855902Slukem.Dq make build ,
90709831171Sreedand then install a full distribution (which does not include a kernel) into
90831b7057fSlukem.Sy DESTDIR ,
90931b7057fSlukemincluding files in
91034e5de79Slukem.Sy DESTDIR Ns Pa /dev ,
91134e5de79Slukem.Sy DESTDIR Ns Pa /etc ,
91234e5de79Slukem.Sy DESTDIR Ns Pa /root
91331b7057fSlukemand
91434e5de79Slukem.Sy DESTDIR Ns Pa /var .
9151c855902Slukem.
9161c855902Slukem.It Sy buildworld
9171c855902SlukemAs per
9181c855902Slukem.Dq make distribution ,
9191c855902Slukemexcept that it ensures that
9201c855902Slukem.Sy DESTDIR
9211c855902Slukemis not the root directory.
9221c855902Slukem.
9231c855902Slukem.It Sy installworld
9241c855902SlukemInstall the distribution from
9251c855902Slukem.Sy DESTDIR
9261c855902Slukemto
927000424deSdholland.Sy INSTALLWORLDDIR ,
928000424deSdhollandwhich defaults to the root directory.
9291c855902SlukemEnsures that
9301c855902Slukem.Sy INSTALLWORLDDIR
9314113b00aSjmcis not the root directory if cross compiling.
9321c855902Slukem.Pp
933a5aed269SapbThe
934a5aed269Sapb.Sy INSTALLSETS
93594bddc04Sapbenvironment variable may be set to a space-separated list of
936a5aed269Sapbdistribution sets to be installed.
937a5aed269SapbBy default, all sets except
938a5aed269Sapb.Dq etc
939a5aed269Sapband
940a5aed269Sapb.Dq xetc
941000424deSdhollandare installed, so most files in
942a5aed269Sapb.Sy INSTALLWORLDDIR Ns Pa /etc
943000424deSdhollandwill not be installed or modified.
944a5aed269Sapb.Pp
9451c855902Slukem.Em Note :
946a5aed269SapbBefore performing this operation with
947a5aed269Sapb.Sy INSTALLWORLDDIR Ns = Ns Pa / ,
948a5aed269Sapbit is highly recommended that you upgrade your kernel and reboot.
949a5aed269SapbAfter performing this operation,
950a5aed269Sapbit is recommended that you use
951a5aed269Sapb.Xr etcupdate 8
952a5aed269Sapbto update files in
9535b8d7483Sabs.Sy INSTALLWORLDDIR Ns Pa /etc ,
9545b8d7483Sabsand
955a5aed269Sapb.Xr postinstall 8
9565b8d7483Sabsto check for or fix inconsistencies.
9574e91f80fSlukem.It Sy sets
9584e91f80fSlukemCreate distribution sets from
9594e91f80fSlukem.Sy DESTDIR
9604e91f80fSlukeminto
961b08050d6Slukem.Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/sets .
9624e91f80fSlukemShould be run after
963000424deSdholland.Dq make distribution ,
964000424deSdhollandas
9654e91f80fSlukem.Dq make build
966000424deSdhollandalone does not install all of the required files.
9674e91f80fSlukem.
968b7d3d220Slukem.It Sy sourcesets
969b7d3d220SlukemCreate source sets of the source tree into
970b7d3d220Slukem.Sy RELEASEDIR Ns Pa /source/sets .
971b7d3d220Slukem.
972c4fd2e8bSapb.It Sy syspkgs
973c4fd2e8bSapbCreate syspkgs from
974c4fd2e8bSapb.Sy DESTDIR
975c4fd2e8bSapbinto
976b08050d6Slukem.Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/syspkgs .
977c4fd2e8bSapbShould be run after
978000424deSdholland.Dq make distribution ,
979000424deSdhollandas
980c4fd2e8bSapb.Dq make build
981000424deSdhollandalone does not install all of the required files.
982c4fd2e8bSapb.
983fc4bd1a9Slukem.It Sy release
984fc4bd1a9SlukemDo a
985fc4bd1a9Slukem.Dq make distribution ,
986fc4bd1a9Slukembuild kernels, distribution media, and install sets
987fc4bd1a9Slukem(this as per
988fc4bd1a9Slukem.Dq make sets ) ,
989fc4bd1a9Slukemand
990fc4bd1a9Slukemthen package the system into a standard release layout as described by
991fc4bd1a9Slukem.Xr release 7 .
992fc4bd1a9SlukemThis requires that
993fc4bd1a9Slukem.Sy RELEASEDIR
994fc4bd1a9Slukembe set (see above).
995fc4bd1a9Slukem.
996000424deSdholland.It Sy iso-image
997110a6128SapbCreate a
998110a6128Sapb.Nx
999110a6128Sapbinstallation CD-ROM image in the
100005549fceSsnj.Sy RELEASEDIR Ns Pa /images
1001110a6128Sapbdirectory.
1002110a6128SapbThe CD-ROM file system will have a layout as described in
1003110a6128Sapb.Xr release 7 .
1004110a6128Sapb.Pp
1005110a6128SapbFor most machine types, the CD-ROM will be bootable, and will automatically
1006110a6128Sapbrun the
1007110a6128Sapb.Xr sysinst 8
1008110a6128Sapbmenu-based installation program, which can be used to install or upgrade a
1009110a6128Sapb.Nx
1010110a6128Sapbsystem.
1011110a6128SapbBootable CD-ROMs also contain tools that may be useful in
1012110a6128Sapbrepairing a damaged
1013110a6128Sapb.Nx
1014110a6128Sapbinstallation.
1015110a6128Sapb.Pp
1016110a6128SapbBefore
1017110a6128Sapb.Dq make iso-image
1018110a6128Sapbis attempted, RELEASEDIR must be populated by
101921078fc3Sapb.Dq make release
102021078fc3Sapbor equivalent.
1021110a6128Sapb.Pp
1022f26a4cc9Slukem.Em Note :
1023f26a4cc9SlukemOther, smaller, CD-ROM images may be created in the
1024b08050d6Slukem.Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/cdrom
1025110a6128Sapbdirectory by
1026110a6128Sapb.Dq "make release" .
1027110a6128SapbThese smaller images usually contain the same tools as the larger images in
102805549fceSsnj.Sy RELEASEDIR Ns Pa /images ,
1029110a6128Sapbbut do not contain additional content such as the distribution sets.
1030110a6128Sapb.Pp
1031f26a4cc9Slukem.Em Note :
1032f26a4cc9SlukemThe mac68k port still uses an older method of creating
1033110a6128SapbCD-ROM images.
103421078fc3SapbThis requires the
103521078fc3Sapb.Xr mkisofs 1
103621078fc3Sapbutility, which is not part of
103721078fc3Sapb.Nx ,
103821078fc3Sapbbut which can be installed from
103937bd5c7dSapb.Pa pkgsrc/sysutils/cdrtools .
104021078fc3Sapb.
10419df2be37Slukem.It Sy iso-image-source
10421f84965eSjnemethCreate a
10431f84965eSjnemeth.Nx
10441f84965eSjnemethinstallation CD-ROM image in the
104505549fceSsnj.Sy RELEASEDIR Ns Pa /images
10461f84965eSjnemethdirectory.
10471f84965eSjnemethThe CD-ROM file system will have a layout as described in
10481f84965eSjnemeth.Xr release 7 .
10491f84965eSjnemethIt will have top level directories for the machine type and source.
10501f84965eSjnemeth.Pp
10511f84965eSjnemethFor most machine types, the CD-ROM will be bootable, and will automatically
10521f84965eSjnemethrun the
10531f84965eSjnemeth.Xr sysinst 8
10541f84965eSjnemethmenu-based installation program, which can be used to install or upgrade a
10551f84965eSjnemeth.Nx
10561f84965eSjnemethsystem.
10571f84965eSjnemethBootable CD-ROMs also contain tools that may be useful in
10581f84965eSjnemethrepairing a damaged
10591f84965eSjnemeth.Nx
10601f84965eSjnemethinstallation.
10611f84965eSjnemeth.Pp
10621f84965eSjnemethBefore
10631f84965eSjnemeth.Dq make iso-image-source
10641f84965eSjnemethis attempted, RELEASEDIR must be populated by
10651f84965eSjnemeth.Dq make sourcesets release
10661f84965eSjnemethor equivalent.
10671f84965eSjnemeth.Pp
1068f26a4cc9Slukem.Em Note :
1069f26a4cc9SlukemOther, smaller, CD-ROM images may be created in the
1070b08050d6Slukem.Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/cdrom
10711f84965eSjnemethdirectory by
10721f84965eSjnemeth.Dq make release .
10731f84965eSjnemethThese smaller images usually contain the same tools as the larger images in
107405549fceSsnj.Sy RELEASEDIR Ns Pa /images ,
10751f84965eSjnemethbut do not contain additional content such as the distribution sets.
10761f84965eSjnemeth.Pp
1077f26a4cc9Slukem.Em Note :
1078f26a4cc9SlukemThe mac68k port still uses an older method of creating
10791f84965eSjnemethCD-ROM images.
10801f84965eSjnemethThis requires the
10811f84965eSjnemeth.Xr mkisofs 1
10821f84965eSjnemethutility, which is not part of
10831f84965eSjnemeth.Nx ,
10841f84965eSjnemethbut which can be installed from
10851f84965eSjnemeth.Pa pkgsrc/sysutils/cdrtools .
10861f84965eSjnemeth.
1087b753e6a5Sapb.It Sy install-image
1088b753e6a5SapbCreate a bootable
1089b753e6a5Sapb.Nx
1090b753e6a5Sapbinstallation disk image in the
1091a95eaab0Splunky.Sy RELEASEDIR Ns Pa /images
1092b753e6a5Sapbdirectory.
10933388131aSapbThe installation disk image is suitable for copying to
10943388131aSapbbootable USB flash memory sticks, etc., for machines which
10953388131aSapbare able to boot from such devices.
10963388131aSapbThe file system in the bootable disk image will have a layout
1097b753e6a5Sapbas described in
1098b753e6a5Sapb.Xr release 7 .
1099b753e6a5Sapb.Pp
1100b753e6a5SapbThe installation image is bootable, and will automatically
1101b753e6a5Sapbrun the
1102b753e6a5Sapb.Xr sysinst 8
1103b753e6a5Sapbmenu-based installation program, which can be used to install or upgrade a
1104b753e6a5Sapb.Nx
1105b753e6a5Sapbsystem.
11063388131aSapbThe image also contains tools that may be
1107b753e6a5Sapbuseful in repairing a damaged
1108b753e6a5Sapb.Nx
1109b753e6a5Sapbinstallation.
1110b753e6a5Sapb.Pp
1111b753e6a5SapbBefore
1112b753e6a5Sapb.Dq make install-image
11133388131aSapbis attempted,
11143388131aSapb.Sy RELEASEDIR
11153388131aSapbmust be populated by
1116b753e6a5Sapb.Dq make release
11173388131aSapbor equivalent.
11183388131aSapbThe build must have been performed with
1119b753e6a5Sapb.Sy MKUNPRIVED=yes
11203388131aSapbbecause
11213388131aSapb.Dq make install-image
11223388131aSapbrelies on information in
11233388131aSapb.Sy DESTDIR Ns Pa /METALOG .
1124b753e6a5Sapb.
112553428a08Sriastradh.It Sy live-image
1126b753e6a5SapbCreate
1127b753e6a5Sapb.Nx
1128b753e6a5Sapblive images in the
1129c09d6082Spgoyette.Sy RELEASEDIR/images
1130b753e6a5Sapbdirectory.
1131b753e6a5SapbThe live image contains all necessary files
1132b753e6a5Sapbto boot
1133b753e6a5Sapb.Nx
11343388131aSapbup to multi-user mode, including all files
1135b753e6a5Sapbwhich should be extracted during installation,
1136b753e6a5Sapb.Nx
11373388131aSapbdisklabel, bootloaders, etc.
1138b753e6a5Sapb.Pp
11393388131aSapbThe live image is suitable for use as a disk image in
11403388131aSapbvirtual machine environments such as QEMU,
11413388131aSapband also useful to boot
1142b753e6a5Sapb.Nx
11433388131aSapbfrom a USB flash memory stick
11443388131aSapbon a real machine, without the need for installation.
1145b753e6a5Sapb.Pp
1146b753e6a5SapbBefore
1147b753e6a5Sapb.Dq make live-image
1148b753e6a5Sapbis attempted, RELEASEDIR must be populated by
1149b753e6a5Sapb.Dq make release
1150f06b8cb5Stsutsuior equivalent.
11513388131aSapbThe build must have been performed with
1152b753e6a5Sapb.Sy MKUNPRIVED=yes
11533388131aSapbbecause
11543388131aSapb.Dq make install-image
11553388131aSapbrelies on information in
11563388131aSapb.Sy DESTDIR Ns Pa /METALOG .
1157b753e6a5Sapb.
1158fc4bd1a9Slukem.It Sy regression-tests
1159fc4bd1a9SlukemCan only be run after building the regression tests in the directory
1160fc4bd1a9Slukem.Dq regress .
1161000424deSdhollandRuns those compiled regression tests on the local host.
1162f26a4cc9Slukem.Pp
1163f26a4cc9Slukem.Em Note :
1164f26a4cc9SlukemMost tests are now managed instead using
1165000424deSdholland.Xr atf 7 ;
1166000424deSdhollandthis target should probably run those as well but currently does not.
1167fc4bd1a9Slukem.
1168d7d0f414Slukem.El
1169d7d0f414Slukem.
1170a9756fb6Slukem.Ss The build.sh script
1171d7d0f414Slukem.
117237b9b22eSapbThis script file is a shell script designed to build the
1173d7d0f414Slukementire
1174d7d0f414Slukem.Nx
117537b9b22eSapbsystem on any host with a suitable modern shell and some common
117637b9b22eSapbutilities.
117737b9b22eSapbThe required shell features are described under the
117837b9b22eSapb.Sy HOST_SH
117937b9b22eSapbvariable.
118037b9b22eSapb.Pp
118137b9b22eSapbIf a host system's default shell does support the required
118237b9b22eSapbfeatures, then we suggest that you explicitly specify
118337b9b22eSapba suitable shell using a command like
118437b9b22eSapb.Bd -unfilled -offset indent
118537b9b22eSapb.Li /path/to/suitable/shell build.sh Op Ar options
118637b9b22eSapb.Ed
118737b9b22eSapb.Pp
118837b9b22eSapbThe above command will usually enable
11893cb563b3Slukem.Sy build.sh
119037b9b22eSapbto automatically set
119137b9b22eSapb.Sy HOST_SH Ns Cm = Ns Pa /path/to/suitable/shell ,
119237b9b22eSapbbut if that fails, then the following set of commands may be used instead:
119337b9b22eSapb.Bd -unfilled -offset indent
119437b9b22eSapb.Li HOST_SH= Ns Va /path/to/suitable/shell
119537b9b22eSapb.Li export HOST_SH
119637b9b22eSapb.Li ${HOST_SH} build.sh Op Ar options
119737b9b22eSapb.Ed
119837b9b22eSapb.Pp
119937b9b22eSapbIf
120037b9b22eSapb.Sy build.sh
120137b9b22eSapbdetects that it is being executed under an unsuitable shell, it attempts
12029d6c4a26Slukemto exec a suitable shell instead, or shows an error message.
120337b9b22eSapbIf
120437b9b22eSapb.Sy HOST_SH
120537b9b22eSapbis not set explicitly, then
12063cb563b3Slukem.Sy build.sh
120737b9b22eSapbsets a default using heuristics dependent on the host platform,
120837b9b22eSapbor from the shell under which
12093cb563b3Slukem.Sy build.sh
121037b9b22eSapbis executed (if that can be determined),
121137b9b22eSapbor using the first copy of
121237b9b22eSapb.Pa sh
121337b9b22eSapbfound in
12146aba6b16Slukem.Ev PATH .
1215d7d0f414Slukem.Pp
1216d7d0f414SlukemAll cross-compile builds, and most native builds, of the entire system
1217d7d0f414Slukemshould make use of
1218d7d0f414Slukem.Sy build.sh
1219d7d0f414Slukemrather than just running
1220d7d0f414Slukem.Dq make .
1221d7d0f414SlukemThis way, the
1222d7d0f414Slukem.Xr make 1
1223d7d0f414Slukemprogram will be bootstrapped properly, in case the host system has an
1224d7d0f414Slukemolder or incompatible
1225d7d0f414Slukem.Dq make
1226d7d0f414Slukemprogram.
1227d7d0f414Slukem.Pp
1228d7d0f414SlukemWhen compiling the entire system via
1229d7d0f414Slukem.Sy build.sh ,
1230d7d0f414Slukemmany
1231d7d0f414Slukem.Xr make 1
1232d7d0f414Slukemvariables are set for you in order to help encapsulate the build
123367990135Swizprocess.
123467990135SwizIn the list of options below, variables that are automatically set by
1235d7d0f414Slukem.Sy build.sh
1236d7d0f414Slukemare noted where applicable.
123731b7057fSlukem.
1238d7d0f414Slukem.Pp
123931b7057fSlukemThe following operations are supported by
1240d7d0f414Slukem.Sy build.sh :
1241d7d0f414Slukem.
124231b7057fSlukem.Bl -tag -width "distribution"
124331b7057fSlukem.
124431b7057fSlukem.It Sy build
124531b7057fSlukemBuild the system as per
124631b7057fSlukem.Dq make build .
1247000424deSdhollandBefore the main part of the build commences, this command runs the
124831b7057fSlukem.Sy obj
1249000424deSdhollandoperation (unless the
1250000424deSdholland.Fl o
1251000424deSdhollandoption is given),
1252000424deSdholland.Dq make cleandir
1253000424deSdholland(unless the
1254000424deSdholland.Fl u
1255000424deSdhollandoption is given),
1256000424deSdhollandand the
125731b7057fSlukem.Sy tools
1258000424deSdhollandoperation.
125931b7057fSlukem.
126031b7057fSlukem.It Sy distribution
126131b7057fSlukemBuild a full distribution as per
126231b7057fSlukem.Dq make distribution .
1263000424deSdhollandThis command first runs the
126431b7057fSlukem.Sy build
126531b7057fSlukemoperation.
126631b7057fSlukem.
126731b7057fSlukem.It Sy release
126831b7057fSlukemBuild a full release as per
126931b7057fSlukem.Dq make release .
1270000424deSdhollandThis command first runs the
127131b7057fSlukem.Sy distribution
127231b7057fSlukemoperation.
127331b7057fSlukem.
12749d6c4a26Slukem.It Sy help
12759d6c4a26SlukemShow a help message, and exit.
12769d6c4a26Slukem.
127746d44d89Slukem.It Sy makewrapper
127846d44d89SlukemCreate the
12796aba6b16Slukem.Sy \*[toolprefix]make- Ns Sy MACHINE
1280cc95aaefSlukemwrapper script.
128146d44d89SlukemThis operation is automatically performed for any of the other
128246d44d89Slukemoperations.
128346d44d89Slukem.
12849df2be37Slukem.It Sy cleandir
12859df2be37SlukemPerform
12869df2be37Slukem.Dq make cleandir .
12879df2be37Slukem.
128831b7057fSlukem.It Sy obj
128931b7057fSlukemPerform
129031b7057fSlukem.Dq make obj .
12914e91f80fSlukem.
129231b7057fSlukem.It Sy tools
129331b7057fSlukemBuild and install the host tools from
129431b7057fSlukem.Pa src/tools .
1295000424deSdhollandThis command will first run
1296000424deSdholland.Dq make obj
1297000424deSdhollandand
1298000424deSdholland.Dq make cleandir
1299000424deSdhollandin the
1300000424deSdholland.Pa tools
1301000424deSdhollandsubdirectory unless the
1302000424deSdholland.Fl o
1303000424deSdhollandor
1304000424deSdholland.Fl u
1305000424deSdhollandoptions (respectively) are given.
13064e33a0f5Slukem.
13074e33a0f5Slukem.It Sy install Ns = Ns Ar idir
13084e33a0f5SlukemInstall the contents of
13094e33a0f5Slukem.Sy DESTDIR
13104e33a0f5Slukemto
13114e33a0f5Slukem.Ar idir ,
13124e33a0f5Slukemusing
13134e33a0f5Slukem.Dq make installworld .
1314f26a4cc9Slukem.Pp
1315f26a4cc9Slukem.Em Note :
1316f26a4cc9SlukemFiles that are part of the
1317a5aed269Sapb.Dq etc
1318a5aed269Sapbor
1319a5aed269Sapb.Dq xetc
132094bddc04Sapbsets will not be installed, unless overridden by
132194bddc04Sapbthe INSTALLSETS environment variable.
13224e33a0f5Slukem.
132331b7057fSlukem.It Sy kernel Ns = Ns Ar kconf
132431b7057fSlukemBuild a new kernel.
132531b7057fSlukemThe
132631b7057fSlukem.Ar kconf
132731b7057fSlukemargument is the name of a configuration file suitable
132831b7057fSlukemfor use by
1329a9b411c1Speter.Xr config 1 .
133031b7057fSlukemIf
133131b7057fSlukem.Ar kconf
133231b7057fSlukemdoes not contain any
133331b7057fSlukem.Sq /
133431b7057fSlukemcharacters, the configuration file is expected to be found in the
133531b7057fSlukem.Sy KERNCONFDIR
133631b7057fSlukemdirectory, which is typically
13370a35378dSwiz.Pa sys/arch/MACHINE/conf .
133831b7057fSlukemThe new kernel will be built in a subdirectory of
133931b7057fSlukem.Sy KERNOBJDIR ,
134031b7057fSlukemwhich is typically
13416aba6b16Slukem.Pa sys/arch/ Ns Sy MACHINE Ns Pa /compile
134231b7057fSlukemor an associated object directory.
1343000424deSdholland.Pp
1344000424deSdhollandThis command does
1345000424deSdholland.Em not
1346000424deSdhollandimply the
134731b7057fSlukem.Sy tools
1348000424deSdhollandcommand; run the
1349000424deSdholland.Sy tools
1350000424deSdhollandcommand first unless it is
1351000424deSdholland.Em certain
1352000424deSdhollandthat the tools already exist and are up to date.
1353000424deSdholland.Pp
1354000424deSdhollandThis command will run
1355000424deSdholland.Dq make cleandir
1356000424deSdhollandon the kernel in question first unless the
1357000424deSdholland.Fl u
1358000424deSdhollandoption is given.
135931b7057fSlukem.
1360545afccdSmartin.It Sy kernel.gdb Ns = Ns Ar kconf
1361545afccdSmartinBuild a new kernel with debug information.
1362545afccdSmartinSimilar to the above
1363545afccdSmartin.Sy kernel Ns = Ns Ar kconf
1364545afccdSmartinoperation, but creates a
1365545afccdSmartin.Pa netbsd.gdb
1366545afccdSmartinfile alongside of the kernel
1367545afccdSmartin.Pa netbsd ,
1368545afccdSmartinwhich contains a full symbol table and can be used for debugging
13690a35378dSwiz(for example with a cross-gdb built by
1370545afccdSmartin.Sy MKCROSSGDB ) .
13710fbbfea2Suebayasi.It Sy kernels
13720fbbfea2SuebayasiThis command will build all kernels defined in port specific release build
13730fbbfea2Suebayasiprocedure.
13740fbbfea2Suebayasi.Pp
13750fbbfea2SuebayasiThis command internally calls the
13760fbbfea2Suebayasi.Sy kernel Ns = Ns Ar kconf
13770fbbfea2Suebayasioperation for each found kernel configuration file.
137872d2ca4dSapb.It Sy modules
137972d2ca4dSapbThis command will build kernel modules and install them into
138072d2ca4dSapb.Sy DESTDIR .
138172d2ca4dSapb.
13824e33a0f5Slukem.It Sy releasekernel Ns = Ns Ar kconf
13834e33a0f5SlukemInstall a
13844e33a0f5Slukem.Xr gzip 1 Ns ed
1385000424deSdhollandcopy of the kernel previously built by
13864e33a0f5Slukem.Sy kernel Ns = Ns Ar kconf
13874e33a0f5Slukeminto
13886aba6b16Slukem.Sy RELEASEDIR Ns Pa / Ns Sy RELEASEMACHINEDIR Ns Pa /binary/kernel ,
13894e33a0f5Slukemusually as
13904e33a0f5Slukem.Pa netbsd- Ns Ar kconf Ns Pa .gz ,
13914e33a0f5Slukemalthough the
13924e33a0f5Slukem.Dq Pa netbsd
13934e33a0f5Slukemprefix is determined from the
13944e33a0f5Slukem.Dq Sy config
13954e33a0f5Slukemdirectives in
13964e33a0f5Slukem.Ar kconf .
139731b7057fSlukem.
13984e91f80fSlukem.It Sy sets
13994e91f80fSlukemPerform
14004e91f80fSlukem.Dq make sets .
1401b7d3d220Slukem.
1402b7d3d220Slukem.It Sy sourcesets
1403b7d3d220SlukemPerform
1404b7d3d220Slukem.Dq make sourcesets .
1405b7d3d220Slukem.
1406c4fd2e8bSapb.It Sy syspkgs
1407c4fd2e8bSapbPerform
1408c4fd2e8bSapb.Dq make syspkgs .
1409c4fd2e8bSapb.
141021078fc3Sapb.It Sy iso-image
141121078fc3SapbPerform
141221078fc3Sapb.Dq make iso-image .
141321078fc3Sapb.
14143afb399fSjnemeth.It Sy iso-image-source
14153afb399fSjnemethPerform
14163afb399fSjnemeth.Dq make iso-image-source .
14173afb399fSjnemeth.
1418b753e6a5Sapb.It Sy install-image
1419b753e6a5SapbPerform
1420b753e6a5Sapb.Dq make install-image .
1421b753e6a5Sapb.
1422b753e6a5Sapb.It Sy live-image
1423b753e6a5SapbPerform
1424b753e6a5Sapb.Dq make live-image .
1425b753e6a5Sapb.
1426a960e5c8Sapb.It Sy list-arch
14279d6c4a26SlukemShow a list of valid
1428a960e5c8Sapb.Sy MACHINE
1429a960e5c8Sapband
1430a960e5c8Sapb.Sy MACHINE_ARCH
1431a960e5c8Sapbsettings, the default
1432a960e5c8Sapb.Sy MACHINE_ARCH
1433a960e5c8Sapbfor each
1434a960e5c8Sapb.Sy MACHINE ,
1435a960e5c8Sapband aliases for
1436a960e5c8Sapb.Sy MACHINE Ns No / Ns Sy MACHINE_ARCH
1437a960e5c8Sapbpairs, and then exits.
1438a960e5c8SapbThe
1439a960e5c8Sapb.Fl m
1440a960e5c8Sapbor
1441a960e5c8Sapb.Fl a
1442a960e5c8Sapboptions (or both) may be used to specify glob patterns
1443a960e5c8Sapbthat will be used to narrow the list of results;
1444a960e5c8Sapbfor example,
144533444c81Sleot.Dq Li build.sh -m 'evb*' -a '*arm*' list-arch
1446a960e5c8Sapbwill list all known
1447a960e5c8Sapb.Sy MACHINE Ns No / Ns Sy MACHINE_ARCH
1448a960e5c8Sapbvalues in which either
1449a960e5c8Sapb.Sy MACHINE
1450a960e5c8Sapbor
1451a960e5c8Sapb.Sy ALIAS
1452a960e5c8Sapbmatches the pattern
1453a960e5c8Sapb.Ql evb* ,
1454a960e5c8Sapband
1455a960e5c8Sapb.Sy MACHINE_ARCH
1456a960e5c8Sapbmatches the pattern
1457a960e5c8Sapb.Ql *arm* .
1458a960e5c8Sapb.
145931b7057fSlukem.El
146031b7057fSlukem.
146131b7057fSlukem.Pp
146231b7057fSlukemThe following command line options alter the behaviour of the
146331b7057fSlukem.Sy build.sh
146431b7057fSlukemoperations described above:
146531b7057fSlukem.
1466d7d0f414Slukem.Bl -tag -width "-T tools"
1467d7d0f414Slukem.
14684f856ef5Slukem.It Fl a Ar arch
1469d7d0f414SlukemSet the value of
1470d7d0f414Slukem.Sy MACHINE_ARCH
1471d7d0f414Slukemto
14724f856ef5Slukem.Ar arch .
1473a960e5c8SapbSee the
1474a960e5c8Sapb.Fl m
1475a960e5c8Sapboption for more information.
1476d7d0f414Slukem.
14774f856ef5Slukem.It Fl B Ar buildid
1478d7d0f414SlukemSet the value of
1479d7d0f414Slukem.Sy BUILDID
1480d7d0f414Slukemto
14814f856ef5Slukem.Ar buildid .
148214df52feSsborrillThis will also append the build identifier to the name of the
1483cc95aaefSlukem.Sy \*[toolprefix]make- Ns Sy MACHINE
1484d7d0f414Slukemwrapper script so that the resulting name is of the form
14856aba6b16Slukem.Dq Sy \*[toolprefix]make- Ns Sy MACHINE Ns Sy -BUILDID .
1486d7d0f414Slukem.
148714df52feSsborrill.It Fl C Ar cdextras
1488f1ead220SapbAppend
148914df52feSsborrill.Ar cdextras
1490f1ead220Sapbto the
1491f1ead220Sapb.Sy CDEXTRA
1492f1ead220Sapbvariable,
1493f1ead220Sapbwhich is a space-separated list of files or directories that will be
1494f1ead220Sapbadded to the CD-ROM image that may be create by the
14950e0996d8Sjnemeth.Dq iso-image
14960e0996d8Sjnemethor
1497f1ead220Sapb.Dq iso-image-source
1498f1ead220Sapboperations.
149914df52feSsborrillFiles will be added to the root of the CD-ROM image, whereas directories
150014df52feSsborrillwill be copied recursively.
150114df52feSsborrillIf relative paths are specified, they will be converted to
150214df52feSsborrillabsolute paths before being used.
1503f1ead220SapbMultiple paths may be specified via multiple
1504f1ead220Sapb.Fl C
1505f1ead220Sapboptions, or via a single option whose argument contains multiple
1506f1ead220Sapbspace-separated paths.
15070e0996d8Sjnemeth.
15088039b48bSriastradh.It Fl c Ar compiler
15098039b48bSriastradhSelect the compiler for the toolchain to build
15108039b48bSriastradh.Nx
15118039b48bSriastradhand for inclusion in the
15128039b48bSriastradh.Nx
15138039b48bSriastradhdistribution.
15148039b48bSriastradhSupported choices:
15158039b48bSriastradh.Bl -inset -offset indent
15168039b48bSriastradh.It clang
15178039b48bSriastradh.It gcc
15188039b48bSriastradh[default]
15198039b48bSriastradh.El
15208039b48bSriastradh.Pp
15218039b48bSriastradhThe compiler used to build the toolchain can be different; see
15228039b48bSriastradh.Sy HOST_CC
15238039b48bSriastradhand
15248039b48bSriastradh.Sy HOST_CXX .
15254f856ef5Slukem.It Fl D Ar dest
15264f856ef5SlukemSet the value of
15274f856ef5Slukem.Sy DESTDIR
15284f856ef5Slukemto
15294f856ef5Slukem.Ar dest .
153024f8b531SapbIf a relative path is specified, it will be converted to an
153124f8b531Sapbabsolute path before being used.
15324f856ef5Slukem.
1533239dc05cSlukem.It Fl E
1534239dc05cSlukemSet
1535239dc05cSlukem.Sq expert
153646d44d89Slukemmode.
153746d44d89SlukemThis overrides various sanity checks, and allows:
1538239dc05cSlukem.Sy DESTDIR
153946d44d89Slukemdoes not have to be set to a non-root path for builds,
154046d44d89Slukemand
15416d22656bSlukem.Sy MKUNPRIVED=yes
154246d44d89Slukemdoes not have to be set when building as a non-root user.
154346d44d89Slukem.Pp
154446d44d89Slukem.Em Note :
154546d44d89SlukemIt is highly recommended that you know what you are doing when
154646d44d89Slukemyou use this option.
1547239dc05cSlukem.
15482dfb0224Swiz.It Fl h
15499d6c4a26SlukemShow a help message, and exit.
15502dfb0224Swiz.
15514f856ef5Slukem.It Fl j Ar njob
1552000424deSdhollandRun up to
1553000424deSdholland.Ar njob
1554000424deSdholland.Xr make 1
1555000424deSdhollandsubjobs in parallel;
1556000424deSdhollandpassed through to
1557d7d0f414Slukem.Xr make 1 .
1558f0633cf4SapbIf you see failures for reasons other than running out of memory
1559f0633cf4Sapbwhile using
1560f0633cf4Sapb.Sy build.sh
1561f0633cf4Sapbwith
1562f0633cf4Sapb.Fl j ,
1563f0633cf4Sapbplease save complete build logs
1564d7d0f414Slukemso the failures can be analyzed.
1565f0633cf4Sapb.Pp
1566f0633cf4SapbTo achieve the fastest builds,
1567f0633cf4Sapb.Fl j
1568f0633cf4Sapbvalues between (1 + the number of CPUs) and (2 * the number of CPUs)
1569f0633cf4Sapbare recommended.
1570f0633cf4SapbUse lower values on machines with limited memory or I/O bandwidth.
1571d7d0f414Slukem.
15724f856ef5Slukem.It Fl M Ar obj
15734f856ef5SlukemSet
15744f856ef5Slukem.Sy MAKEOBJDIRPREFIX
15754f856ef5Slukemto
15764f856ef5Slukem.Ar obj .
157782825222SapbUnsets
157882825222Sapb.Sy MAKEOBJDIR .
157982825222SapbSee
158049b378efSuwe.Dq Fl O Ar obj
158182825222Sapbfor more information.
158282825222Sapb.Pp
1583ca568b57SapbFor instance, if the source directory is
1584ca568b57Sapb.Pa /usr/src ,
1585ca568b57Sapba setting of
1586ca568b57Sapb.Dq Fl M Pa /usr/obj
1587ca568b57Sapbwill place build-time files under
1588ca568b57Sapb.Pa /usr/obj/usr/src/bin ,
1589ca568b57Sapb.Pa /usr/obj/usr/src/lib ,
1590ca568b57Sapb.Pa /usr/obj/usr/src/usr.bin ,
1591ca568b57Sapband so forth.
159282825222Sapb.Pp
159324f8b531SapbIf a relative path is specified, it will be converted to an
159424f8b531Sapbabsolute path before being used.
159582825222Sapb.Sy build.sh
159682825222Sapbimposes the restriction that the argument to the
159782825222Sapb.Fl M
159882825222Sapboption must not begin with a
159982825222Sapb.Dq \&$
160082825222Sapb(dollar sign)
160182825222Sapbcharacter; otherwise it would be too difficult
160282825222Sapbto determine whether the value is an absolute or a relative path.
160382825222SapbIf the directory does not already exist,
160482825222Sapb.Sy build.sh
160582825222Sapbwill create it.
16064f856ef5Slukem.
16074f856ef5Slukem.It Fl m Ar mach
1608d7d0f414SlukemSet the value of
1609d7d0f414Slukem.Sy MACHINE
1610d7d0f414Slukemto
16113038ebf2Sapb.Ar mach ,
1612a960e5c8Sapbunless the
1613a960e5c8Sapb.Ar mach
1614a960e5c8Sapbargument is an alias that refers to a
1615a960e5c8Sapb.Sy MACHINE Ns No / Ns Sy MACHINE_ARCH
1616a960e5c8Sapbpair, in which case both
1617a960e5c8Sapb.Sy MACHINE
1618a960e5c8Sapband
1619d7d0f414Slukem.Sy MACHINE_ARCH
1620a960e5c8Sapbare set from the alias.
1621a960e5c8SapbSuch aliases are interpreted entirely by
1622a960e5c8Sapb.Sy build.sh ;
1623a960e5c8Sapbthey are not used by any other part of the build system.
1624a960e5c8SapbThe
1625a960e5c8Sapb.Sy MACHINE_ARCH
1626a960e5c8Sapbsetting implied by
1627a960e5c8Sapb.Ar mach
1628a960e5c8Sapbwill override any value of
1629a960e5c8Sapb.Sy MACHINE_ARCH
1630a960e5c8Sapbin the process environment, but will not override a value set by the
16314f856ef5Slukem.Fl a
1632a960e5c8Sapboption.
163367990135SwizAll cross builds require
16344f856ef5Slukem.Fl m ,
1635d7d0f414Slukembut if unset on a NetBSD host, the host's value of MACHINE will be
1636d7d0f414Slukemdetected and used automatically.
163733018a01Slukem.Pp
1638a960e5c8SapbSee the
1639a960e5c8Sapb.Cm list-arch
1640a960e5c8Sapboperation for a way to get a list of valid
164133018a01Slukem.Sy MACHINE
164233018a01Slukemand
1643a960e5c8Sapb.Sy MACHINE_ARCH
1644a960e5c8Sapbsettings.
1645d7d0f414Slukem.
1646070871b5Slukem.It Fl N Ar noiselevel
1647070871b5SlukemSet the
1648*13890d5aSrillig.Dq noisiness
16495daa3301Slukemlevel of the build, by setting
16505daa3301Slukem.Sy MAKEVERBOSE
16515daa3301Slukemto
16525daa3301Slukem.Ar noiselevel .
1653070871b5Slukem.
16544f856ef5Slukem.It Fl n
1655d7d0f414SlukemShow the commands that would be executed by
1656d7d0f414Slukem.Sy build.sh ,
165767990135Swizbut do not make any changes.
165867990135SwizThis is similar in concept to
1659d7d0f414Slukem.Dq make -n .
1660d7d0f414Slukem.
16614f856ef5Slukem.It Fl O Ar obj
16624f856ef5SlukemCreate an appropriate transform macro for
16634f856ef5Slukem.Sy MAKEOBJDIR
16644f856ef5Slukemthat will place the built object files under
16654f856ef5Slukem.Ar obj .
166682825222SapbUnsets
166782825222Sapb.Sy MAKEOBJDIRPREFIX .
166882825222Sapb.Pp
1669ca568b57SapbFor instance, a setting of
1670ca568b57Sapb.Dq Fl O Pa /usr/obj
1671ca568b57Sapbwill place build-time files under
1672ca568b57Sapb.Pa /usr/obj/bin ,
1673ca568b57Sapb.Pa /usr/obj/lib ,
1674ca568b57Sapb.Pa /usr/obj/usr.bin ,
1675ca568b57Sapband so forth.
167682825222Sapb.Pp
167724f8b531SapbIf a relative path is specified, it will be converted to an
167824f8b531Sapbabsolute path before being used.
167982825222Sapb.Sy build.sh
168082825222Sapbimposes the restriction that the argument to the
168182825222Sapb.Fl O
168282825222Sapboption must not contain a
168382825222Sapb.Dq \&$
168482825222Sapb(dollar sign)
168582825222Sapbcharacter.
168682825222SapbIf the directory does not already exist,
168782825222Sapb.Sy build.sh
168882825222Sapbwill create it.
1689ca568b57Sapb.Pp
1690ca568b57SapbIn normal use, exactly one of the
1691ca568b57Sapb.Fl M
1692ca568b57Sapbor
1693ca568b57Sapb.Fl O
1694ca568b57Sapboptions should be specified.
1695437dcf46SapbIf neither
1696ca568b57Sapb.Fl M
1697ca568b57Sapbnor
1698ca568b57Sapb.Fl O
1699ca568b57Sapbis specified, then a default object directory will be chosen
1700ca568b57Sapbaccording to rules in
1701437dcf46Sapb.Aq bsd.obj.mk .
1702437dcf46SapbRelying on this default is not recommended because
1703437dcf46Sapbit is determined by complex rules that are influenced
1704437dcf46Sapbby the values of several variables and
1705437dcf46Sapbby the location of the source directory.
1706c170baaeSapb.Pp
1707f26a4cc9Slukem.Em Note :
1708f26a4cc9SlukemPlacing the
1709c170baaeSapb.Ar obj
1710c170baaeSapbdirectory location outside of the default source tree hierarchy makes
1711c170baaeSapbit easier to manually clear out old files in the event the
1712c170baaeSapb.Dq make cleandir
1713c170baaeSapboperation is unable to do so.
1714c170baaeSapb(See
1715c170baaeSapb.Sx CAVEATS
1716c170baaeSapbbelow.)
1717c170baaeSapb.Pp
1718f26a4cc9Slukem.Em Note :
1719f26a4cc9SlukemThe use of one of
1720c170baaeSapb.Fl M
1721c170baaeSapbor
1722c170baaeSapb.Fl O
1723c170baaeSapbis the only means of building multiple machine architecture userlands
1724c170baaeSapbfrom the same source tree without cleaning between builds (in which
1725c170baaeSapbcase, one would specify distinct
1726c170baaeSapb.Ar obj
1727c170baaeSapblocations for each).
17289d6c4a26Slukem.
17294f856ef5Slukem.It Fl o
1730d7d0f414SlukemSet the value of
1731d7d0f414Slukem.Sy MKOBJDIRS
1732d7d0f414Slukemto
1733d7d0f414Slukem.Dq no .
17340c4720f3SlukemOtherwise, it will be automatically set to
1735000424deSdholland.Dq yes .
1736000424deSdhollandThis default is opposite to the behaviour when not using
1737000424deSdholland.Sy build.sh .
1738d7d0f414Slukem.
17399d6c4a26Slukem.It Fl P
17409d6c4a26SlukemSet the value of
17419d6c4a26Slukem.Sy MKREPRO
17429d6c4a26Slukemand
17439d6c4a26Slukem.Sy MKREPRO_TIMESTAMP
17449d6c4a26Slukemto the latest source CVS timestamp for reproducible builds.
17459d6c4a26Slukem.
17464f856ef5Slukem.It Fl R Ar rel
17474f856ef5SlukemSet the value of
17484f856ef5Slukem.Sy RELEASEDIR
17494f856ef5Slukemto
17504f856ef5Slukem.Ar rel .
175124f8b531SapbIf a relative path is specified, it will be converted to an
175224f8b531Sapbabsolute path before being used.
17534f856ef5Slukem.
17544f856ef5Slukem.It Fl r
1755d7d0f414SlukemRemove the contents of
1756d7d0f414Slukem.Sy DESTDIR
1757d7d0f414Slukemand
1758d7d0f414Slukem.Sy TOOLDIR
175967990135Swizbefore building (provides a clean starting point).
176067990135SwizThis will skip deleting
1761d7d0f414Slukem.Sy DESTDIR
1762d7d0f414Slukemif building on a native system to the root directory.
1763d7d0f414Slukem.
1764b1d7b7c2Sperry.It Fl S Ar seed
1765b1d7b7c2SperryChange the value of
1766b1d7b7c2Sperry.Sy BUILDSEED
1767b1d7b7c2Sperryto
1768b1d7b7c2Sperry.Ar seed .
1769b1d7b7c2SperryThis should rarely be necessary.
1770b1d7b7c2Sperry.
17714f856ef5Slukem.It Fl T Ar tools
1772d7d0f414SlukemSet the value of
1773d7d0f414Slukem.Sy TOOLDIR
1774d7d0f414Slukemto
17754f856ef5Slukem.Ar tools .
177624f8b531SapbIf a relative path is specified, it will be converted to an
177724f8b531Sapbabsolute path before being used.
1778d7d0f414SlukemIf set, the bootstrap
1779d7d0f414Slukem.Dq make
1780000424deSdhollandwill only be rebuilt if the source files for
1781d7d0f414Slukem.Xr make 1
1782000424deSdhollandhave changed.
1783d7d0f414Slukem.
17844f856ef5Slukem.It Fl U
17856d22656bSlukemSet
17866d22656bSlukem.Sy MKUNPRIVED=yes .
1787d7d0f414Slukem.
17884f856ef5Slukem.It Fl u
17896d22656bSlukemSet
17906d22656bSlukem.Sy MKUPDATE=yes .
17914f856ef5Slukem.
1792a04634dbSlukem.It Xo
1793a04634dbSlukem.Fl V
1794a04634dbSlukem.Sm off
1795a04634dbSlukem.Ar var
1796a04634dbSlukem.Li =
1797a04634dbSlukem.Op Ar value
1798a04634dbSlukem.Sm on
1799a04634dbSlukem.Xc
180013b0ffecSlukemSet the environment variable
1801a04634dbSlukem.Ar var
180213b0ffecSlukemto an optional
180313b0ffecSlukem.Ar value .
180413b0ffecSlukemThis is propagated to the
1805cc95aaefSlukem.Sy \*[toolprefix]make- Ns Sy MACHINE
1806cc95aaefSlukemwrapper script.
1807a04634dbSlukem.
18084f856ef5Slukem.It Fl w Ar wrapper
180913b0ffecSlukemCreate the
1810cc95aaefSlukem.Sy \*[toolprefix]make- Ns Sy MACHINE
181113b0ffecSlukemwrapper script (see below) in a custom location,
18124f856ef5Slukemspecified by
18134f856ef5Slukem.Ar wrapper .
1814cc95aaefSlukemThis allows, for instance, to place the wrapper script in
18156aba6b16Slukem.Ev PATH
181667990135Swizautomatically.
1817f26a4cc9Slukem.Pp
1818f26a4cc9Slukem.Em Note :
18194f856ef5Slukem.Ar wrapper
18204f856ef5Slukemis the full name of the file, not just a directory name.
182124f8b531SapbIf a relative path is specified, it will be converted to an
182224f8b531Sapbabsolute path before being used.
18234f856ef5Slukem.
1824e26864a9Slukem.It Fl X Ar x11src
1825e26864a9SlukemSet the value of
1826e26864a9Slukem.Sy X11SRCDIR
1827e26864a9Slukemto
1828e26864a9Slukem.Ar x11src .
182924f8b531SapbIf a relative path is specified, it will be converted to an
183024f8b531Sapbabsolute path before being used.
1831e26864a9Slukem.
1832e26864a9Slukem.It Fl x
1833e26864a9SlukemSet
1834e26864a9Slukem.Sy MKX11=yes .
1835e26864a9Slukem.
183613b0ffecSlukem.It Fl Z Ar var
183713b0ffecSlukemUnset ("zap") the environment variable
183813b0ffecSlukem.Ar var .
183913b0ffecSlukemThis is propagated to the
1840cc95aaefSlukem.Sy \*[toolprefix]make- Ns Sy MACHINE
1841cc95aaefSlukemwrapper script.
184213b0ffecSlukem.
18439d6c4a26Slukem.It Fl ?
18449d6c4a26SlukemShow a help message, and exit.
18459d6c4a26Slukem.
1846d7d0f414Slukem.El
1847d7d0f414Slukem.
1848a9756fb6Slukem.Ss The \*[toolprefix]make-MACHINE wrapper script
1849d7d0f414Slukem.
1850d7d0f414SlukemIf using the
1851d7d0f414Slukem.Sy build.sh
1852d7d0f414Slukemscript to build
1853d7d0f414Slukem.Nx ,
1854d7d0f414Slukema
18556ac63dc2Slukem.Sy \*[toolprefix]make-MACHINE
1856cc95aaefSlukemwrapper script will be created in
18570a35378dSwiz.Sy TOOLDIR Ns Pa /bin
1858d7d0f414Slukemupon the first build to assist in building subtrees on a cross-compile
1859d7d0f414Slukemhost.
1860d7d0f414Slukem.Pp
1861cc95aaefSlukemThe
18626ac63dc2Slukem.Sy \*[toolprefix]make-MACHINE
1863cc95aaefSlukemwrapper script can be invoked in lieu of
1864d7d0f414Slukem.Xr make 1 ,
1865d7d0f414Slukemand will instead call the up-to-date version of
18666ac63dc2Slukem.Dq \*[toolprefix]make
1867d7d0f414Slukeminstalled into
18680a35378dSwiz.Sy TOOLDIR Ns Pa /bin
1869d7d0f414Slukemwith several key variables pre-set, including
1870d7d0f414Slukem.Sy MACHINE , MACHINE_ARCH ,
1871d7d0f414Slukemand
1872d7d0f414Slukem.Sy TOOLDIR .
1873000424deSdholland.Sy \*[toolprefix]make-MACHINE
187413b0ffecSlukemwill also set variables specified with
187513b0ffecSlukem.Fl V ,
187613b0ffecSlukemand unset variables specified with
187713b0ffecSlukem.Fl Z .
1878cc95aaefSlukemNote that by default these variables will not override
1879cc95aaefSlukem.Xr mk.conf 5 ;
1880cc95aaefSlukemsee
1881a9756fb6Slukem.Sx make variables
1882cc95aaefSlukemfor more details.
188313b0ffecSlukem.Pp
1884cc95aaefSlukemThis wrapper script can be symlinked into a directory listed in
18856aba6b16Slukem.Ev PATH ,
1886d7d0f414Slukemor called with an absolute path.
1887d7d0f414Slukem.
1888da7aeb45Slukem.Sh EXAMPLES
188946d44d89Slukem.
1890a2553ebbSlukem.Bl -enum
189131b7057fSlukem.
1892a2553ebbSlukem.It
1893f26a4cc9Slukem.Li "% ./build.sh [OPTIONS] tools kernel=GENERIC"
1894a2553ebbSlukem.Pp
1895da7aeb45SlukemBuild a new toolchain, and use the new toolchain to
1896da7aeb45Slukemconfigure and build a new GENERIC kernel.
189731b7057fSlukem.
1898a2553ebbSlukem.It
1899f26a4cc9Slukem.Li "% ./build.sh [OPTIONS] -U distribution"
1900a2553ebbSlukem.Pp
1901da7aeb45SlukemUsing unprivileged mode,
1902ca2937cfSlukembuild a complete distribution to a
1903ca2937cfSlukem.Sy DESTDIR
1904ca2937cfSlukemdirectory that
1905ca2937cfSlukem.Sy build.sh
19069d6c4a26Slukemselects (and will show).
190731b7057fSlukem.
1908a2553ebbSlukem.It
1909f26a4cc9Slukem.Li "# ./build.sh [OPTIONS] -U install=/"
1910a2553ebbSlukem.Pp
1911d27e8bf3SlukemAs root, install to
1912d27e8bf3Slukem.Pa /
1913d27e8bf3Slukemthe distribution that was built
1914d27e8bf3Slukemby example 2.
1915a2553ebbSlukemEven though this is run as root,
191631b7057fSlukem.Fl U
191731b7057fSlukemis required so that the permissions stored in
1918ca2937cfSlukem.Sy DESTDIR Ns Pa /METALOG
191931b7057fSlukemare correctly applied to the files as they're copied to
1920a2553ebbSlukem.Pa / .
192131b7057fSlukem.
1922a2553ebbSlukem.It
1923f26a4cc9Slukem.Li "% ./build.sh [OPTIONS] -U -u release"
1924a2553ebbSlukem.Pp
1925da7aeb45SlukemUsing unprivileged mode,
1926ca2937cfSlukembuild a complete release to
1927ca2937cfSlukem.Sy DESTDIR
1928ca2937cfSlukemand
1929ca2937cfSlukem.Sy RELEASEDIR
1930ca2937cfSlukemdirectories that
1931ca2937cfSlukem.Sy build.sh
19329d6c4a26Slukemselects (and will show).
19336d22656bSlukem.Sy MKUPDATE=yes
1934a2553ebbSlukem.Pq Fl u
1935a2553ebbSlukemis set to prevent the
1936a2553ebbSlukem.Dq make cleandir ,
1937a2553ebbSlukemso that if this is run after example 2, it doesn't need to redo that
1938a2553ebbSlukemportion of the release build.
1939da7aeb45Slukem.El
1940da7aeb45Slukem.
1941d7d0f414Slukem.Sh SEE ALSO
1942f26a4cc9Slukem.Xr config 1 ,
1943f26a4cc9Slukem.Xr ctags 1 ,
1944f26a4cc9Slukem.Xr ex 1 ,
1945f26a4cc9Slukem.Xr gzip 1 ,
1946f26a4cc9Slukem.Xr lint 1 ,
1947d7d0f414Slukem.Xr make 1 ,
19486aba6b16Slukem.Xr mandoc 1 ,
1949f26a4cc9Slukem.Xr mkisofs 1 ,
19506aba6b16Slukem.Xr nroff 1 ,
1951f26a4cc9Slukem.Xr vi 1 ,
1952105457a1Slukem.Xr mk.conf 5 ,
1953f26a4cc9Slukem.Xr atf 7 ,
1954d7d0f414Slukem.Xr hier 7 ,
19556aba6b16Slukem.Xr mdoc 7 ,
195621078fc3Sapb.Xr release 7 ,
1957a5aed269Sapb.Xr etcupdate 8 ,
1958b9abc1c5Slukem.Xr installboot 8 ,
195923c02a69Slukem.Xr mount 8 ,
1960a5aed269Sapb.Xr postinstall 8 ,
1961110a6128Sapb.Xr sysinst 8 ,
196237bd5c7dSapb.Pa pkgsrc/sysutils/cdrtools
19636aba6b16Slukem.Pp
19646aba6b16Slukem.Em Note :
19656aba6b16SlukemThe
19666aba6b16Slukem.Nx
19676aba6b16Slukemmanual pages are also available at
19686aba6b16Slukem.Lk https://man.netbsd.org
1969d7d0f414Slukem.
1970d7d0f414Slukem.Sh HISTORY
1971d7d0f414Slukem.
1972d7d0f414SlukemThe
19733cb563b3Slukem.Sy build.sh
1974d7d0f414Slukembased build scheme was introduced for
1975d7d0f414Slukem.Nx 1.6
1976d7d0f414Slukemas
1977d7d0f414Slukem.Sy USE_NEW_TOOLCHAIN ,
1978d7d0f414Slukemand re-worked to
1979d7d0f414Slukem.Sy TOOLCHAIN_MISSING
1980d7d0f414Slukemafter that.
1981c170baaeSapb.
1982c170baaeSapb.Sh CAVEATS
1983c170baaeSapb.
1984c170baaeSapbAfter significant updates to third-party components in the source
1985c170baaeSapbtree, the
1986c170baaeSapb.Dq make cleandir
1987c170baaeSapboperation may be insufficient to clean out old files in object
1988c170baaeSapbdirectories.
1989c170baaeSapbInstead, one may have to manually remove the files.
1990c170baaeSapbConsult the
1991c170baaeSapb.Pa UPDATING
1992c170baaeSapbfile for notices concerning this.
1993