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