1 .\" $NetBSD: BUILDING.mdoc,v 1.79 2009/10/02 07:43:01 cegger Exp $
3 .\" Copyright (c) 2001-2008 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Todd Vierling and Luke Mewburn.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
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.
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.
30 .\" NOTE: After changing this file, run "make build-docs" to generate the
31 .\" proper plaintext versions, and check in all BUILDING.* files!
33 .\" Toolchain prefix for commands
43 .Nd Procedure for building
50 is designed to be buildable on most POSIX-compliant host systems.
51 The basic build procedure is the same whether compiling
57 (on another architecture or OS).
59 This source tree contains a special subtree,
61 which uses the host system to create a build toolchain for the target
63 The host system must have at least C and C++
64 compilers in order to create the toolchain
66 is not required); all other tools are created as part of the
69 (See the environment variables section below if you need
70 to override or manually select your compilers.)
74 .Ss Source tree layout
76 .Bl -tag -width "BUILDING.mdoc"
77 .It Sy doc/BUILDING.mdoc
78 This document (in -mdoc troff format; the original copy).
80 This document (in plaintext).
81 .It Sy tools/compat/README
82 Special notes for cross-hosting a NetBSD build on non-NetBSD platforms.
86 should only be run for native builds with an appropriately up-to-date
90 (For building from out-of-date systems or on a non-native host, see the
94 Special notes for updating from an earlier revision of
96 It is important to read this file before every build of an updated
99 Bourne-compatible shell script used for building the host build tools
103 Can be used for both native and cross builds, and should be used instead of
105 for any source tree that is updated and recompiled regularly.
106 .It Sy crypto/dist/ , dist/ , gnu/dist/
107 Sources imported verbatim from third parties, without mangling the
108 existing build structure.
109 Other source trees in
117 Makefile semantics when building these programs for a native host.
118 .It Sy distrib/ , etc/
119 Sources for items used when making a full release snapshot, such as
121 .Sy DESTDIR Ns Pa /etc
122 on the destination system, boot media, and release notes.
123 .It Sy tests/ , regress/
124 Regression test harness.
125 Can be cross-compiled, but only run natively.
131 contains older tests that have not yet been migrated to
138 build structure for the host build tools.
139 This has a special method of determining out-of-date status.
140 .It Sy bin/ ... usr.sbin/
143 userland (non-kernel) programs.
144 If any of these directories are missing, they will be skipped during the build.
147 build structure for X11R6; the source is in
151 .Ss Build tree layout
155 build tree is described in
157 and the release layout is described in
163 .Ss Environment variables
165 Several environment variables control the behaviour of
169 .Bl -tag -width "MAKEOBJDIRPREFIX"
173 Path name to a POSIX-compliant shell.
174 If this is not set explicitly, then the default is set
175 using heuristics dependent on the host platform,
176 or from the shell under which
178 is executed (if that can be determined),
179 or using the first copy of
185 is not POSIX-compliant, we suggest that you build using
187 .Bd -unfilled -offset indent
188 .Li HOST_SH= Ns Va /path/to/working/shell
190 .Li ${HOST_SH} build.sh Op Ar options
194 Path name to C compiler used to create the toolchain.
197 Path name to C++ compiler used to create the toolchain.
204 Machine architecture, e.g.,
218 Directory to use as the
220 for the current directory.
221 The value is subjected to variable expansion by
223 Typical usage is to set this variable to a value involving the use of
226 .Sq ${.CURDIR:C...} ,
227 to derive the value of
235 can be provided only in the environment or via the
239 it cannot usefully be set inside a Makefile, including
244 .It Sy MAKEOBJDIRPREFIX
245 Top level directory of the object directory tree.
246 The value is subjected to variable expansion by
251 directory if necessary, but if
257 will abort the build if the
259 directory does not exist.
260 If the value is defined and valid, then
261 ${MAKEOBJDIRPREFIX}/${.CURDIR}
264 for the current directory.
265 The current directory may be read only.
267 can be provided only in the environment or via the
271 it cannot usefully be set inside a Makefile, including
278 .Ss \*qmake\*q variables
302 Several variables control the behavior of
305 Unless otherwise specified, these variables may be set in
306 either the process environment or the
308 configuration file specified by
311 .Bl -tag -width "MKCATPAGES"
314 Identifier for the build.
315 The identifier will be appended to
316 object directory names, and can be consulted in the
318 configuration file in order to set additional build parameters,
319 such as compiler flags.
322 GCC uses random numbers when compiling C++ code.
323 This variable seeds the gcc random number generator using
324 the -frandom-seed flag with this value.
325 By default, it is set to NetBSD-(majorversion).
326 Using a fixed value causes C++ binaries to be the same when
327 built from the same sources, resulting in identical (reproducible) builds.
328 Additional information is available in the GCC
329 documentation of -frandom-seed.
332 Directory to contain the built
335 If set, special options are passed to the compilation tools to
336 prevent their default use of the host system's
337 .Sy /usr/include , /usr/lib ,
339 This pathname must be an absolute path, and should
344 (For installation into the system's root directory, set
346 to an empty string, not to
348 The directory must reside on a file system which supports long file
349 names and hard links.
359 will provide a default of
360 .Pa destdir. Ns Sy MACHINE
371 .Em Only settable in the process environment.
376 Level of verbosity of status messages.
380 No descriptive messages or commands executed by
384 Brief messages are shown describing what is being done,
385 but the actual commands executed by
389 Descriptive messages are shown as above (prefixed with a
391 and ordinary commands performed by
395 In addition to the above, all commands performed by
397 are displayed, even if they would ordinarily have been hidden
400 prefix in the relevant makefile.
402 In addition to the above, commands executed by
404 are traced through use of the
414 Indicates whether preformatted plaintext manual pages will be created
420 Indicates whether cryptographic code will be included in a build;
421 provided for the benefit of countries that do not allow strong
423 Will not affect use of the standard low-security password encryption system,
429 Indicates whether system documentation destined for
430 .Sy DESTDIR Ns Pa /usr/share/doc
431 will be installed during a build.
436 Indicates whether preformatted HTML manual pages will be built
444 then for programs intended to be run on the compile host,
445 the name, release, and architecture of the host operating system
446 will be suffixed to the name of the object directory created by
448 (This allows multiple host systems to compile NetBSD for a single target.)
451 then programs built to be run on the compile host will use the same
452 object directory names as programs built to be run on the target.
457 Indicates whether GNU Info files, used for the documentation for
458 most of the compilation tools, will be created and installed during a
466 will be run against portions of the
468 source code during the build, and whether lint libraries will be
470 .Sy DESTDIR Ns Pa /usr/libdata/lint .
475 Indicates whether manual pages will be installed during a build.
480 Indicates whether Native Language System locale zone files will be
481 compiled and installed during a build.
486 Indicates whether object directories will be created when running
490 then all built files will be located inside the regular source tree.
497 is not recommended and may cause problems when updating the tree with
502 Indicates whether shared objects and libraries will be created and
503 installed during a build.
506 the entire built system will be statically linked.
509 As of this writing, all platforms except
516 Indicates whether the
520 used to generate shared libraries, are installed during a build.
525 Indicates whether profiled libraries
527 will be built and installed during a build.
530 however, some platforms turn off
532 by default at times due to toolchain problems with profiled code.
536 Indicates whether files destined to reside in
537 .Sy DESTDIR Ns Pa /usr/share
538 will be built and installed during a build.
542 .Sy MKCATPAGES , MKDOC , MKINFO , MKMAN ,
552 Indicates whether program binaries and shared libraries should be built
553 to include RCS IDs for use with
559 For X builds, decides if subpixel rendering code in FreeType
561 Turned off by default because of patent issues.
566 For X builds, decides if the TrueType bytecode interpreter
569 .Pa http://www.freetype.org/patents.html
575 Indicates whether an unprivileged install will occur.
576 The user, group, permissions, and file flags, will not be set on
577 the installed items; instead the information will be appended to
584 are used during the generation of the distribution tar files to ensure
585 that the appropriate file ownership is stored.
590 Indicates whether all install operations intended to write to
592 will compare file timestamps before installing, and skip the install
593 phase if the destination files are up-to-date.
594 This also has implications on full builds (see next subsection).
599 Indicates whether X11 is built from
604 Directory to hold the host tools, once built.
605 If specified, must be an absolute path.
606 This directory should be unique to a given host system and
609 (However, multiple targets may share the same
611 the target-dependent files have unique names.) If unset, a default based
614 information of the host platform will be created in the
621 Indicates whether the tools specified by
623 should be used as part of a build in progress.
627 .Bl -tag -width "never"
632 Do not use the tools from
634 but refuse to build native compilation tool components that are
635 version-specific for that tool.
637 Do not use the tools from
639 even when building native tool components.
640 This is similar to the traditional
642 build method, but does
644 verify that the compilation tools in use are up-to-date enough in order
645 to build the tree successfully.
646 This may cause build or runtime problems when building the whole
653 .Sy TOOLCHAIN_MISSING
667 Directory containing the X11R6 source.
668 If specified, must be an absolute path.
669 The main X11R6 source is found in
670 .Sy X11SRCDIR Ns Pa /xfree/xc .
672 .Sy NETBSDRCDIR Ns Pa /../xsrc ,
673 if that exists; otherwise
677 The style of X11 cross-built, set to either
683 on amd64, i386, macppc, shark and sparc64 platforms,
689 .Ss \*qmake\*q variables for full builds
690 These variables only affect the top level
692 and do not affect manually building subtrees of the
696 .Bl -tag -width "INSTALLWORLDDIR"
698 .It Sy INSTALLWORLDDIR
700 .Dq make installworld
701 target to install to.
702 If specified, must be an absolute path.
708 Indicates whether object directories will be created automatically
711 pass) at the start of a build.
718 This may be set back to
728 If set, then in addition to the effects described for
730 above, this implies the effects of
739 this may be set by giving the
756 phase of a full build.
757 This has the effect of allowing only changed
758 files in a source tree to be recompiled.
759 This can speed up builds when updating only a few files in the tree.
767 .Dq make distrib-dirs
768 phase of a full build.
773 useful on systems where building as an unprivileged user, or where it is
774 known that the system-wide mtree files have not changed.
780 phase of a full build.
781 This has the effect of preventing
783 from thinking that some programs are out-of-date simply because the
784 system include files have changed.
785 However, this option should not be used when updating the entire
787 source tree arbitrarily; it is suggested to use
789 instead in that case.
793 If set, specifies the directory to which a
795 layout will be written at the end of a
797 If specified, must be an absolute path.
802 will provide a default of
814 .Ss \*qmake\*q command line options
815 This is not a summary of all the options available to
817 only the options used most frequently with
819 builds are listed here.
821 .Bl -tag -width "var=value"
828 Makefiles should use .WAIT or have explicit dependencies
829 as necessary to enforce build ordering.
832 Specify the default directory for searching for system Makefile
836 When building any full
838 source tree, this should be set to the
840 directory in the source tree.
841 This is set automatically when building from the top level, or when using
845 Display the commands that would have been executed, but do not
846 actually execute them.
847 This will still cause recursion to take place.
854 Does not build any targets.
861 overriding any setting specified by the process environment, the
863 configuration file, or the system Makefile segments.
867 .Ss \*qmake\*q targets
869 These default targets may be built by running
871 in any subtree of the
874 It is recommended that none of these be used from the top
875 level Makefile; as a specific exception,
879 are useful in that context.
881 .Bl -tag -width "dependall"
884 Build programs, libraries, and preformatted documentation.
887 Remove program and library object code files.
892 but also remove preformatted documentation, dependency files generated
895 and any other files known to be created at build time.
898 Create dependency files
900 containing more detailed information about the dependencies of source
901 code on header files.
902 Allows programs to be recompiled automatically when a dependency changes.
907 immediately followed by a
909 This improves cache locality of the build since both passes read the source
910 files in their entirety.
917 Build and install system header files.
918 Typically needed before any system libraries or programs can be built.
921 Install programs, libraries, and documentation into
923 Few files will be installed to
924 .Sy DESTDIR Ns Pa /dev ,
925 .Sy DESTDIR Ns Pa /etc ,
926 .Sy DESTDIR Ns Pa /root
928 .Sy DESTDIR Ns Pa /var
929 in order to prevent user supplied configuration data from being overwritten.
933 against the C source code, where appropriate, and generate
934 system-installed lint libraries.
937 Create object directories to be used for built files, instead of
938 building directly in the source tree.
943 searchable function lists usable by the
951 .Ss \*qmake\*q targets for the top level
955 targets are usable specifically from the top source level to facilitate
960 .Bl -tag -width "distribution"
965 system (except the kernel).
966 This orders portions of the source tree such that prerequisites
967 will be built in the proper order.
972 and then install a full distribution (which does not include a kernel) into
975 .Sy DESTDIR Ns Pa /dev ,
976 .Sy DESTDIR Ns Pa /etc ,
977 .Sy DESTDIR Ns Pa /root
979 .Sy DESTDIR Ns Pa /var .
983 .Dq make distribution ,
984 except that it ensures that
986 is not the root directory.
989 Install the distribution from
992 .Sy INSTALLWORLDDIR ,
993 which defaults to the root directory.
996 is not the root directory if cross compiling.
1000 environment variable may be set to a list of
1001 distribution sets to be installed.
1002 By default, all sets except
1006 are installed, so most files in
1007 .Sy INSTALLWORLDDIR Ns Pa /etc
1008 will not be installed or modified.
1011 Before performing this operation with
1012 .Sy INSTALLWORLDDIR Ns = Ns Pa / ,
1013 it is highly recommended that you upgrade your kernel and reboot.
1014 After performing this operation,
1015 it is recommended that you use
1018 .Sy INSTALLWORLDDIR Ns Pa /etc
1021 to check for inconsistencies (and possibly to fix them).
1023 Create distribution sets from
1026 .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/sets .
1028 .Dq make distribution ,
1031 alone does not install all of the required files.
1034 Create source sets of the source tree into
1035 .Sy RELEASEDIR Ns Pa /source/sets .
1041 .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/syspkgs .
1043 .Dq make distribution ,
1046 alone does not install all of the required files.
1050 .Dq make distribution ,
1051 build kernels, distribution media, and install sets
1055 then package the system into a standard release layout as described by
1064 installation CD-ROM image in the
1065 .Sy RELEASEDIR Ns Pa /iso
1067 The CD-ROM file system will have a layout as described in
1070 For most machine types, the CD-ROM will be bootable, and will automatically
1073 menu-based installation program, which can be used to install or upgrade a
1076 Bootable CD-ROMs also contain tools that may be useful in
1083 is attempted, RELEASEDIR must be populated by
1087 Note that other, smaller, CD-ROM images may be created in the
1088 .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/cdrom
1090 .Dq "make release" .
1091 These smaller images usually contain the same tools as the larger images in
1092 .Sy RELEASEDIR Ns Pa /iso ,
1093 but do not contain additional content such as the distribution sets.
1095 Note that the mac68k port still uses an older method of creating
1099 utility, which is not part of
1101 but which can be installed from
1102 .Pa pkgsrc/sysutils/cdrtools .
1104 .It Sy iso-image-source
1107 installation CD-ROM image in the
1108 .Sy RELEASEDIR Ns Pa /iso
1110 The CD-ROM file system will have a layout as described in
1112 It will have top level directories for the machine type and source.
1114 For most machine types, the CD-ROM will be bootable, and will automatically
1117 menu-based installation program, which can be used to install or upgrade a
1120 Bootable CD-ROMs also contain tools that may be useful in
1126 .Dq make iso-image-source
1127 is attempted, RELEASEDIR must be populated by
1128 .Dq make sourcesets release
1131 Note that other, smaller, CD-ROM images may be created in the
1132 .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /installation/cdrom
1135 These smaller images usually contain the same tools as the larger images in
1136 .Sy RELEASEDIR Ns Pa /iso ,
1137 but do not contain additional content such as the distribution sets.
1139 Note that the mac68k port still uses an older method of creating
1143 utility, which is not part of
1145 but which can be installed from
1146 .Pa pkgsrc/sysutils/cdrtools .
1148 .It Sy regression-tests
1149 Can only be run after building the regression tests in the directory
1151 Runs those compiled regression tests on the local host.
1152 Note that most tests are now managed instead using
1154 this target should probably run those as well but currently does not.
1158 .Ss The \*qbuild.sh\*q script
1160 This script file is a Bourne shell script designed to build the
1163 system on any host with a Bourne shell in
1165 including many that are not POSIX compliant.
1166 Note that if a host system's
1168 is unusually old and broken, the Korn Shell
1170 if available, may be a usable alternative.
1172 All cross-compile builds, and most native builds, of the entire system
1175 rather than just running
1179 program will be bootstrapped properly, in case the host system has an
1180 older or incompatible
1184 When compiling the entire system via
1188 variables are set for you in order to help encapsulate the build
1190 In the list of options below, variables that are automatically set by
1192 are noted where applicable.
1195 The following operations are supported by
1198 .Bl -tag -width "distribution"
1201 Build the system as per
1203 Before the main part of the build commences, this command runs the
1205 operation (unless the
1217 Build a full distribution as per
1218 .Dq make distribution .
1219 This command first runs the
1224 Build a full release as per
1226 This command first runs the
1232 .Sy \*[toolprefix]make-MACHINE
1234 This operation is automatically performed for any of the other
1246 Build and install the host tools from
1248 This command will first run
1254 subdirectory unless the
1258 options (respectively) are given.
1260 .It Sy install Ns = Ns Ar idir
1261 Install the contents of
1266 .Dq make installworld .
1267 Note that files that are part of the
1271 sets will not be installed.
1273 .It Sy kernel Ns = Ns Ar kconf
1277 argument is the name of a configuration file suitable
1282 does not contain any
1284 characters, the configuration file is expected to be found in the
1286 directory, which is typically
1287 .Sy sys/arch/MACHINE/conf .
1288 The new kernel will be built in a subdirectory of
1291 .Sy sys/arch/MACHINE/compile
1292 or an associated object directory.
1300 command first unless it is
1302 that the tools already exist and are up to date.
1304 This command will run
1306 on the kernel in question first unless the
1311 This command will build kernel modules and install them into
1314 .It Sy releasekernel Ns = Ns Ar kconf
1317 copy of the kernel previously built by
1318 .Sy kernel Ns = Ns Ar kconf
1320 .Sy RELEASEDIR/RELEASEMACHINEDIR Ns Pa /binary/kernel ,
1322 .Pa netbsd- Ns Ar kconf Ns Pa .gz ,
1325 prefix is determined from the
1336 .Dq make sourcesets .
1344 .Dq make iso-image .
1346 .It Sy iso-image-source
1348 .Dq make iso-image-source .
1353 The following command line options alter the behaviour of the
1355 operations described above:
1357 .Bl -tag -width "-T tools"
1370 This will also append the build identifier to the name of the
1372 wrapper script so that the resulting name is of the form
1373 .Dq Sy \*[toolprefix]make-MACHINE-BUILDID .
1375 .It Fl C Ar cdextras
1381 which is a space-separated list of files or directories that will be
1382 added to the CD-ROM image that may be create by the
1385 .Dq iso-image-source
1387 Files will be added to the root of the CD-ROM image, whereas directories
1388 will be copied recursively.
1389 If relative paths are specified, they will be converted to
1390 absolute paths before being used.
1391 Multiple paths may be specified via multiple
1393 options, or via a single option whose argument contains multiple
1394 space-separated paths.
1401 If a relative path is specified, it will be converted to an
1402 absolute path before being used.
1408 This overrides various sanity checks, and allows:
1410 does not have to be set to a non-root path for builds,
1413 does not have to be set when building as a non-root user.
1416 It is highly recommended that you know what you are doing when
1417 you use this option.
1420 Print a help message.
1426 subjobs in parallel;
1429 If you see failures for reasons other than running out of memory
1434 please save complete build logs
1435 so the failures can be analyzed.
1437 To achieve the fastest builds,
1439 values between (1 + the number of CPUs) and (2 * the number of CPUs)
1441 Use lower values on machines with limited memory or I/O bandwidth.
1445 .Sy MAKEOBJDIRPREFIX
1452 for more information.
1454 For instance, if the source directory is
1457 .Dq Fl M Pa /usr/obj
1458 will place build-time files under
1459 .Pa /usr/obj/usr/src/bin ,
1460 .Pa /usr/obj/usr/src/lib ,
1461 .Pa /usr/obj/usr/src/usr.bin ,
1464 If a relative path is specified, it will be converted to an
1465 absolute path before being used.
1467 imposes the restriction that the argument to the
1469 option must not begin with a
1472 character; otherwise it would be too difficult
1473 to determine whether the value is an absolute or a relative path.
1474 If the directory does not already exist,
1483 except in some special cases listed below.
1484 This will also override any value of
1486 in the process environment with a value deduced from
1491 All cross builds require
1493 but if unset on a NetBSD host, the host's value of MACHINE will be
1494 detected and used automatically.
1496 Some machines support multiple values for
1498 The following special cases for the
1500 argument are defined to set the listed values of
1504 .Bl -column "evbmips-el" "MACHINE" "MACHINE_ARCH" -offset indent
1505 .It Sy mach Ta Sy "MACHINE" Ta Sy "MACHINE_ARCH"
1506 .It evbarm Ta evbarm Ta (not set)
1507 .It evbarm-eb Ta evbarm Ta armeb
1508 .It evbarm-el Ta evbarm Ta arm
1509 .It evbmips Ta evbmips Ta (not set)
1510 .It evbmips-eb Ta evbmips Ta mipseb
1511 .It evbmips-el Ta evbmips Ta mipsel
1512 .It evbsh3 Ta evbsh3 Ta (not set)
1513 .It evbsh3-eb Ta evbsh3 Ta sh3eb
1514 .It evbsh3-el Ta evbsh3 Ta sh3el
1515 .It sbmips Ta sbmips Ta (not set)
1516 .It sbmips-eb Ta sbmips Ta mipseb
1517 .It sbmips-el Ta sbmips Ta mipsel
1520 .It Fl N Ar noiselevel
1523 level of the build, by setting
1529 Show the commands that would be executed by
1531 but do not make any changes.
1532 This is similar in concept to
1536 Create an appropriate transform macro for
1538 that will place the built object files under
1541 .Sy MAKEOBJDIRPREFIX .
1543 For instance, a setting of
1544 .Dq Fl O Pa /usr/obj
1545 will place build-time files under
1548 .Pa /usr/obj/usr.bin ,
1551 If a relative path is specified, it will be converted to an
1552 absolute path before being used.
1554 imposes the restriction that the argument to the
1556 option must not contain a
1560 If the directory does not already exist,
1564 In normal use, exactly one of the
1568 options should be specified.
1573 is specified, then a default object directory will be chosen
1574 according to rules in
1576 Relying on this default is not recommended because
1577 it is determined by complex rules that are influenced
1578 by the values of several variables and
1579 by the location of the source directory.
1585 Otherwise, it will be automatically set to
1587 This default is opposite to the behaviour when not using
1595 If a relative path is specified, it will be converted to an
1596 absolute path before being used.
1599 Remove the contents of
1603 before building (provides a clean starting point).
1604 This will skip deleting
1606 if building on a native system to the root directory.
1613 This should rarely be necessary.
1620 If a relative path is specified, it will be converted to an
1621 absolute path before being used.
1622 If set, the bootstrap
1624 will only be rebuilt if the source files for
1630 .Sy MKUNPRIVED=yes .
1644 Set the environment variable
1648 This is propagated to the
1649 .Sy \*[toolprefix]make
1654 .Sy \*[toolprefix]make
1655 wrapper script (see below) in a custom location,
1658 This allows, for instance, to place the wrapper in
1663 is the full name of the file, not just a directory name.
1664 If a relative path is specified, it will be converted to an
1665 absolute path before being used.
1672 If a relative path is specified, it will be converted to an
1673 absolute path before being used.
1680 Unset ("zap") the environment variable
1682 This is propagated to the
1683 .Sy \*[toolprefix]make
1688 .Ss The \*q\*[toolprefix]make-MACHINE\*q wrapper script
1695 .Sy \*[toolprefix]make-MACHINE
1696 script will be created in
1698 upon the first build to assist in building subtrees on a cross-compile
1701 .Sy \*[toolprefix]make-MACHINE
1702 can be invoked in lieu of
1704 and will instead call the up-to-date version of
1705 .Dq \*[toolprefix]make
1708 with several key variables pre-set, including
1709 .Sy MACHINE , MACHINE_ARCH ,
1712 .Sy \*[toolprefix]make-MACHINE
1713 will also set variables specified with
1715 and unset variables specified with
1718 This script can be symlinked into a directory listed in
1720 or called with an absolute path.
1727 .Li "% ./build.sh [options] tools kernel=GENERIC"
1729 Build a new toolchain, and use the new toolchain to
1730 configure and build a new GENERIC kernel.
1733 .Li "% ./build.sh [options] -U distribution"
1735 Using unprivileged mode,
1736 build a complete distribution to a
1740 selects (and will display).
1743 .Li "# ./build.sh [options] -U install=/"
1747 the distribution that was built
1749 Even though this is run as root,
1751 is required so that the permissions stored in
1752 .Sy DESTDIR Ns Pa /METALOG
1753 are correctly applied to the files as they're copied to
1757 .Li "% ./build.sh [options] -U -u release"
1759 Using unprivileged mode,
1760 build a complete release to
1766 selects (and will display).
1769 is set to prevent the
1771 so that if this is run after example 2, it doesn't need to redo that
1772 portion of the release build.
1775 .Sh OBSOLETE VARIABLES
1777 .Bl -tag -width "NBUILDJOBS"
1786 .It Sy USE_NEW_TOOLCHAIN
1787 The new toolchain is now the default.
1789 .Sy TOOLCHAIN_MISSING=yes .
1798 .Pa pkgsrc/sysutils/cdrtools
1804 based build scheme was introduced for
1807 .Sy USE_NEW_TOOLCHAIN ,
1809 .Sy TOOLCHAIN_MISSING