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