Lines Matching +full:- +full:- +full:build
2 .\" SPDX-License-Identifier: BSD-2-Clause
32 .Nm build
33 .Nd general instructions on how to build the
41 .Bl -tag -width "/usr/ports"
44 loosely defined as everything required to build the system
49 third-party software, with a consistent interface for building and
54 These directories may be initially empty or non-existent until updated
64 command is used in each of these directories to build and install the
74 A source tree is allowed to be read-only.
98 The default components included in the build are specified in the file
107 supported by the build system:
108 .Bl -tag -width ".Cm cleandepend"
122 Remove any files created during the build process.
148 Generate a list of build dependencies in file
150 Per-object dependencies are generated at build time and stored in
153 Install the results of the build to the appropriate location in the
167 The build system supports
176 .Bl -tag -width ".Cm distributeworld"
180 For cross-building the target architecture needs to be specified with
197 This can be set to a command that does something in this build environment,
198 like cross build an application.
207 Build everything but the kernel, configure files in
217 The actual build location prefix used
258 .It Cm native-xtools
259 This target builds a cross-toolchain for the given
270 .It Cm native-xtools-install
276 .Pa nxb-bin .
283 .Xr freebsd-base 7
294 ABI for the build target, for example,
304 .Xr freebsd-base 7
325 Create the build toolchain needed to build the rest of the system.
326 For cross-architecture builds, this step creates a cross-toolchain.
361 Create a build toolchain for each architecture supported by the build system.
363 Builds and installs a cross-toolchain and sysroot for the given
369 .Cm xdev-build
371 .Cm xdev-install .
385 .Pa ${TARGET_ARCH}-freebsd .
386 .It Cm update-packages
388 .Xr freebsd-base 7
394 .It Cm xdev-build
398 .It Cm xdev-install
402 .It Cm xdev-links
403 Installs autoconf-style symlinks to
409 Kernel specific build targets in
412 .Bl -tag -width ".Cm distributekernel"
424 renaming any pre-existing directory with this name to
448 .Xr freebsd-base 7
455 .It Cm kernel-toolchain
475 .Bl -tag -width ".Cm delete-old-libs"
476 .It Cm check-old
478 .It Cm check-old-libs
480 .It Cm delete-old
483 .Li -DBATCH_DELETE_OLD_FILES
485 non-interactive.
493 .It Cm delete-old-libs
498 .Li -DBATCH_DELETE_OLD_FILES
500 non-interactive.
511 .Bl -tag -width ".Va MAKEOBJDIRPREFIX"
513 Defines a set of debugging flags that will be used to build all userland
540 .Pa /etc/src-env.conf
549 If defined, compiler warnings will not cause the build to halt,
552 If defined, the build process will run the DTrace CTF conversion
561 .Bl -tag -width ".Va LOCAL_MODULES_DIR"
563 Requests use of an external toolchain to build either the world or kernel.
577 name ${MACHINE_ARCH}-gcc<major version>.
579 If set, specify an alternative name to build and install for the various
582 Overrides which kernel to build and install for the various kernel
589 Useful for stand-alone modules that depend on
602 If set, the build target
620 the root of the source tree to build as part of the
640 the root of the source tree to build as part of the
659 the root of the source tree to build as part of the
664 the root of the source tree to build as part of the
665 .Cm bootstrap-tools
669 the root of the source tree to build as part of the
670 .Cm build-tools
674 the root of the source tree to build as part of the
675 .Cm cross-tools
684 .Xr freebsd-base 7
694 .Xr pkg-create 8 .
703 .Xr freebsd-base 7
708 .Bd -literal
709 PORTS_MODULES=graphics/gpu-firmware-intel-kmod@kabylake
710 PORTS_MODULES+=graphics/drm-66-kmod
719 Defaults to the list of sub-directories of
730 The src.conf file controls the components to build.
739 .Xr src-env.conf 5 .
756 Override the default list of sub-directories and only build the
757 sub-directory named in this variable.
760 then all libraries and includes, and some of the build tools will still build
763 .Cm -DNO_LIBS ,
765 .Cm -DWORLDFAST
766 will only build the specified directory as was done historically.
776 .Bd -literal -offset indent
777 make some-target SUBDIR_OVERRIDE=foo/bar
792 This is necessary to cross-build some target architectures.
793 For example, cross-building for ARM64 machines requires
808 Set this to cross-build for a different architecture.
826 .Bl -tag -width ".Va LOADER_DEFAULT_INTERP"
840 If set, the build targets that clean parts of the object tree use the
863 If set, the build process does not run the DTrace CTF conversion tools
866 If set, the build does not descend into the
873 If set, the build process does not run
879 If set, the build process does not run
885 If set, the build process does not run
895 previous build and no new directories are connected.
901 If set, the build target
907 It will only bootstrap libraries and build all of userland.
909 needs changed and that no new directories have been connected to the build.
917 .Bl -tag -width ".Va DOC_LANG"
919 If set, restricts the documentation build to the language subdirectories
921 The default action is to build documentation for all languages.
929 .Bl -tag -width ".Va USE_GCC_TOOLCHAINS"
933 invocation used to build worlds and kernels.
934 This can be used to enable multiple jobs within a single architecture's build
937 Only build kernels for each supported architecture.
939 Only build worlds for each supported architecture.
941 Only build kernels for each supported architecture.
943 Only build worlds for each supported architecture.
952 Use external GCC toolchains to build the requested targets.
954 the build for that architecture is skipped.
961 Only build the listed targets instead of each supported architecture.
963 In addition to the supported architectures, build the semi-supported
965 A semi-supported architecture has build support in the
971 .Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact
987 src build configuration, see
995 .Ss Example 1: Build and upgrade system in place
1002 .Bd -literal -offset indent
1005 PORTS_MODULES+=graphics/drm-kmod emulators/virtualbox-ose-kmod
1009 Check out the CURRENT branch, build it, and install,
1011 .Bd -literal -offset indent
1016 shutdown -r now
1019 For major version upgrades, boot into single-user mode.
1023 .Bd -literal -offset indent
1025 etcupdate -p
1027 etcupdate -B
1028 make delete-old delete-old-libs
1029 shutdown -r now
1031 .Ss Example 2: Build and upgrade a custom kernel in place
1039 .Bd -literal -offset indent
1048 After creating the new kernel configuration, build a fresh toolchain,
1049 build the kernel, and install it, moving the old kernel to
1051 .Bd -literal -offset indent
1052 make kernel-toolchain
1053 make -DALWAYS_CHECK_MAKE buildkernel KERNCONF=MYKERNEL
1054 make -DALWAYS_CHECK_MAKE installkernel KERNCONF=MYKERNEL
1055 shutdown -r now
1058 To build the kernel to an alternate location, use the
1062 .Bd -literal -offset indent
1064 nextboot -k testkernel
1065 shutdown -r now
1067 .Ss Example 3: Build and upgrade a single piece of userspace
1070 .Bd -literal -offset indent
1075 .Ss Example 4: Build and upgrade a loadable kernel module
1078 .Bd -literal -offset indent
1084 changed since last build; note that this will only work if the full
1085 kernel build has been completed in the past, not on a fresh source tree:
1086 .Bd -literal -offset indent
1090 .Ss Example 6: Cross-compiling for different architectures
1094 first prepare your source tree by building the cross-toolchain:
1095 .Bd -literal -offset indent
1100 The following sequence of commands can be used to cross-build the system
1103 .Bd -literal -offset indent
1109 Afterwards, to build and install a single piece of userspace, use:
1110 .Bd -literal -offset indent
1117 .Bd -literal -offset indent
1123 .Bl -diag
1127 The kernel was not updated due to incorrect build procedure.
1137 .Xr freebsd-base 7 ,
1154 Old objects can cause obscure build problems; try
1157 Environment poisioning can cause obscure build problems; try prefixing
1160 .Ql env -i