]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man7/build.7
build.7: Document LOCAL_MODULES and LOCAL_MODULES_DIR
[FreeBSD/FreeBSD.git] / share / man / man7 / build.7
1 .\" Copyright (c) 2000
2 .\"     Mike W. Meyer
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd August 10, 2021
28 .Dt BUILD 7
29 .Os
30 .Sh NAME
31 .Nm build
32 .Nd General instructions on how to build the system
33 .Sh DESCRIPTION
34 The sources for the
35 .Fx
36 system and its applications are contained in three different directories,
37 normally
38 .Pa /usr/src ,
39 .Pa /usr/doc ,
40 and
41 .Pa /usr/ports .
42 These directories may be initially empty or non-existent until updated with
43 .Xr svn 1
44 (or
45 .Xr svnlite 1 ) .
46 Directory
47 .Pa /usr/src
48 contains the
49 .Dq "base system"
50 sources, which is loosely defined as the things required to rebuild
51 the system to a useful state.
52 Directory
53 .Pa /usr/doc
54 contains the source for the system documentation, excluding the manual
55 pages.
56 Directory
57 .Pa /usr/ports
58 contains a tree that provides a consistent interface for building and
59 installing third party applications.
60 For more information about the ports build process, see
61 .Xr ports 7 .
62 .Pp
63 The
64 .Xr make 1
65 command is used in each of these directories to build and install the
66 things in that directory.
67 Issuing the
68 .Xr make 1
69 command in any directory issues the
70 .Xr make 1
71 command recursively in all subdirectories.
72 With no target specified, the items in the directories are built
73 and no further action is taken.
74 .Pp
75 A source tree is allowed to be read-only.
76 As described in
77 .Xr make 1 ,
78 objects are usually built in a separate object directory hierarchy
79 specified by the environment variable
80 .Va MAKEOBJDIRPREFIX ,
81 or under
82 .Pa /usr/obj
83 if variable
84 .Va MAKEOBJDIRPREFIX
85 is not set.
86 The canonical object directory is described in the documentation for the
87 .Cm buildworld
88 target below.
89 .Pp
90 The build may be controlled by defining
91 .Xr make 1
92 variables described in the
93 .Sx ENVIRONMENT
94 section below, and by the variables documented in
95 .Xr make.conf 5 .
96 .Pp
97 The default components included in the build are specified in the file
98 .Pa /etc/src.conf
99 in the source tree.
100 To override the default file, include the SRCCONF option in the make steps,
101 pointing to a custom src.conf file.
102 For more information see
103 .Xr src.conf 5 .
104 .Pp
105 The following list provides the names and actions for the targets
106 supported by the build system:
107 .Bl -tag -width ".Cm cleandepend"
108 .It Cm analyze
109 Run Clang static analyzer against all objects and present output on stdout.
110 .It Cm check
111 Run tests for a given subdirectory.
112 The default directory used is
113 .Pa ${.OBJDIR} ,
114 but the check directory can be changed with
115 .Pa ${CHECKDIR} .
116 .It Cm checkworld
117 Run the
118 .Fx
119 test suite on installed world.
120 .It Cm clean
121 Remove any files created during the build process.
122 .It Cm cleandepend
123 Remove the
124 .Pa ${.OBJDIR}/${DEPENDFILE}*
125 files generated by prior
126 .Dq Li "make"
127 and
128 .Dq Li "make depend"
129 steps.
130 .It Cm cleandir
131 Remove the canonical object directory if it exists, or perform
132 actions equivalent to
133 .Dq Li "make clean cleandepend"
134 if it does not.
135 This target will also remove an
136 .Pa obj
137 link in
138 .Pa ${.CURDIR}
139 if that exists.
140 .Pp
141 It is advisable to run
142 .Dq Li "make cleandir"
143 twice: the first invocation will remove the canonical object directory
144 and the second one will clean up
145 .Pa ${.CURDIR} .
146 .It Cm depend
147 Generate a list of build dependencies in file
148 .Pa ${.OBJDIR}/${DEPENDFILE} .
149 Per-object dependencies are generated at build time and stored in
150 .Pa ${.OBJDIR}/${DEPENDFILE}.${OBJ} .
151 .It Cm install
152 Install the results of the build to the appropriate location in the
153 installation directory hierarchy specified in variable
154 .Va DESTDIR .
155 .It Cm obj
156 Create the canonical object directory associated with the current
157 directory.
158 .It Cm objlink
159 Create a symbolic link to the canonical object directory in
160 .Pa ${.CURDIR} .
161 .It Cm tags
162 Generate a tags file using the program specified in the
163 .Xr make 1
164 variable
165 .Va CTAGS .
166 The build system supports
167 .Xr ctags 1
168 and
169 .Nm "GNU Global" .
170 .El
171 .Pp
172 The other supported targets under directory
173 .Pa /usr/src
174 are:
175 .Bl -tag -width ".Cm distributeworld"
176 .It Cm buildenv
177 Spawn an interactive shell with environment variables set up for
178 building the system or individual components.
179 For cross-building the target architecture needs to be specified with
180 .Xr make 1
181 variables
182 .Va TARGET_ARCH
183 and
184 .Va TARGET .
185 .Pp
186 This target is only useful after a complete toolchain (including
187 the compiler, linker, assembler, headers and libraries) has been
188 built; see the
189 .Cm toolchain
190 target below.
191 .It Cm buildworld
192 Build everything but the kernel, configure files in
193 .Pa etc ,
194 and
195 .Pa release .
196 The object directory can be changed from the default
197 .Pa /usr/obj
198 by setting the
199 .Pa MAKEOBJDIRPREFIX
200 .Xr make 1
201 variable.
202 The actual build location prefix used
203 depends on the
204 .Va WITH_UNIFIED_OBJDIR
205 option from
206 .Xr src.conf 5 .
207 If enabled it is
208 .Pa ${MAKEOBJDIRPREFIX}${.CURDIR}/${TARGET}.${TARGET_ARCH}
209 for all builds.
210 If disabled it is
211 .Pa ${MAKEOBJDIRPREFIX}${.CURDIR}
212 for native builds, and
213 .Pa ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH}${.CURDIR}
214 for cross builds and native builds with variable
215 .Va CROSS_BUILD_TESTING
216 set.
217 .It Cm cleanworld
218 Attempt to clean up targets built by a preceding
219 .Cm buildworld ,
220 or similar step built from this source directory.
221 .It Cm cleanuniverse
222 When
223 .Va WITH_UNIFIED_OBJDIR
224 is enabled, attempt to clean up targets built by a preceding
225 .Cm buildworld ,
226 .Cm universe ,
227 or similar step, for any architecture built from this source directory.
228 .It Cm distributeworld
229 Distribute everything compiled by a preceding
230 .Cm buildworld
231 step.
232 Files are placed in the directory hierarchy specified by
233 .Xr make 1
234 variable
235 .Va DISTDIR .
236 This target is used while building a release; see
237 .Xr release 7 .
238 .It Cm native-xtools
239 This target builds a cross-toolchain for the given
240 .Sy TARGET
241 and
242 .Sy TARGET_ARCH ,
243 as well as a select list of static userland tools for the host system.
244 This is intended to be used in a jail where QEMU is used to improve
245 performance by avoiding emulating binaries that do not need to be emulated.
246 .Sy TARGET
247 and
248 .Sy TARGET_ARCH
249 should be defined.
250 .It Cm native-xtools-install
251 Installs the results to
252 .Pa ${DESTDIR}/${NXTP}
253 where
254 .Va NXTP
255 defaults to
256 .Pa nxb-bin .
257 .Sy TARGET
258 and
259 .Sy TARGET_ARCH
260 must be defined.
261 .It Cm packageworld
262 Archive the results of
263 .Cm distributeworld ,
264 placing the results in
265 .Va DISTDIR .
266 This target is used while building a release; see
267 .Xr release 7 .
268 .It Cm installworld
269 Install everything built by a preceding
270 .Cm buildworld
271 step into the directory hierarchy pointed to by
272 .Xr make 1
273 variable
274 .Va DESTDIR .
275 .Pp
276 If installing onto an NFS file system and running
277 .Xr make 1
278 with the
279 .Fl j
280 option, make sure that
281 .Xr rpc.lockd 8
282 is running on both client and server.
283 See
284 .Xr rc.conf 5
285 on how to make it start at boot time.
286 .It Cm toolchain
287 Create the build toolchain needed to build the rest of the system.
288 For cross-architecture builds, this step creates a cross-toolchain.
289 .It Cm universe
290 For each architecture,
291 execute a
292 .Cm buildworld
293 followed by a
294 .Cm buildkernel
295 for all kernels for that architecture,
296 including
297 .Pa LINT .
298 This command takes a long time.
299 .It Cm kernels
300 Like
301 .Cm universe
302 with
303 .Va WITHOUT_WORLDS
304 defined so only the kernels for each architecture are built.
305 .It Cm worlds
306 Like
307 .Cm universe
308 with
309 .Va WITHOUT_KERNELS
310 defined so only the worlds for each architecture are built.
311 .It Cm update
312 Get updated sources as configured in
313 .Xr make.conf 5 .
314 .It Cm targets
315 Print a list of supported
316 .Va TARGET
317 /
318 .Va TARGET_ARCH
319 pairs for world and kernel targets.
320 .It Cm tinderbox
321 Execute the same targets as
322 .Cm universe .
323 In addition print a summary of all failed targets at the end and
324 exit with an error if there were any.
325 .It Cm toolchains
326 Create a build toolchain for each architecture supported by the build system.
327 .It Cm xdev
328 Builds and installs a cross-toolchain and sysroot for the given
329 .Sy TARGET
330 and
331 .Sy TARGET_ARCH .
332 The sysroot contains target library and headers.
333 The target is an alias for
334 .Cm xdev-build
335 and
336 .Cm xdev-install .
337 The location of the files installed can be controlled with
338 .Va DESTDIR .
339 The target location in
340 .Va DESTDIR
341 is
342 .Pa ${DESTDIR}/${XDTP}
343 where
344 .Va XDTP
345 defaults to
346 .Pa /usr/${XDDIR}
347 and
348 .Va XDDIR
349 defaults to
350 .Pa ${TARGET_ARCH}-freebsd .
351 .It Cm xdev-build
352 Builds for the
353 .Cm xdev
354 target.
355 .It Cm xdev-install
356 Installs the files for the
357 .Cm xdev
358 target.
359 .It Cm xdev-links
360 Installs autoconf-style symlinks to
361 .Pa ${DESTDIR}/usr/bin
362 pointing into the xdev toolchain in
363 .Pa ${DESTDIR}/${XDTP} .
364 .El
365 .Pp
366 Kernel specific build targets in
367 .Pa /usr/src
368 are:
369 .Bl -tag -width ".Cm distributekernel"
370 .It Cm buildkernel
371 Rebuild the kernel and the kernel modules.
372 The object directory can be changed from the default
373 .Pa /usr/obj
374 by setting the
375 .Pa MAKEOBJDIRPREFIX
376 .Xr make 1
377 variable.
378 .It Cm installkernel
379 Install the kernel and the kernel modules to directory
380 .Pa ${DESTDIR}/boot/kernel ,
381 renaming any pre-existing directory with this name to
382 .Pa kernel.old
383 if it contained the currently running kernel.
384 The target directory under
385 .Pa ${DESTDIR}
386 may be modified using the
387 .Va INSTKERNNAME
388 and
389 .Va KODIR
390 .Xr make 1
391 variables.
392 .It Cm distributekernel
393 Install the kernel to the directory
394 .Pa ${DISTDIR}/kernel/boot/kernel .
395 This target is used while building a release; see
396 .Xr release 7 .
397 .It Cm packagekernel
398 Archive the results of
399 .Cm distributekernel ,
400 placing the results in
401 .Va DISTDIR .
402 This target is used while building a release; see
403 .Xr release 7 .
404 .It Cm kernel
405 Equivalent to
406 .Cm buildkernel
407 followed by
408 .Cm installkernel
409 .It Cm kernel-toolchain
410 Rebuild the tools needed for kernel compilation.
411 Use this if you did not do a
412 .Cm buildworld
413 first.
414 .It Cm reinstallkernel
415 Reinstall the kernel and the kernel modules, overwriting the contents
416 of the target directory.
417 As with the
418 .Cm installkernel
419 target, the target directory can be specified using the
420 .Xr make 1
421 variable
422 .Va INSTKERNNAME .
423 .El
424 .Pp
425 Convenience targets for cleaning up the install destination directory
426 denoted by variable
427 .Va DESTDIR
428 include:
429 .Bl -tag -width ".Cm delete-old-libs"
430 .It Cm check-old
431 Print a list of old files and directories in the system.
432 .It Cm delete-old
433 Delete obsolete base system files and directories interactively.
434 When
435 .Li -DBATCH_DELETE_OLD_FILES
436 is specified at the command line, the delete operation will be
437 non-interactive.
438 The variables
439 .Va DESTDIR ,
440 .Va TARGET_ARCH
441 and
442 .Va TARGET
443 should be set as with
444 .Dq Li "make installworld" .
445 .It Cm delete-old-libs
446 Delete obsolete base system libraries interactively.
447 This target should only be used if no third party software uses these
448 libraries.
449 When
450 .Li -DBATCH_DELETE_OLD_FILES
451 is specified at the command line, the delete operation will be
452 non-interactive.
453 The variables
454 .Va DESTDIR ,
455 .Va TARGET_ARCH
456 and
457 .Va TARGET
458 should be set as with
459 .Dq Li "make installworld" .
460 .El
461 .Sh ENVIRONMENT
462 Variables that influence all builds include:
463 .Bl -tag -width ".Va MAKEOBJDIRPREFIX"
464 .It Va DEBUG_FLAGS
465 Defines a set of debugging flags that will be used to build all userland
466 binaries under
467 .Pa /usr/src .
468 When
469 .Va DEBUG_FLAGS
470 is defined, the
471 .Cm install
472 and
473 .Cm installworld
474 targets install binaries from the current
475 .Va MAKEOBJDIRPREFIX
476 without stripping,
477 so that debugging information is retained in the installed binaries.
478 .It Va DESTDIR
479 The directory hierarchy prefix where built objects will be installed.
480 If not set,
481 .Va DESTDIR
482 defaults to the empty string.
483 .It Va MAKEOBJDIRPREFIX
484 Defines the prefix for directory names in the tree of built objects.
485 Defaults to
486 .Pa /usr/obj
487 if not defined.
488 This variable should only be set in the environment or
489 .Pa /etc/src-env.conf
490 and not via
491 .Pa /etc/make.conf
492 or
493 .Pa /etc/src.conf
494 or the command line.
495 .It Va WITHOUT_WERROR
496 If defined, compiler warnings will not cause the build to halt,
497 even if the makefile says otherwise.
498 .It Va WITH_CTF
499 If defined, the build process will run the DTrace CTF conversion
500 tools on built objects.
501 .El
502 .Pp
503 Additionally, builds in
504 .Pa /usr/src
505 are influenced by the following
506 .Xr make 1
507 variables:
508 .Bl -tag -width ".Va SUBDIR_OVERRIDE"
509 .It Va KERNCONF
510 Overrides which kernel to build and install for the various kernel
511 make targets.
512 It defaults to
513 .Cm GENERIC .
514 .It Va KERNCONFDIR
515 Overrides the directory in which
516 .Va KERNCONF
517 and any files included by
518 .Va KERNCONF
519 should be found.
520 Defaults to
521 .Pa sys/${ARCH}/conf .
522 .It Va KERNFAST
523 If set, the build target
524 .Cm buildkernel
525 defaults to setting
526 .Va NO_KERNELCLEAN ,
527 .Va NO_KERNELCONFIG ,
528 and
529 .Va NO_KERNELOBJ .
530 When set to a value other than
531 .Cm 1
532 then
533 .Va KERNCONF
534 is set to the value of
535 .Va KERNFAST .
536 .It Va LOCAL_DIRS
537 If set, this variable supplies a list of additional directories relative to
538 the root of the source tree to build as part of the
539 .Cm everything
540 target.
541 The directories are built in parallel with each other,
542 and with the base system directories.
543 Insert a
544 .Va .WAIT
545 directive at the beginning of the
546 .Va LOCAL_DIRS
547 list to ensure all base system directories are built first.
548 .Va .WAIT
549 may also be used as needed elsewhere within the list.
550 .It Va LOCAL_ITOOLS
551 If set, this variable supplies a list of additional tools that are used by the
552 .Cm installworld
553 and
554 .Cm distributeworld
555 targets.
556 .It Va LOCAL_LIB_DIRS
557 If set, this variable supplies a list of additional directories relative to
558 the root of the source tree to build as part of the
559 .Cm libraries
560 target.
561 The directories are built in parallel with each other,
562 and with the base system libraries.
563 Insert a
564 .Va .WAIT
565 directive at the beginning of the
566 .Va LOCAL_DIRS
567 list to ensure all base system libraries are built first.
568 .Va .WAIT
569 may also be used as needed elsewhere within the list.
570 .It Va LOCAL_MTREE
571 If set, this variable supplies a list of additional mtrees relative to the
572 root of the source tree to use as part of the
573 .Cm hierarchy
574 target.
575 .It Va LOCAL_LEGACY_DIRS
576 If set, this variable supplies a list of additional directories relative to
577 the root of the source tree to build as part of the
578 .Cm legacy
579 target.
580 .It Va LOCAL_BSTOOL_DIRS
581 If set, this variable supplies a list of additional directories relative to
582 the root of the source tree to build as part of the
583 .Cm bootstrap-tools
584 target.
585 .It Va LOCAL_TOOL_DIRS
586 If set, this variable supplies a list of additional directories relative to
587 the root of the source tree to build as part of the
588 .Cm build-tools
589 target.
590 .It Va LOCAL_XTOOL_DIRS
591 If set, this variable supplies a list of additional directories relative to
592 the root of the source tree to build as part of the
593 .Cm cross-tools
594 target.
595 .It Va PORTS_MODULES
596 A list of ports with kernel modules that should be built and installed
597 as part of the
598 .Cm buildkernel
599 and
600 .Cm installkernel
601 process.
602 .Bd -literal -offset indent
603 make PORTS_MODULES=emulators/virtualbox-ose-kmod kernel
604 .Ed
605 .It Va LOCAL_MODULES
606 A list of external kernel modules that should be built and installed
607 as part of the
608 .Cm buildkernel
609 and
610 .Cm installkernel
611 process.
612 .It Va LOCAL_MODULES_DIR
613 The directory in which to search for the kernel modules specified by
614 .Va LOCAL_MODULES .
615 Each kernel module should consist of a directory containing a makefile.
616 Defaults to
617 .Pa ${LOCALBASE}/sys/modules .
618 .It Va SRCCONF
619 Specify a file to override the default
620 .Pa /etc/src.conf .
621 The src.conf file controls the components to build.
622 See
623 .Xr src.conf 5
624 .It Va STRIPBIN
625 Command to use at install time when stripping binaries.
626 Be sure to add any additional tools required to run
627 .Va STRIPBIN
628 to the
629 .Va LOCAL_ITOOLS
630 .Xr make 1
631 variable before running the
632 .Cm distributeworld
633 or
634 .Cm installworld
635 targets.
636 See
637 .Xr install 1
638 for more details.
639 .It Va SUBDIR_OVERRIDE
640 Override the default list of sub-directories and only build the
641 sub-directory named in this variable.
642 If combined with
643 .Cm buildworld
644 then all libraries and includes, and some of the build tools will still build
645 as well.
646 Specifying
647 .Cm -DNO_LIBS ,
648 and
649 .Cm -DWORLDFAST
650 will only build the specified directory as was done historically.
651 When combined with
652 .Cm buildworld
653 it is necesarry to override
654 .Va LOCAL_LIB_DIRS
655 with any custom directories containing libraries.
656 This allows building a subset of the system in the same way as
657 .Cm buildworld
658 does using its sysroot handling.
659 This variable can also be useful when debugging failed builds.
660 .Bd -literal -offset indent
661 make some-target SUBDIR_OVERRIDE=foo/bar
662 .Ed
663 .It Va TARGET
664 The target hardware platform.
665 This is analogous to the
666 .Dq Nm uname Fl m
667 output.
668 This is necessary to cross-build some target architectures.
669 For example, cross-building for ARM64 machines requires
670 .Va TARGET_ARCH Ns = Ns Li aarch64
671 and
672 .Va TARGET Ns = Ns Li arm64 .
673 If not set,
674 .Va TARGET
675 defaults to the current hardware platform, unless
676 .Va TARGET_ARCH
677 is also set, in which case it defaults to the appropriate
678 value for that architecture.
679 .It Va TARGET_ARCH
680 The target machine processor architecture.
681 This is analogous to the
682 .Dq Nm uname Fl p
683 output.
684 Set this to cross-build for a different architecture.
685 If not set,
686 .Va TARGET_ARCH
687 defaults to the current machine architecture, unless
688 .Va TARGET
689 is also set, in which case it defaults to the appropriate
690 value for that platform.
691 Typically, one only needs to set
692 .Va TARGET .
693 .El
694 .Pp
695 Builds under directory
696 .Pa /usr/src
697 are also influenced by defining one or more of the following symbols,
698 using the
699 .Fl D
700 option of
701 .Xr make 1 :
702 .Bl -tag -width ".Va -DNO_KERNELCONFIG"
703 .It Va LOADER_DEFAULT_INTERP
704 Defines what interpreter the default loader program will have.
705 Valid values include
706 .Dq 4th ,
707 .Dq lua ,
708 and
709 .Dq simp .
710 This creates the default link for
711 .Pa /boot/loader
712 to the loader with that interpreter.
713 It also determines what interpreter is compiled into
714 .Pa userboot .
715 .It Va NO_CLEANDIR
716 If set, the build targets that clean parts of the object tree use the
717 equivalent of
718 .Dq make clean
719 instead of
720 .Dq make cleandir .
721 .It Va NO_CLEAN
722 If set, no object tree files are cleaned at all.
723 This is the default when
724 .Va WITH_META_MODE
725 is used with
726 .Xr filemon 4
727 loaded.
728 See
729 .Xr src.conf 5
730 for more details.
731 Setting
732 .Va NO_CLEAN
733 implies
734 .Va NO_KERNELCLEAN ,
735 so when
736 .Va NO_CLEAN
737 is set no kernel objects are cleaned either.
738 .It Va NO_CTF
739 If set, the build process does not run the DTrace CTF conversion tools
740 on built objects.
741 .It Va NO_SHARE
742 If set, the build does not descend into the
743 .Pa /usr/src/share
744 subdirectory (i.e., manual pages, locale data files, timezone data files and
745 other
746 .Pa /usr/src/share
747 files will not be rebuild from their sources).
748 .It Va NO_KERNELCLEAN
749 If set, the build process does not run
750 .Dq make clean
751 as part of the
752 .Cm buildkernel
753 target.
754 .It Va NO_KERNELCONFIG
755 If set, the build process does not run
756 .Xr config 8
757 as part of the
758 .Cm buildkernel
759 target.
760 .It Va NO_KERNELOBJ
761 If set, the build process does not run
762 .Dq make obj
763 as part of the
764 .Cm buildkernel
765 target.
766 .It Va NO_DOCUPDATE
767 If set, the update process does not update the source of the
768 .Fx
769 documentation as part of the
770 .Dq make update
771 target.
772 .It Va NO_LIBS
773 If set, the libraries phase will be skipped.
774 .It Va NO_OBJWALK
775 If set, no object directories will be created.
776 This should only be used if object directories were created in a
777 previous build and no new directories are connected.
778 .It Va NO_PORTSUPDATE
779 If set, the update process does not update the Ports tree as part of the
780 .Dq make update
781 target.
782 .It Va NO_WWWUPDATE
783 If set, the update process does not update the www tree as part of the
784 .Dq make update
785 target.
786 .It Va WORLDFAST
787 If set, the build target
788 .Cm buildworld
789 defaults to setting
790 .Va NO_CLEAN ,
791 .Va NO_OBJWALK ,
792 and will skip most bootstrap phases.
793 It will only bootstrap libraries and build all of userland.
794 This option should be used only when it is known that none of the bootstrap
795 needs changed and that no new directories have been connected to the build.
796 .El
797 .Pp
798 Builds under directory
799 .Pa /usr/doc
800 are influenced by the following
801 .Xr make 1
802 variables:
803 .Bl -tag -width ".Va DOC_LANG"
804 .It Va DOC_LANG
805 If set, restricts the documentation build to the language subdirectories
806 specified as its content.
807 The default action is to build documentation for all languages.
808 .El
809 .Pp
810 Builds using the
811 .Cm universe
812 and related targets are influenced by the following
813 .Xr make 1
814 variables:
815 .Bl -tag -width ".Va MAKE_JUST_KERNELS"
816 .It Va JFLAG
817 Pass the value of this variable to each
818 .Xr make 1
819 invocation used to build worlds and kernels.
820 This can be used to enable multiple jobs within a single architecture's build
821 while still building each architecture serially.
822 .It Va MAKE_JUST_KERNELS
823 Only build kernels for each supported architecture.
824 .It Va MAKE_JUST_WORLDS
825 Only build worlds for each supported architecture.
826 .It Va WITHOUT_WORLDS
827 Only build kernels for each supported architecture.
828 .It Va WITHOUT_KERNELS
829 Only build worlds for each supported architecture.
830 .It Va UNIVERSE_TARGET
831 Execute the specified
832 .Xr make 1
833 target for each supported architecture instead of the default action of
834 building a world and one or more kernels.
835 This variable implies
836 .Va WITHOUT_KERNELS .
837 .It Va TARGETS
838 Only build the listed targets instead of each supported architecture.
839 .It Va EXTRA_TARGETS
840 In addition to the supported architectures, build the semi-supported
841 architectures.
842 A semi-supported architecture has build support in the
843 .Fx
844 tree, but receives significantly less testing and is generally for
845 fringe uses that do not have a wide appeal.
846 .El
847 .Sh FILES
848 .Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact
849 .It Pa /usr/doc/Makefile
850 .It Pa /usr/doc/share/mk/doc.project.mk
851 .It Pa /usr/ports/Mk/bsd.port.mk
852 .It Pa /usr/ports/Mk/bsd.sites.mk
853 .It Pa /usr/share/examples/etc/make.conf
854 .It Pa /usr/src/Makefile
855 .It Pa /usr/src/Makefile.inc1
856 .El
857 .Sh EXAMPLES
858 For an
859 .Dq approved
860 method of updating your system from the latest sources, please see the
861 .Sx COMMON ITEMS
862 section in
863 .Pa src/UPDATING .
864 .Pp
865 The following sequence of commands can be used to cross-build the
866 system for the armv6 architecture on an amd64 host:
867 .Bd -literal -offset indent
868 cd /usr/src
869 make TARGET_ARCH=armv6 buildworld buildkernel
870 make TARGET_ARCH=armv6 DESTDIR=/clients/arm installworld installkernel
871 .Ed
872 .Sh HISTORY
873 The
874 .Nm
875 manpage first appeared in
876 .Fx 4.3 .
877 .Sh SEE ALSO
878 .Xr cc 1 ,
879 .Xr install 1 ,
880 .Xr make 1 ,
881 .Xr svn 1 ,
882 .Xr svnlite 1 ,
883 .Xr make.conf 5 ,
884 .Xr src.conf 5 ,
885 .Xr arch 7 ,
886 .Xr ports 7 ,
887 .Xr release 7 ,
888 .Xr tests 7 ,
889 .Xr config 8 ,
890 .Xr etcupdate 8 ,
891 .Xr mergemaster 8 ,
892 .Xr reboot 8 ,
893 .Xr shutdown 8
894 .Sh AUTHORS
895 .An Mike W. Meyer Aq Mt mwm@mired.org