]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man5/make.conf.5
Merge bmake-20230909
[FreeBSD/FreeBSD.git] / share / man / man5 / make.conf.5
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 .Dd November 15, 2022
26 .Dt MAKE.CONF 5
27 .Os
28 .Sh NAME
29 .Nm make.conf
30 .Nd system build information
31 .Sh DESCRIPTION
32 The file
33 .Nm
34 contains system-wide settings that will apply to every build using
35 .Xr make 1
36 and the standard
37 .Pa sys.mk
38 file.
39 This is achieved as follows:
40 .Xr make 1
41 processes the system makefile
42 .Pa sys.mk
43 before any other file by default, and
44 .Pa sys.mk
45 includes
46 .Nm .
47 .Pp
48 The file
49 .Nm
50 uses the standard makefile syntax.
51 However,
52 .Nm
53 should not specify any dependencies to
54 .Xr make 1 .
55 Instead,
56 .Nm
57 is to set
58 .Xr make 1
59 variables that control the actions of other makefiles.
60 .Pp
61 The default location of
62 .Nm
63 is
64 .Pa /etc/make.conf ,
65 though an alternative location can be specified in the
66 .Xr make 1
67 variable
68 .Va __MAKE_CONF .
69 You may need to override the location of
70 .Nm
71 if the system-wide settings are not suitable for a particular build.
72 For instance, setting
73 .Va __MAKE_CONF
74 to
75 .Pa /dev/null
76 effectively resets all build controls to their defaults.
77 .Pp
78 The primary purpose of
79 .Nm
80 is to control the compilation of the
81 .Fx
82 sources, documentation, and ported applications,
83 which are usually found in
84 .Pa /usr/src ,
85 .Pa /usr/doc ,
86 and
87 .Pa /usr/ports .
88 As a rule, the system administrator creates
89 .Nm
90 when the values of certain control variables need to be changed
91 from their defaults.
92 .Pp
93 The system build procedures occur in four broad areas:
94 the world, the kernel, documentation and ports.
95 Variables set in
96 .Nm
97 may be applicable in one, two, or all four of these areas.
98 In addition, control variables can be specified
99 for a particular build via the
100 .Fl D
101 option of
102 .Xr make 1
103 or in
104 .Xr environ 7 .
105 In the case of world and kernel builds it is possible to put these variables
106 into
107 .Xr src.conf 5
108 instead of
109 .Nm .
110 This way the environment for documentation and ports builds is not polluted
111 by unrelated variables.
112 .Pp
113 The following lists provide a name and short description for each
114 variable you can use during the indicated builds.
115 The values of
116 variables flagged as
117 .Vt bool
118 are ignored; the variable being
119 set at all (even to
120 .Dq Li FALSE
121 or
122 .Dq Li NO )
123 causes it to
124 be treated as if it were set.
125 .Pp
126 The following list provides a name and short description for variables
127 that are used for all builds, or are used by the
128 .Pa makefiles
129 for things other than builds.
130 .Bl -tag -width Ar
131 .It Va ALWAYS_CHECK_MAKE
132 .Pq Vt bool
133 Instructs the top-level makefile in the source tree (normally
134 .Pa /usr/src )
135 to always check if
136 .Xr make 1
137 is up-to-date.
138 Normally this is only done for the world and buildworld targets to handle
139 upgrades from older versions of
140 .Fx .
141 .It Va CFLAGS
142 .Pq Vt str
143 Controls the compiler setting when compiling C code.
144 Optimization levels other than
145 .Fl O
146 and
147 .Fl O2
148 are not supported.
149 .It Va CPUTYPE
150 .Pq Vt str
151 Controls which processor should be targeted for generated
152 code.
153 This controls processor-specific optimizations in
154 certain code (currently only OpenSSL) as well as modifying
155 the value of
156 .Va CFLAGS
157 and
158 .Va COPTFLAGS
159 to contain the appropriate optimization directive to
160 .Xr cc 1 .
161 The automatic setting of
162 .Va CFLAGS
163 may be overridden using the
164 .Va NO_CPU_CFLAGS
165 variable.
166 Refer to
167 .Pa /usr/share/examples/etc/make.conf
168 for a list of recognized
169 .Va CPUTYPE
170 options.
171 .It Va CXXFLAGS
172 .Pq Vt str
173 Controls the compiler settings when compiling C++ code.
174 .Va CXXFLAGS
175 is initially set to the value of
176 .Va CFLAGS .
177 If you want to
178 add to the
179 .Va CXXFLAGS
180 value, use
181 .Dq Li +=
182 instead of
183 .Dq Li = .
184 .It Va DTC
185 .Pq Vt str
186 Select the compiler for DTS (Device Tree Syntax) file.
187 .Va DTC
188 is initially set to the value of dtc
189 .It Va INSTALL
190 .Pq Vt str
191 the default install command.
192 To install only files for which the target differs or does not exist, use
193 .Bd -literal -offset indent
194 INSTALL+= -C
195 .Ed
196 Note that some makefiles (including those in
197 .Pa /usr/share/mk )
198 may hardcode options for the supplied install command.
199 .It Va LOCAL_DIRS
200 .Pq Vt str
201 List any directories that should be entered when doing
202 make's in
203 .Pa /usr/src
204 in this variable.
205 .It Va MAKE_SHELL
206 .Pq Vt str
207 Controls the shell used internally by
208 .Xr make 1
209 to process the command scripts in makefiles.
210 .Xr sh 1 ,
211 .Xr ksh 1 ,
212 and
213 .Xr csh 1
214 all currently supported.
215 .Pp
216 .Dl "MAKE_SHELL?=sh"
217 .It Va MTREE_FOLLOWS_SYMLINKS
218 .Pq Vt str
219 Set this to
220 .Dq Fl L
221 to cause
222 .Xr mtree 8
223 to follow symlinks.
224 .It Va NO_CPU_CFLAGS
225 .Pq Vt str
226 Setting this variable will prevent CPU specific compiler flags
227 from being automatically added to
228 .Va CFLAGS
229 during compile time.
230 .El
231 .Ss "BUILDING THE KERNEL"
232 The following list provides a name and short description for variables
233 that are only used doing a kernel build:
234 .Bl -tag -width Ar
235 .It Va BOOTWAIT
236 .Pq Vt int
237 Controls the amount of time the kernel waits for a console keypress
238 before booting the default kernel.
239 The value is approximately milliseconds.
240 Keypresses are accepted by the BIOS before booting from disk,
241 making it possible to give custom boot parameters even when this is
242 set to 0.
243 .It Va COPTFLAGS
244 .Pq Vt str
245 Controls the compiler settings when building the
246 kernel.
247 Optimization levels above
248 .Oo Fl O ( O2 , No ...\& ) Oc
249 are not guaranteed to work.
250 .It Va KERNCONF
251 .Pq Vt str
252 Controls which kernel configurations will be
253 built by
254 .Dq Li "${MAKE} buildkernel"
255 and installed by
256 .Dq Li "${MAKE} installkernel" .
257 For example,
258 .Bd -literal -offset indent
259 KERNCONF=MINE DEBUG GENERIC OTHERMACHINE
260 .Ed
261 .Pp
262 will build the kernels specified by the config files
263 .Pa MINE , DEBUG , GENERIC ,
264 and
265 .Pa OTHERMACHINE ,
266 and install the kernel specified by the config file
267 .Pa MINE .
268 It defaults to
269 .Pa GENERIC .
270 .It Va MODULES_OVERRIDE
271 .Pq Vt str
272 Set to a list of modules to build instead of all of them.
273 .It Va NO_KERNELCLEAN
274 .Pq Vt bool
275 Set this to skip running
276 .Dq Li "${MAKE} clean"
277 during
278 .Dq Li "${MAKE} buildkernel" .
279 .It Va NO_KERNELCONFIG
280 .Pq Vt bool
281 Set this to skip running
282 .Xr config 8
283 during
284 .Dq Li "${MAKE} buildkernel" .
285 .It Va NO_KERNELOBJ
286 .Pq Vt bool
287 Set this to skip running
288 .Dq Li "${MAKE} obj"
289 during
290 .Dq Li "${MAKE} buildkernel" .
291 .It Va NO_MODULES
292 .Pq Vt bool
293 Set to not build modules with the kernel.
294 .It Va PORTS_MODULES
295 Set this to the list of ports you wish to rebuild every time the kernel
296 is built.
297 .It Va WITHOUT_MODULES
298 .Pq Vt str
299 Set to a list of modules to exclude from the build.
300 This provides a
301 somewhat easier way to exclude modules you are certain you will never
302 need than specifying
303 .Va MODULES_OVERRIDE .
304 This is applied
305 .Em after
306 .Va MODULES_OVERRIDE .
307 .El
308 .Ss "BUILDING THE WORLD"
309 The following list provides a name and short description for variables
310 that are used during the world build:
311 .Bl -tag -width Ar
312 .It Va BOOT_COMCONSOLE_PORT
313 .Pq Vt str
314 The port address to use for the console if the boot blocks have
315 been configured to use a serial console instead of the keyboard/video card.
316 .It Va BOOT_COMCONSOLE_SPEED
317 .Pq Vt int
318 The baud rate to use for the console if the boot blocks have
319 been configured to use a serial console instead of the keyboard/video card.
320 .It Va BOOT_PXELDR_ALWAYS_SERIAL
321 .Pq Vt bool
322 Compile in the code into
323 .Xr pxeboot 8
324 that forces the use of a serial console.
325 This is analogous to the
326 .Fl h
327 option in
328 .Xr boot 8
329 blocks.
330 .It Va BOOT_PXELDR_PROBE_KEYBOARD
331 .Pq Vt bool
332 Compile in the code into
333 .Xr pxeboot 8
334 that probes the keyboard.
335 If no keyboard is found, boot with the dual console configuration.
336 This is analogous to the
337 .Fl D
338 option in
339 .Xr boot 8
340 blocks.
341 .It Va ENABLE_SUID_K5SU
342 .Pq Vt bool
343 Set this if you wish to use the ksu utility.
344 Otherwise, it will be
345 installed without the set-user-ID bit set.
346 .It Va ENABLE_SUID_NEWGRP
347 .Pq Vt bool
348 Set this to install
349 .Xr newgrp 1
350 with the set-user-ID bit set.
351 Otherwise,
352 .Xr newgrp 1
353 will not be able to change users' groups.
354 .It Va LOADER_TFTP_SUPPORT
355 .Pq Vt bool
356 By default the
357 .Xr pxeboot 8
358 loader retrieves the kernel via NFS.
359 Defining this and recompiling
360 .Pa /usr/src/stand
361 will cause it to retrieve the kernel via TFTP.
362 This allows
363 .Xr pxeboot 8
364 to load a custom BOOTP diskless kernel yet
365 still mount the server's
366 .Pa /
367 rather than load the server's kernel.
368 .It Va LOADER_FIREWIRE_SUPPORT
369 .Pq Vt bool
370 Defining this and recompiling
371 .Pa /usr/src/stand/i386
372 will add
373 .Xr dcons 4
374 console driver to
375 .Xr loader 8
376 and allow access over FireWire(IEEE1394) using
377 .Xr dconschat 8 .
378 Currently, only i386 and amd64 are supported.
379 .It Va MAN_ARCH
380 .Pq Vt str
381 Space-delimited list of one or more MACHINE and/or MACHINE_ARCH values
382 for which section 4 man pages will be installed.
383 The special value
384 .Sq all
385 installs all available architectures.
386 It is also the default value.
387 .It Va MODULES_WITH_WORLD
388 .Pq Vt bool
389 Set to build modules with the system instead of the kernel.
390 .It Va NO_CLEAN
391 .Pq Vt bool
392 Set this to disable cleaning during
393 .Dq Li "make buildworld" .
394 This should not be set unless you know what you are doing.
395 .It Va NO_CLEANDIR
396 .Pq Vt bool
397 Set this to run
398 .Dq Li "${MAKE} clean"
399 instead of
400 .Dq Li "${MAKE} cleandir" .
401 .It Va WITH_MANCOMPRESS
402 .Pq Vt defined
403 Set to install manual pages compressed.
404 .It Va WITHOUT_MANCOMPRESS
405 .Pq Vt defined
406 Set to install manual pages uncompressed.
407 .It Va NO_SHARE
408 .Pq Vt bool
409 Set to not build in the
410 .Pa share
411 subdir.
412 .It Va NO_SHARED
413 .Pq Vt bool
414 Set to build
415 .Pa /bin
416 and
417 .Pa /sbin
418 statically linked, this can be bad.
419 If set, every utility that uses
420 .Pa bsd.prog.mk
421 will be linked statically.
422 .It Va PKG_REPO_SIGNING_KEY
423 .Pq Vt str
424 Path to rsa private key passed to
425 .Xr pkg-repo 8
426 to sign packages created when building the
427 .Ar packages
428 target, i.e.: pkgbase.
429 The variable is named the same in
430 .Xr poudriere 8
431 so it will automatically be picked up when building pkgbase with poudriere.
432 .It Va PPP_NO_NAT
433 .Pq Vt bool
434 Build
435 .Xr ppp 8
436 without support for network address translation (NAT).
437 .It Va PPP_NO_NETGRAPH
438 .Pq Vt bool
439 Set to build
440 .Xr ppp 8
441 without support for Netgraph.
442 .It Va PPP_NO_RADIUS
443 .Pq Vt bool
444 Set to build
445 .Xr ppp 8
446 without support for RADIUS.
447 .It Va PPP_NO_SUID
448 .Pq Vt bool
449 Set to disable the installation of
450 .Xr ppp 8
451 as a set-user-ID root program.
452 .It Va SENDMAIL_ADDITIONAL_MC
453 .Pq Vt str
454 Additional
455 .Pa .mc
456 files which should be built into
457 .Pa .cf
458 files at build time.
459 The value should include the full path to the
460 .Pa .mc
461 file(s), e.g.,
462 .Pa /etc/mail/foo.mc ,
463 .Pa /etc/mail/bar.mc .
464 .It Va SENDMAIL_ALIASES
465 .Pq Vt str
466 List of
467 .Xr aliases 5
468 files to rebuild when using
469 .Pa /etc/mail/Makefile .
470 The default value is
471 .Pa /etc/mail/aliases .
472 .It Va SENDMAIL_CFLAGS
473 .Pq Vt str
474 Flags to pass to the compile command when building
475 .Xr sendmail 8 .
476 The
477 .Va SENDMAIL_*
478 flags can be used to provide SASL support with setting such as:
479 .Bd -literal -offset indent
480 SENDMAIL_CFLAGS=-I/usr/local/include -DSASL
481 SENDMAIL_LDFLAGS=-L/usr/local/lib
482 SENDMAIL_LDADD=-lsasl
483 .Ed
484 .It Va SENDMAIL_CF_DIR
485 .Pq Vt str
486 Override the default location for the
487 .Xr m4 1
488 configuration files used to build a
489 .Pa .cf
490 file from a
491 .Pa .mc
492 file.
493 .It Va SENDMAIL_DPADD
494 .Pq Vt str
495 Extra dependencies to add when building
496 .Xr sendmail 8 .
497 .It Va SENDMAIL_LDADD
498 .Pq Vt str
499 Flags to add to the end of the
500 .Xr ld 1
501 command when building
502 .Xr sendmail 8 .
503 .It Va SENDMAIL_LDFLAGS
504 .Pq Vt str
505 Flags to pass to the
506 .Xr ld 1
507 command when building
508 .Xr sendmail 8 .
509 .It Va SENDMAIL_M4_FLAGS
510 .Pq Vt str
511 Flags passed to
512 .Xr m4 1
513 when building a
514 .Pa .cf
515 file from a
516 .Pa .mc
517 file.
518 .It Va SENDMAIL_MAP_PERMS
519 .Pq Vt str
520 Mode to use when generating alias and map database files using
521 .Pa /etc/mail/Makefile .
522 The default value is 0640.
523 .It Va SENDMAIL_MAP_SRC
524 .Pq Vt str
525 Additional maps to rebuild when using
526 .Pa /etc/mail/Makefile .
527 The
528 .Pa access ,
529 .Pa bitdomain ,
530 .Pa domaintable ,
531 .Pa genericstable ,
532 .Pa mailertable ,
533 .Pa uucpdomain ,
534 and
535 .Pa virtusertable
536 maps are always rebuilt if they exist.
537 .It Va SENDMAIL_MAP_TYPE
538 .Pq Vt str
539 Database map type to use when generating map database files using
540 .Pa /etc/mail/Makefile .
541 The default value is hash.
542 The alternative is btree.
543 .It Va SENDMAIL_MC
544 .Pq Vt str
545 The default
546 .Xr m4 1
547 configuration file to use at install time.
548 The value should include the full path to the
549 .Pa .mc
550 file, e.g.,
551 .Pa /etc/mail/myconfig.mc .
552 Use with caution as a make install will overwrite any existing
553 .Pa /etc/mail/sendmail.cf .
554 Note that
555 .Va SENDMAIL_CF
556 is deprecated.
557 .It Va SENDMAIL_SET_USER_ID
558 .Pq Vt bool
559 If set, install
560 .Xr sendmail 8
561 as a set-user-ID root binary instead of a set-group-ID binary
562 and do not install
563 .Pa /etc/mail/submit.{cf,mc} .
564 Use of this flag is not recommended and the alternative advice in
565 .Pa /etc/mail/README
566 should be followed instead if at all possible.
567 .It Va SENDMAIL_START_SCRIPT
568 .Pq Vt str
569 The script used by
570 .Pa /etc/mail/Makefile
571 to start, stop, and restart
572 .Xr sendmail 8 .
573 The default value is
574 .Pa /etc/rc.d/sendmail .
575 .It Va SENDMAIL_SUBMIT_MC
576 .Pq Vt str
577 The default
578 .Xr m4 1
579 configuration file for mail submission
580 to use at install time.
581 The value should include the full path to the
582 .Pa .mc
583 file, e.g.,
584 .Pa /etc/mail/mysubmit.mc .
585 Use with caution as a make install will overwrite any existing
586 .Pa /etc/mail/submit.cf .
587 .It Va TOP_TABLE_SIZE
588 .Pq Vt int
589 .Xr top 1
590 uses a hash table for the user names.
591 The size of this hash can be tuned to match the number of local users.
592 The table size should be a prime number
593 approximately twice as large as the number of lines in
594 .Pa /etc/passwd .
595 The default number is 20011.
596 .It Va WANT_FORCE_OPTIMIZATION_DOWNGRADE
597 .Pq Vt int
598 Causes the system compiler to be built such that it forces high optimization
599 levels to a lower one.
600 .Xr cc 1
601 .Fl O2
602 and above is known to trigger known optimizer bugs at various
603 times.
604 The value assigned is the highest optimization value used.
605 .El
606 .Ss "BUILDING DOCUMENTATION"
607 The following list provides a name and short description for variables
608 that are used when building documentation.
609 .Bl -tag -width ".Va PRINTERDEVICE"
610 .It Va DOC_LANG
611 .Pq Vt str
612 The list of languages to build and install when building documentation
613 in
614 .Pa /usr/doc .
615 .It Va PRINTERDEVICE
616 .Pq Vt str
617 The default format for system documentation in
618 .Pa /usr/src/share/doc ,
619 depends on your printer.
620 This can be set to
621 .Dq Li ascii
622 for simple printers, or
623 .Dq Li ps
624 for postscript or graphics printers with a ghostscript
625 filter, or both.
626 .El
627 .Ss "BUILDING PORTS"
628 Several make variables can be set that affect the building of ports.
629 These variables and their effects are documented in
630 .Xr ports 7 ,
631 .Pa ${PORTSDIR}/Mk/*
632 and the
633 .Fx
634 Porter's Handbook.
635 .Sh FILES
636 .Bl -tag -width ".Pa /usr/share/examples/etc/make.conf" -compact
637 .It Pa /etc/make.conf
638 .It Pa /usr/doc/Makefile
639 .It Pa /usr/ports/Makefile
640 .It Pa /usr/share/examples/etc/make.conf
641 .It Pa /usr/share/mk/sys.mk
642 .It Pa /usr/src/Makefile
643 .It Pa /usr/src/Makefile.inc1
644 .El
645 .Sh SEE ALSO
646 .Xr cc 1 ,
647 .Xr install 1 ,
648 .Xr make 1 ,
649 .Xr src.conf 5 ,
650 .Xr style.Makefile 5 ,
651 .Xr environ 7 ,
652 .Xr ports 7 ,
653 .Xr sendmail 8
654 .Sh HISTORY
655 The
656 .Nm
657 file appeared sometime before
658 .Fx 4.0 .
659 .Sh AUTHORS
660 This
661 manual page was written by
662 .An Mike W. Meyer Aq Mt mwm@mired.org .
663 .Sh CAVEATS
664 Note, that
665 .Ev MAKEOBJDIRPREFIX
666 and
667 .Ev MAKEOBJDIR
668 are environment variables and should not be set in
669 .Nm
670 or as command line arguments to
671 .Xr make 1 ,
672 but in make's environment.
673 .Sh BUGS
674 This manual page may occasionally be out of date with respect to
675 the options currently available for use in
676 .Nm .
677 Please check the
678 .Pa /usr/share/examples/etc/make.conf
679 file for the latest options which are available.