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