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