Index: head/share/man/man5/make.conf.5 =================================================================== --- head/share/man/man5/make.conf.5 (revision 337620) +++ head/share/man/man5/make.conf.5 (revision 337621) @@ -1,699 +1,700 @@ .\" Copyright (c) 2000 .\" Mike W. Meyer .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd July 20, 2018 +.Dd August 11, 2018 .Dt MAKE.CONF 5 .Os .Sh NAME .Nm make.conf .Nd system build information .Sh DESCRIPTION The file .Nm contains system-wide settings that will apply to every build using .Xr make 1 and the standard .Pa sys.mk file. This is achieved as follows: .Xr make 1 processes the system makefile .Pa sys.mk before any other file by default, and .Pa sys.mk includes .Nm . .Pp The file .Nm uses the standard makefile syntax. However, .Nm should not specify any dependencies to .Xr make 1 . Instead, .Nm is to set .Xr make 1 variables that control the actions of other makefiles. .Pp The default location of .Nm is .Pa /etc/make.conf , though an alternative location can be specified in the .Xr make 1 variable .Va __MAKE_CONF . You may need to override the location of .Nm if the system-wide settings are not suitable for a particular build. For instance, setting .Va __MAKE_CONF to .Pa /dev/null effectively resets all build controls to their defaults. .Pp The primary purpose of .Nm is to control the compilation of the .Fx sources, documentation, and ported applications, which are usually found in .Pa /usr/src , .Pa /usr/doc , and .Pa /usr/ports . As a rule, the system administrator creates .Nm when the values of certain control variables need to be changed from their defaults. .Pp The system build procedures occur in four broad areas: the world, the kernel, documentation and ports. Variables set in .Nm may be applicable in one, two, or all four of these areas. In addition, control variables can be specified for a particular build via the .Fl D option of .Xr make 1 or in .Xr environ 7 . .Pp The following lists provide a name and short description for each variable you can use during the indicated builds. The values of variables flagged as .Vt bool are ignored; the variable being set at all (even to .Dq Li FALSE or .Dq Li NO ) causes it to be treated as if it were set. .Pp The following list provides a name and short description for variables that are used for all builds, or are used by the .Pa makefiles for things other than builds. .Bl -tag -width Ar .It Va ALWAYS_CHECK_MAKE .Pq Vt bool Instructs the top-level makefile in the source tree (normally .Pa /usr/src ) to always check if .Xr make 1 is up-to-date. Normally this is only done for the world and buildworld targets to handle upgrades from older versions of .Fx . .It Va CFLAGS .Pq Vt str Controls the compiler setting when compiling C code. Optimization levels other than .Fl O and .Fl O2 are not supported. .It Va CPUTYPE .Pq Vt str Controls which processor should be targeted for generated code. This controls processor-specific optimizations in certain code (currently only OpenSSL) as well as modifying the value of .Va CFLAGS and .Va COPTFLAGS to contain the appropriate optimization directive to .Xr cc 1 . The automatic setting of .Va CFLAGS may be overridden using the .Va NO_CPU_CFLAGS variable. Refer to .Pa /usr/share/examples/etc/make.conf for a list of recognized .Va CPUTYPE options. .It Va CXXFLAGS .Pq Vt str Controls the compiler settings when compiling C++ code. .Va CXXFLAGS is initially set to the value of .Va CFLAGS . If you want to add to the .Va CXXFLAGS value, use .Dq Li += instead of .Dq Li = . .It Va DTC .Pq Vt str Select the compiler for DTS (Device Tree Syntax) file. .Va DTC is initially set to the value of dtc .It Va INSTALL .Pq Vt str the default install command. To install only files for which the target differs or does not exist, use .Bd -literal -offset indent INSTALL+= -C .Ed Note that some makefiles (including those in .Pa /usr/share/mk ) may hardcode options for the supplied install command. .It Va LOCAL_DIRS .Pq Vt str List any directories that should be entered when doing make's in .Pa /usr/src in this variable. .It Va MAKE_SHELL .Pq Vt str Controls the shell used internally by .Xr make 1 to process the command scripts in makefiles. .Xr sh 1 , .Xr ksh 1 , and .Xr csh 1 all currently supported. .Pp .Dl "MAKE_SHELL?=sh" .It Va MTREE_FOLLOWS_SYMLINKS .Pq Vt str Set this to .Dq Fl L to cause .Xr mtree 8 to follow symlinks. .It Va NO_CPU_CFLAGS .Pq Vt str Setting this variable will prevent CPU specific compiler flags from being automatically added to .Va CFLAGS during compile time. .It Va NO_DOCUPDATE .Pq Vt bool Set this to not update the doc tree during .Dq Li "make update" . .It Va NO_PORTSUPDATE .Pq Vt bool Set this to not update the ports tree during .Dq Li "make update" . .It Va SVN_UPDATE .Pq Vt bool Set this to use .Xr svn 1 +or +.Xr svnlite 1 to update your .Pa src tree with .Dq Li "make update" . -Note that since a subversion client is not included in the base system, -you will need to set +Note that you can set .Va SVN to the full path of a .Xr svn 1 binary. .El .Ss "BUILDING THE KERNEL" The following list provides a name and short description for variables that are only used doing a kernel build: .Bl -tag -width Ar .It Va BOOTWAIT .Pq Vt int Controls the amount of time the kernel waits for a console keypress before booting the default kernel. The value is approximately milliseconds. Keypresses are accepted by the BIOS before booting from disk, making it possible to give custom boot parameters even when this is set to 0. .It Va COPTFLAGS .Pq Vt str Controls the compiler settings when building the kernel. Optimization levels above .Oo Fl O ( O2 , No ...\& ) Oc are not guaranteed to work. .It Va KERNCONF .Pq Vt str Controls which kernel configurations will be built by .Dq Li "${MAKE} buildkernel" and installed by .Dq Li "${MAKE} installkernel" . For example, .Bd -literal -offset indent KERNCONF=MINE DEBUG GENERIC OTHERMACHINE .Ed .Pp will build the kernels specified by the config files .Pa MINE , DEBUG , GENERIC , and .Pa OTHERMACHINE , and install the kernel specified by the config file .Pa MINE . It defaults to .Pa GENERIC . .It Va MODULES_OVERRIDE .Pq Vt str Set to a list of modules to build instead of all of them. .It Va NO_KERNELCLEAN .Pq Vt bool Set this to skip running .Dq Li "${MAKE} clean" during .Dq Li "${MAKE} buildkernel" . .It Va NO_KERNELCONFIG .Pq Vt bool Set this to skip running .Xr config 8 during .Dq Li "${MAKE} buildkernel" . .It Va NO_KERNELOBJ .Pq Vt bool Set this to skip running .Dq Li "${MAKE} obj" during .Dq Li "${MAKE} buildkernel" . .It Va NO_MODULES .Pq Vt bool Set to not build modules with the kernel. .It Va PORTS_MODULES Set this to the list of ports you wish to rebuild every time the kernel is built. .It Va WITHOUT_MODULES .Pq Vt str Set to a list of modules to exclude from the build. This provides a somewhat easier way to exclude modules you are certain you will never need than specifying .Va MODULES_OVERRIDE . This is applied .Em after .Va MODULES_OVERRIDE . .El .Ss "BUILDING THE WORLD" The following list provides a name and short description for variables that are used during the world build: .Bl -tag -width Ar .It Va BOOT_COMCONSOLE_PORT .Pq Vt str The port address to use for the console if the boot blocks have been configured to use a serial console instead of the keyboard/video card. .It Va BOOT_COMCONSOLE_SPEED .Pq Vt int The baud rate to use for the console if the boot blocks have been configured to use a serial console instead of the keyboard/video card. .It Va BOOT_PXELDR_ALWAYS_SERIAL .Pq Vt bool Compile in the code into .Xr pxeboot 8 that forces the use of a serial console. This is analogous to the .Fl h option in .Xr boot 8 blocks. .It Va BOOT_PXELDR_PROBE_KEYBOARD .Pq Vt bool Compile in the code into .Xr pxeboot 8 that probes the keyboard. If no keyboard is found, boot with the dual console configuration. This is analogous to the .Fl D option in .Xr boot 8 blocks. .It Va ENABLE_SUID_K5SU .Pq Vt bool Set this if you wish to use the ksu utility. Otherwise, it will be installed without the set-user-ID bit set. .It Va ENABLE_SUID_NEWGRP .Pq Vt bool Set this to install .Xr newgrp 1 with the set-user-ID bit set. Otherwise, .Xr newgrp 1 will not be able to change users' groups. .It Va LOADER_TFTP_SUPPORT .Pq Vt bool By default the .Xr pxeboot 8 loader retrieves the kernel via NFS. Defining this and recompiling .Pa /usr/src/stand will cause it to retrieve the kernel via TFTP. This allows .Xr pxeboot 8 to load a custom BOOTP diskless kernel yet still mount the server's .Pa / rather than load the server's kernel. .It Va LOADER_FIREWIRE_SUPPORT .Pq Vt bool Defining this and recompiling .Pa /usr/src/stand/i386 will add .Xr dcons 4 console driver to .Xr loader 8 and allow access over FireWire(IEEE1394) using .Xr dconschat 8 . Currently, only i386 and amd64 are supported. .It Va MALLOC_PRODUCTION .Pq Vt bool Set this to disable assertions and statistics gathering in .Xr malloc 3 . It also defaults the A and J runtime options to off. Disabled by default on -CURRENT. .It Va MAN_ARCH .Pq Vt str Space-delimited list of one or more MACHINE and/or MACHINE_ARCH values for which section 4 man pages will be installed. The special value .Sq all installs all available architectures. The default is the MACHINE and MACHINE_ARCH being built. .It Va MODULES_WITH_WORLD .Pq Vt bool Set to build modules with the system instead of the kernel. .It Va NO_CLEAN .Pq Vt bool Set this to disable cleaning during .Dq Li "make buildworld" . This should not be set unless you know what you are doing. .It Va NO_CLEANDIR .Pq Vt bool Set this to run .Dq Li "${MAKE} clean" instead of .Dq Li "${MAKE} cleandir" . .It Va WITH_MANCOMPRESS .Pq Vt defined Set to install manual pages compressed. .It Va WITHOUT_MANCOMPRESS .Pq Vt defined Set to install manual pages uncompressed. .It Va NO_SHARE .Pq Vt bool Set to not build in the .Pa share subdir. .It Va NO_SHARED .Pq Vt bool Set to build .Pa /bin and .Pa /sbin statically linked, this can be bad. If set, every utility that uses .Pa bsd.prog.mk will be linked statically. .It Va PPP_NO_NAT .Pq Vt bool Build .Xr ppp 8 without support for network address translation (NAT). .It Va PPP_NO_NETGRAPH .Pq Vt bool Set to build .Xr ppp 8 without support for Netgraph. .It Va PPP_NO_RADIUS .Pq Vt bool Set to build .Xr ppp 8 without support for RADIUS. .It Va PPP_NO_SUID .Pq Vt bool Set to disable the installation of .Xr ppp 8 as a set-user-ID root program. .It Va SENDMAIL_ADDITIONAL_MC .Pq Vt str Additional .Pa .mc files which should be built into .Pa .cf files at build time. The value should include the full path to the .Pa .mc file(s), e.g., .Pa /etc/mail/foo.mc , .Pa /etc/mail/bar.mc . .It Va SENDMAIL_ALIASES .Pq Vt str List of .Xr aliases 5 files to rebuild when using .Pa /etc/mail/Makefile . The default value is .Pa /etc/mail/aliases . .It Va SENDMAIL_CFLAGS .Pq Vt str Flags to pass to the compile command when building .Xr sendmail 8 . The .Va SENDMAIL_* flags can be used to provide SASL support with setting such as: .Bd -literal -offset indent SENDMAIL_CFLAGS=-I/usr/local/include -DSASL SENDMAIL_LDFLAGS=-L/usr/local/lib SENDMAIL_LDADD=-lsasl .Ed .It Va SENDMAIL_CF_DIR .Pq Vt str Override the default location for the .Xr m4 1 configuration files used to build a .Pa .cf file from a .Pa .mc file. .It Va SENDMAIL_DPADD .Pq Vt str Extra dependencies to add when building .Xr sendmail 8 . .It Va SENDMAIL_LDADD .Pq Vt str Flags to add to the end of the .Xr ld 1 command when building .Xr sendmail 8 . .It Va SENDMAIL_LDFLAGS .Pq Vt str Flags to pass to the .Xr ld 1 command when building .Xr sendmail 8 . .It Va SENDMAIL_M4_FLAGS .Pq Vt str Flags passed to .Xr m4 1 when building a .Pa .cf file from a .Pa .mc file. .It Va SENDMAIL_MAP_PERMS .Pq Vt str Mode to use when generating alias and map database files using .Pa /etc/mail/Makefile . The default value is 0640. .It Va SENDMAIL_MAP_SRC .Pq Vt str Additional maps to rebuild when using .Pa /etc/mail/Makefile . The .Pa access , .Pa bitdomain , .Pa domaintable , .Pa genericstable , .Pa mailertable , .Pa uucpdomain , and .Pa virtusertable maps are always rebuilt if they exist. .It Va SENDMAIL_MAP_TYPE .Pq Vt str Database map type to use when generating map database files using .Pa /etc/mail/Makefile . The default value is hash. The alternative is btree. .It Va SENDMAIL_MC .Pq Vt str The default .Xr m4 1 configuration file to use at install time. The value should include the full path to the .Pa .mc file, e.g., .Pa /etc/mail/myconfig.mc . Use with caution as a make install will overwrite any existing .Pa /etc/mail/sendmail.cf . Note that .Va SENDMAIL_CF is now deprecated. .It Va SENDMAIL_SET_USER_ID .Pq Vt bool If set, install .Xr sendmail 8 as a set-user-ID root binary instead of a set-group-ID binary and do not install .Pa /etc/mail/submit.{cf,mc} . Use of this flag is not recommended and the alternative advice in .Pa /etc/mail/README should be followed instead if at all possible. .It Va SENDMAIL_START_SCRIPT .Pq Vt str The script used by .Pa /etc/mail/Makefile to start, stop, and restart .Xr sendmail 8 . The default value is .Pa /etc/rc.sendmail . This value should match the .Dq Li mta_start_script setting in .Xr rc.conf 5 . .It Va SENDMAIL_SUBMIT_MC .Pq Vt str The default .Xr m4 1 configuration file for mail submission to use at install time. The value should include the full path to the .Pa .mc file, e.g., .Pa /etc/mail/mysubmit.mc . Use with caution as a make install will overwrite any existing .Pa /etc/mail/submit.cf . .It Va TOP_TABLE_SIZE .Pq Vt int .Xr top 1 uses a hash table for the user names. The size of this hash can be tuned to match the number of local users. The table size should be a prime number approximately twice as large as the number of lines in .Pa /etc/passwd . The default number is 20011. .It Va WANT_FORCE_OPTIMIZATION_DOWNGRADE .Pq Vt int Causes the system compiler to be built such that it forces high optimization levels to a lower one. .Xr cc 1 .Fl O2 and above is known to trigger known optimizer bugs at various times. The value assigned is the highest optimization value used. .El .Ss "BUILDING DOCUMENTATION" The following list provides a name and short description for variables that are used when building documentation. .Bl -tag -width ".Va PRINTERDEVICE" .It Va DISTDIR .Pq Vt str Where distfiles are kept. Normally, this is .Pa distfiles in .Va PORTSDIR . .It Va DOC_LANG .Pq Vt str The list of languages and encodings to build and install. .It Va PRINTERDEVICE .Pq Vt str The default format for system documentation, depends on your printer. This can be set to .Dq Li ascii for simple printers, or .Dq Li ps for postscript or graphics printers with a ghostscript filter, or both. .El .Ss "BUILDING PORTS" Several make variables can be set that affect the building of ports. These variables and their effects are documented in .Xr ports 7 , .Pa ${PORTSDIR}/Mk/* and the .Fx Porter's Handbook. .Sh FILES .Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact .It Pa /etc/make.conf .It Pa /usr/doc/Makefile .It Pa /usr/ports/Makefile .It Pa /usr/share/examples/etc/make.conf .It Pa /usr/share/mk/sys.mk .It Pa /usr/src/Makefile .It Pa /usr/src/Makefile.inc1 .El .Sh SEE ALSO .Xr cc 1 , .Xr install 1 , .Xr make 1 , .Xr src.conf 5 , .Xr environ 7 , .Xr ports 7 , .Xr sendmail 8 .Sh HISTORY The .Nm file appeared sometime before .Fx 4.0 . .Sh AUTHORS This manual page was written by .An Mike W. Meyer Aq Mt mwm@mired.org . .Sh CAVEATS Note, that .Ev MAKEOBJDIRPREFIX and .Ev MAKEOBJDIR are environment variables and should not be set in .Nm or as command line arguments to .Xr make 1 , but in make's environment. .Sh BUGS This manual page may occasionally be out of date with respect to the options currently available for use in .Nm . Please check the .Pa /usr/share/examples/etc/make.conf file for the latest options which are available. Index: head/share/man/man7/build.7 =================================================================== --- head/share/man/man7/build.7 (revision 337620) +++ head/share/man/man7/build.7 (revision 337621) @@ -1,804 +1,807 @@ .\" Copyright (c) 2000 .\" Mike W. Meyer .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" -.Dd December 24, 2017 +.Dd August 11, 2018 .Dt BUILD 7 .Os .Sh NAME .Nm build .Nd information on how to build the system .Sh DESCRIPTION The sources for the .Fx system and its applications are contained in three different directories, normally .Pa /usr/src , .Pa /usr/doc , and .Pa /usr/ports . These directories may be initially empty or non-existent until updated with .Xr svn 1 or +.Xr svnlite 1 +or .Xr portsnap 8 . Directory .Pa /usr/src contains the .Dq "base system" sources, which is loosely defined as the things required to rebuild the system to a useful state. Directory .Pa /usr/doc contains the source for the system documentation, excluding the manual pages. Directory .Pa /usr/ports contains a tree that provides a consistent interface for building and installing third party applications. For more information about the ports build process, see .Xr ports 7 . .Pp The .Xr make 1 command is used in each of these directories to build and install the things in that directory. Issuing the .Xr make 1 command in any directory or subdirectory of those directories has the same effect as issuing the same command in all subdirectories of that directory. With no target specified, the things in that directory are just built. .Pp A source tree is allowed to be read-only. As described in .Xr make 1 , objects are usually built in a separate object directory hierarchy specified by the environment variable .Va MAKEOBJDIRPREFIX , or under .Pa /usr/obj if variable .Va MAKEOBJDIRPREFIX is not set. The canonical object directory is described in the documentation for the .Cm buildworld target below. .Pp The build may be controlled by defining .Xr make 1 variables described in the .Sx ENVIRONMENT section below, and by the variables documented in .Xr make.conf 5 . .Pp The following list provides the names and actions for the targets supported by the build system: .Bl -tag -width ".Cm cleandepend" .It Cm analyze Run Clang static analyzer against all objects and present output on stdout. .It Cm check Run tests for a given subdirectory. The default directory used is .Pa ${.OBJDIR} , but the check directory can be changed with .Pa ${CHECKDIR} . .It Cm checkworld Run the .Fx test suite on installed world. .It Cm clean Remove any files created during the build process. .It Cm cleandepend Remove the .Pa ${.OBJDIR}/${DEPENDFILE}* files generated by prior .Dq Li "make" and .Dq Li "make depend" steps. .It Cm cleandir Remove the canonical object directory if it exists, or perform actions equivalent to .Dq Li "make clean cleandepend" if it does not. This target will also remove an .Pa obj link in .Pa ${.CURDIR} if that exists. .Pp It is advisable to run .Dq Li "make cleandir" twice: the first invocation will remove the canonical object directory and the second one will clean up .Pa ${.CURDIR} . .It Cm depend Generate a list of build dependencies in file .Pa ${.OBJDIR}/${DEPENDFILE} . Per-object dependencies are generated at build time and stored in .Pa ${.OBJDIR}/${DEPENDFILE}.${OBJ} . .It Cm install Install the results of the build to the appropriate location in the installation directory hierarchy specified in variable .Va DESTDIR . .It Cm obj Create the canonical object directory associated with the current directory. .It Cm objlink Create a symbolic link to the canonical object directory in .Pa ${.CURDIR} . .It Cm tags Generate a tags file using the program specified in the .Xr make 1 variable .Va CTAGS . The build system supports .Xr ctags 1 and .Nm "GNU Global" . .El .Pp The other supported targets under directory .Pa /usr/src are: .Bl -tag -width ".Cm distributeworld" .It Cm buildenv Spawn an interactive shell with environment variables set up for cross-building the system. The target architecture needs to be specified with .Xr make 1 variables .Va TARGET_ARCH and .Va TARGET . .Pp This target is only useful after a complete cross-toolchain including the compiler, linker, assembler, headers and libraries has been built; see the .Cm toolchain target below. .It Cm buildworld Build everything but the kernel, configure files in .Pa etc , and .Pa release . The object directory can be changed from the default .Pa /usr/obj by setting the .Pa MAKEOBJDIRPREFIX .Xr make 1 variable. The actual build location prefix used depends on the .Va WITH_UNIFIED_OBJDIR option from .Xr src.conf 5 . If enabled it is .Pa ${MAKEOBJDIRPREFIX}${.CURDIR}/${TARGET}.${TARGET_ARCH} for all builds. If disabled it is .Pa ${MAKEOBJDIRPREFIX}${.CURDIR} for native builds, and .Pa ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH}${.CURDIR} for cross builds and native builds with variable .Va CROSS_BUILD_TESTING set. .It Cm cleanworld Attempt to clean up targets built by a preceding .Cm buildworld , or similar step built from this source directory. .It Cm cleanuniverse When .Va WITH_UNIFIED_OBJDIR is enabled, attempt to clean up targets built by a preceding .Cm buildworld , .Cm universe , or similar step, for any architecture built from this source directory. .It Cm distributeworld Distribute everything compiled by a preceding .Cm buildworld step. Files are placed in the directory hierarchy specified by .Xr make 1 variable .Va DISTDIR . This target is used while building a release; see .Xr release 7 . .It Cm native-xtools This target builds a cross-toolchain for the given .Sy TARGET and .Sy TARGET_ARCH , as well as a select list of static userland tools for the host system. This is intended to be used in a jail where QEMU is used to improve performance by avoiding emulating binaries that do not need to be emulated. .Sy TARGET and .Sy TARGET_ARCH should be defined. .It Cm native-xtools-install Installs the results to .Pa ${DESTDIR}/${NXTP} where .Va NXTP defaults to .Pa nxb-bin . .Sy TARGET and .Sy TARGET_ARCH must be defined. .It Cm packageworld Archive the results of .Cm distributeworld , placing the results in .Va DISTDIR . This target is used while building a release; see .Xr release 7 . .It Cm installworld Install everything built by a preceding .Cm buildworld step into the directory hierarchy pointed to by .Xr make 1 variable .Va DESTDIR . .Pp If installing onto an NFS file system and running .Xr make 1 with the .Fl j option, make sure that .Xr rpc.lockd 8 is running on both client and server. See .Xr rc.conf 5 on how to make it start at boot time. .It Cm toolchain Create the build toolchain needed to build the rest of the system. For cross-architecture builds, this step creates a cross-toolchain. .It Cm universe For each architecture, execute a .Cm buildworld followed by a .Cm buildkernel for all kernels for that architecture, including .Pa LINT . This command takes a long time. .It Cm update Get updated sources as configured in .Xr make.conf 5 . .It Cm targets Print a list of supported .Va TARGET / .Va TARGET_ARCH pairs for world and kernel targets. .It Cm tinderbox Execute the same targets as .Cm universe . In addition print a summary of all failed targets at the end and exit with an error if there were any. .It Cm toolchains Create a build toolchain for each architecture supported by the build system. .It Cm xdev Builds and installs a cross-toolchain and sysroot for the given .Sy TARGET and .Sy TARGET_ARCH . The sysroot contains target library and headers. The target is an alias for .Cm xdev-build and .Cm xdev-install . The location of the files installed can be controlled with .Va DESTDIR . The target location in .Va DESTDIR is .Pa ${DESTDIR}/${XDTP} where .Va XDTP defaults to .Pa /usr/${XDDIR} and .Va XDDIR defaults to .Pa ${TARGET_ARCH}-freebsd . .It Cm xdev-build Builds for the .Cm xdev target. .It Cm xdev-install Installs the files for the .Cm xdev target. .It Cm xdev-links Installs autoconf-style symlinks to .Pa ${DESTDIR}/usr/bin pointing into the xdev toolchain in .Pa ${DESTDIR}/${XDTP} . .El .Pp Kernel specific build targets in .Pa /usr/src are: .Bl -tag -width ".Cm distributekernel" .It Cm buildkernel Rebuild the kernel and the kernel modules. The object directory can be changed from the default .Pa /usr/obj by setting the .Pa MAKEOBJDIRPREFIX .Xr make 1 variable. .It Cm installkernel Install the kernel and the kernel modules to directory .Pa ${DESTDIR}/boot/kernel , renaming any pre-existing directory with this name to .Pa kernel.old if it contained the currently running kernel. The target directory under .Pa ${DESTDIR} may be modified using the .Va INSTKERNNAME and .Va KODIR .Xr make 1 variables. .It Cm distributekernel Install the kernel to the directory .Pa ${DISTDIR}/kernel/boot/kernel . This target is used while building a release; see .Xr release 7 . .It Cm packagekernel Archive the results of .Cm distributekernel , placing the results in .Va DISTDIR . This target is used while building a release; see .Xr release 7 . .It Cm kernel Equivalent to .Cm buildkernel followed by .Cm installkernel .It Cm kernel-toolchain Rebuild the tools needed for kernel compilation. Use this if you did not do a .Cm buildworld first. .It Cm reinstallkernel Reinstall the kernel and the kernel modules, overwriting the contents of the target directory. As with the .Cm installkernel target, the target directory can be specified using the .Xr make 1 variable .Va INSTKERNNAME . .El .Pp Convenience targets for cleaning up the install destination directory denoted by variable .Va DESTDIR include: .Bl -tag -width ".Cm delete-old-libs" .It Cm check-old Print a list of old files and directories in the system. .It Cm delete-old Delete obsolete base system files and directories interactively. When .Li -DBATCH_DELETE_OLD_FILES is specified at the command line, the delete operation will be non-interactive. The variables .Va DESTDIR , .Va TARGET_ARCH and .Va TARGET should be set as with .Dq Li "make installworld" . .It Cm delete-old-libs Delete obsolete base system libraries interactively. This target should only be used if no third party software uses these libraries. When .Li -DBATCH_DELETE_OLD_FILES is specified at the command line, the delete operation will be non-interactive. The variables .Va DESTDIR , .Va TARGET_ARCH and .Va TARGET should be set as with .Dq Li "make installworld" . .El .Sh ENVIRONMENT Variables that influence all builds include: .Bl -tag -width ".Va MAKEOBJDIRPREFIX" .It Va DEBUG_FLAGS Defines a set of debugging flags that will be used to build all userland binaries under .Pa /usr/src . When .Va DEBUG_FLAGS is defined, the .Cm install and .Cm installworld targets install binaries from the current .Va MAKEOBJDIRPREFIX without stripping, so that debugging information is retained in the installed binaries. .It Va DESTDIR The directory hierarchy prefix where built objects will be installed. If not set, .Va DESTDIR defaults to the empty string. .It Va MAKEOBJDIRPREFIX Defines the prefix for directory names in the tree of built objects. Defaults to .Pa /usr/obj if not defined. This variable should only be set in the environment or .Pa /etc/src-env.conf and not via .Pa /etc/make.conf or .Pa /etc/src.conf or the command line. .It Va NO_WERROR If defined, compiler warnings will not cause the build to halt, even if the makefile says otherwise. .It Va WITH_CTF If defined, the build process will run the DTrace CTF conversion tools on built objects. .El .Pp Additionally, builds in .Pa /usr/src are influenced by the following .Xr make 1 variables: .Bl -tag -width ".Va SUBDIR_OVERRIDE" .It Va KERNCONF Overrides which kernel to build and install for the various kernel make targets. It defaults to .Cm GENERIC . .It Va KERNFAST If set, the build target .Cm buildkernel defaults to setting .Va NO_KERNELCLEAN , .Va NO_KERNELCONFIG , and .Va NO_KERNELOBJ . When set to a value other than .Cm 1 then .Va KERNCONF is set to the value of .Va KERNFAST . .It Va LOCAL_DIRS If set, this variable supplies a list of additional directories relative to the root of the source tree to build as part of the .Cm everything target. The directories are built in parallel with each other, and with the base system directories. Insert a .Va .WAIT directive at the beginning of the .Va LOCAL_DIRS list to ensure all base system directories are built first. .Va .WAIT may also be used as needed elsewhere within the list. .It Va LOCAL_ITOOLS If set, this variable supplies a list of additional tools that are used by the .Cm installworld and .Cm distributeworld targets. .It Va LOCAL_LIB_DIRS If set, this variable supplies a list of additional directories relative to the root of the source tree to build as part of the .Cm libraries target. The directories are built in parallel with each other, and with the base system libraries. Insert a .Va .WAIT directive at the beginning of the .Va LOCAL_DIRS list to ensure all base system libraries are built first. .Va .WAIT may also be used as needed elsewhere within the list. .It Va LOCAL_MTREE If set, this variable supplies a list of additional mtrees relative to the root of the source tree to use as part of the .Cm hierarchy target. .It Va LOCAL_TOOL_DIRS If set, this variable supplies a list of additional directories relative to the root of the source tree to build as part of the .Cm build-tools target. .It Va LOCAL_XTOOL_DIRS If set, this variable supplies a list of additional directories relative to the root of the source tree to build as part of the .Cm cross-tools target. .It Va PORTS_MODULES A list of ports with kernel modules that should be built and installed as part of the .Cm buildkernel and .Cm installkernel process. .Bd -literal -offset indent make PORTS_MODULES=emulators/kqemu-kmod kernel .Ed .It Va STRIPBIN Command to use at install time when stripping binaries. Be sure to add any additional tools required to run .Va STRIPBIN to the .Va LOCAL_ITOOLS .Xr make 1 variable before running the .Cm distributeworld or .Cm installworld targets. See .Xr install 1 for more details. .It Va SUBDIR_OVERRIDE Override the default list of sub-directories and only build the sub-directory named in this variable. If combined with .Cm buildworld then all libraries and includes, and some of the build tools will still build as well. Specifying .Cm -DNO_LIBS , and .Cm -DWORLDFAST will only build the specified directory as was done historically. When combined with .Cm buildworld it is necesarry to override .Va LOCAL_LIB_DIRS with any custom directories containing libraries. This allows building a subset of the system in the same way as .Cm buildworld does using its sysroot handling. This variable can also be useful when debugging failed builds. .Bd -literal -offset indent make some-target SUBDIR_OVERRIDE=foo/bar .Ed .It Va TARGET The target hardware platform. This is analogous to the .Dq Nm uname Fl m output. This is necessary to cross-build some target architectures. For example, cross-building for ARM64 machines requires .Va TARGET_ARCH Ns = Ns Li aarch64 and .Va TARGET Ns = Ns Li arm64 . If not set, .Va TARGET defaults to the current hardware platform, unless .Va TARGET_ARCH is also set, in which case it defaults to the appropriate value for that architecture. .It Va TARGET_ARCH The target machine processor architecture. This is analogous to the .Dq Nm uname Fl p output. Set this to cross-build for a different architecture. If not set, .Va TARGET_ARCH defaults to the current machine architecture, unless .Va TARGET is also set, in which case it defaults to the appropriate value for that platform. Typically, one only needs to set .Va TARGET . .El .Pp Builds under directory .Pa /usr/src are also influenced by defining one or more of the following symbols, using the .Fl D option of .Xr make 1 : .Bl -tag -width ".Va -DNO_KERNELCONFIG" .It Va NO_CLEANDIR If set, the build targets that clean parts of the object tree use the equivalent of .Dq make clean instead of .Dq make cleandir . .It Va NO_CLEAN If set, no object tree files are cleaned at all. This is the default when .Va WITH_META_MODE is used with .Xr filemon 4 loaded. See .Xr src.conf 5 for more details. Setting .Va NO_CLEAN implies .Va NO_KERNELCLEAN , so when .Va NO_CLEAN is set no kernel objects are cleaned either. .It Va NO_CTF If set, the build process does not run the DTrace CTF conversion tools on built objects. .It Va NO_SHARE If set, the build does not descend into the .Pa /usr/src/share subdirectory (i.e., manual pages, locale data files, timezone data files and other .Pa /usr/src/share files will not be rebuild from their sources). .It Va NO_KERNELCLEAN If set, the build process does not run .Dq make clean as part of the .Cm buildkernel target. .It Va NO_KERNELCONFIG If set, the build process does not run .Xr config 8 as part of the .Cm buildkernel target. .It Va NO_KERNELOBJ If set, the build process does not run .Dq make obj as part of the .Cm buildkernel target. .It Va NO_DOCUPDATE If set, the update process does not update the source of the .Fx documentation as part of the .Dq make update target. .It Va NO_LIBS If set, the libraries phase will be skipped. .It Va NO_OBJWALK If set, no object directories will be created. This should only be used if object directories were created in a previous build and no new directories are connected. .It Va NO_PORTSUPDATE If set, the update process does not update the Ports tree as part of the .Dq make update target. .It Va NO_WWWUPDATE If set, the update process does not update the www tree as part of the .Dq make update target. .It Va WORLDFAST If set, the build target .Cm buildworld defaults to setting .Va NO_CLEAN , .Va NO_OBJWALK , and will skip most bootstrap phases. It will only bootstrap libraries and build all of userland. This option should be used only when it is known that none of the bootstrap needs changed and that no new directories have been connected to the build. .El .Pp Builds under directory .Pa /usr/doc are influenced by the following .Xr make 1 variables: .Bl -tag -width ".Va DOC_LANG" .It Va DOC_LANG If set, restricts the documentation build to the language subdirectories specified as its content. The default action is to build documentation for all languages. .El .Pp Builds using the .Cm universe target are influenced by the following .Xr make 1 variables: .Bl -tag -width ".Va MAKE_JUST_KERNELS" .It Va JFLAG Pass the value of this variable to each .Xr make 1 invocation used to build worlds and kernels. This can be used to enable multiple jobs within a single architecture's build while still building each architecture serially. .It Va MAKE_JUST_KERNELS Only build kernels for each supported architecture. .It Va MAKE_JUST_WORLDS Only build worlds for each supported architecture. .It Va UNIVERSE_TARGET Execute the specified .Xr make 1 target for each supported architecture instead of the default action of building a world and one or more kernels. .El .Sh FILES .Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact .It Pa /usr/doc/Makefile .It Pa /usr/doc/share/mk/doc.project.mk .It Pa /usr/ports/Mk/bsd.port.mk .It Pa /usr/ports/Mk/bsd.sites.mk .It Pa /usr/share/examples/etc/make.conf .It Pa /usr/src/Makefile .It Pa /usr/src/Makefile.inc1 .El .Sh EXAMPLES For an .Dq approved method of updating your system from the latest sources, please see the .Sx COMMON ITEMS section in .Pa src/UPDATING . .Pp The following sequence of commands can be used to cross-build the system for the armv6 architecture on an amd64 host: .Bd -literal -offset indent cd /usr/src make TARGET_ARCH=armv6 buildworld buildkernel make TARGET_ARCH=armv6 DESTDIR=/clients/arm64 installworld installkernel .Ed .Sh SEE ALSO .Xr cc 1 , .Xr install 1 , .Xr make 1 , .Xr svn 1 , +.Xr svnlite 1 , .Xr make.conf 5 , .Xr src.conf 5 , .Xr arch 7 , .Xr ports 7 , .Xr release 7 , .Xr tests 7 , .Xr config 8 , .Xr mergemaster 8 , .Xr portsnap 8 , .Xr reboot 8 , .Xr shutdown 8 .Sh AUTHORS .An Mike W. Meyer Aq Mt mwm@mired.org