MAKE.CONF(5)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸŽ€ MAKE.CONF(5) πŸŽ€

File Formats Manual

🌸 NAME 🌸

make.conf β€” system build information

✨ DESCRIPTION ✨

Okay bestie, so make.conf is literally the file that holds system-wide settings, and those settings apply to every single build that uses make(1) and the standard sys.mk file. The way it works is: make(1) processes the system makefile sys.mk before any other file by default, and sys.mk includes make.conf. Cute, right? πŸŽ€

make.conf uses standard makefile syntax. But β€” and this is important β€” make.conf should not specify any dependencies to make(1). Instead, make.conf is there to set make(1) variables that control what other makefiles do.

The default location of make.conf is /etc/make.conf, but you can point to a different location with the make(1) variable __MAKE_CONF. You might need to override where make.conf lives if the system-wide settings are not suitable for a particular build. For example, setting __MAKE_CONF to /dev/null effectively resets all build controls to their defaults. Iconic little reset button, honestly. πŸ’…

The primary purpose of make.conf is to control the compilation of the FreeBSD sources, documentation, and ported applications, which are usually found in /usr/src, /usr/doc, and /usr/ports. As a rule, the system administrator creates make.conf when the values of certain control variables need to be changed from their defaults.

The system build procedures happen in four broad areas: the world, the kernel, documentation, and ports. Variables set in make.conf may be applicable in one, two, or all four of these areas. Also, control variables can be specified for a particular build via the -D option of make(1) or in environ(7). For world and kernel builds, you can put these variables into src.conf(5) instead of make.conf. That way, the environment for documentation and ports builds is not polluted by unrelated variables. We love a clean vibe check. πŸ¦‹

The following lists give a name and short description for each variable you can use during the indicated builds. The values of variables flagged as bool are ignored; the variable being set at all β€” even to "FALSE" or "NO" β€” causes it to be treated as if it were set. Not me warning you that the vibe of being set is enough. 😭

The following list gives a name and short description for variables that are used for all builds, or are used by the makefiles for things other than builds.

  • ALWAYS_CHECK_MAKE (bool) β€” Instructs the top-level makefile in the source tree (normally /usr/src) to always check if make(1) is up-to-date. Normally this is only done for the world and buildworld targets to handle upgrades from older versions of FreeBSD.
  • CFLAGS (str) β€” Controls the compiler setting when compiling C code. Optimization levels other than -O and -O2 are not supported.
  • CPUTYPE (str) β€” Controls which processor should be targeted for generated code. This controls processor-specific optimizations in certain code (currently only OpenSSL) as well as modifying the value of CFLAGS and COPTFLAGS to contain the appropriate optimization directive to cc(1). To set the CPUTYPE value, use ?= instead of = so that it can be overridden by make(1) targets. The automatic setting of CFLAGS may be overridden using the NO_CPU_CFLAGS variable. Refer to /usr/share/examples/etc/make.conf for a list of recognized CPUTYPE options.
  • CXXFLAGS (str) β€” Controls the compiler settings when compiling C++ code. CXXFLAGS is initially set to the value of CFLAGS. If you want to add to the CXXFLAGS value, use += instead of =.
  • DTC (str) β€” Select the compiler for DTS (Device Tree Syntax) file. DTC is initially set to the value of dtc.
  • INSTALL (str) β€” the default install command. To install only files for which the target differs or does not exist, use
INSTALL+= -C

Note that some makefiles (including those in /usr/share/mk) may hardcode options for the supplied install command.

  • LOCAL_DIRS (str) β€” List any directories that should be entered when doing make's in /usr/src in this variable.
  • MAKE_SHELL (str) β€” Controls the shell used internally by make(1) to process the command scripts in makefiles. sh(1), ksh(1), and csh(1) all currently supported.
MAKE_SHELL?=sh
  • MTREE_FOLLOWS_SYMLINKS (str) β€” Set this to -L to cause mtree(8) to follow symlinks.
  • NO_CPU_CFLAGS (str) β€” Setting this variable will prevent CPU specific compiler flags from being automatically added to CFLAGS during compile time.

πŸ”₯ BUILDING THE KERNEL πŸ”₯

The following list gives a name and short description for variables that are only used doing a kernel build:

  • BOOTWAIT (int) β€” Controls the amount of time the kernel waits for a console keypress before booting the default kernel. The value is approximately milliseconds. Keypresses are accepted by the BIOS before booting from disk, making it possible to give custom boot parameters even when this is set to 0.
  • COPTFLAGS (str) β€” Controls the compiler settings when building the kernel. Optimization levels above [-O (-O2, ...)] are not guaranteed to work.
  • KERNCONF (str) β€” Controls which kernel configurations will be built by ${MAKE} buildkernel and installed by ${MAKE} installkernel. For example,
KERNCONF=MINE DEBUG GENERIC OTHERMACHINE

will build the kernels specified by the config files MINE, DEBUG, GENERIC, and OTHERMACHINE, and install the kernel specified by the config file MINE. It defaults to GENERIC.

  • MODULES_OVERRIDE (str) β€” Set to a list of modules to build instead of all of them.
  • NO_KERNELCLEAN (bool) β€” Set this to skip running ${MAKE} clean during ${MAKE} buildkernel.
  • NO_KERNELCONFIG (bool) β€” Set this to skip running config(8) during ${MAKE} buildkernel.
  • NO_KERNELOBJ (bool) β€” Set this to skip running ${MAKE} obj during ${MAKE} buildkernel.
  • NO_MODULES (bool) β€” Set to not build modules with the kernel.
  • PORTS_MODULES β€” Set this to the list of ports you wish to rebuild every time the kernel is built.
  • WITHOUT_MODULES (str) β€” Set to a list of modules to exclude from the build. This provides a somewhat easier way to exclude modules you are certain you will never need than specifying MODULES_OVERRIDE. This is applied after MODULES_OVERRIDE.

🌈 BUILDING THE WORLD 🌈

The following list gives a name and short description for variables that are used during the world build:

  • BOOT_COMCONSOLE_PORT (str) β€” The port address to use for the console if the boot blocks have been configured to use a serial console instead of the keyboard/video card.
  • BOOT_COMCONSOLE_SPEED (int) β€” The baud rate to use for the console if the boot blocks have been configured to use a serial console instead of the keyboard/video card.
  • BOOT_PXELDR_ALWAYS_SERIAL (bool) β€” Compile in the code into pxeboot(8) that forces the use of a serial console. This is analogous to the -h option in boot(8) blocks.
  • BOOT_PXELDR_PROBE_KEYBOARD (bool) β€” Compile in the code into pxeboot(8) that probes the keyboard. If no keyboard is found, boot with the dual console configuration. This is analogous to the -D option in boot(8) blocks.
  • ENABLE_SUID_K5SU (bool) β€” Set this if you wish to use the ksu utility. Otherwise, it will be installed without the set-user-ID bit set.
  • ENABLE_SUID_NEWGRP (bool) β€” Set this to install newgrp(1) with the set-user-ID bit set. Otherwise, newgrp(1) will not be able to change users' groups.
  • LOADER_TFTP_SUPPORT (bool) β€” By default the pxeboot(8) loader retrieves the kernel via NFS. Defining this and recompiling /usr/src/stand will cause it to retrieve the kernel via TFTP. This allows pxeboot(8) to load a custom BOOTP diskless kernel yet still mount the server's / rather than load the server's kernel.
  • LOADER_FIREWIRE_SUPPORT (bool) β€” Defining this and recompiling /usr/src/stand/i386 will add dcons(4) console driver to loader(8) and allow access over FireWire(IEEE1394) using dconschat(8). Currently, only i386 and amd64 are supported.
  • MAN_ARCH (str) β€” Space-delimited list of one or more MACHINE and/or MACHINE_ARCH values for which section 4 man pages will be installed. The special value all installs all available architectures. It is also the default value.
  • MODULES_WITH_WORLD (bool) β€” Set to build modules with the system instead of the kernel.
  • NO_CLEAN (bool) β€” Set this to disable cleaning during make buildworld. This should not be set unless you know what you are doing. > bestie, do not set this unless you really know what you are doing. fr fr.
  • NO_CLEANDIR (bool) β€” Set this to run ${MAKE} clean instead of ${MAKE} cleandir.
  • WITH_MANCOMPRESS (defined) β€” Set to install manual pages compressed.
  • WITHOUT_MANCOMPRESS (defined) β€” Set to install manual pages uncompressed.
  • NO_SHARE (bool) β€” Set to not build in the share subdir.
  • NO_SHARED (bool) β€” Set to build /bin and /sbin statically linked, this can be bad. If set, every utility that uses bsd.prog.mk will be linked statically.
  • PKG_REPO_SIGNING_KEY (str) β€” Path to rsa private key passed to pkg-repo(8) to sign packages created when building the packages target, i.e.: pkgbase. The variable is named the same in poudriere(8) so it will automatically be picked up when building pkgbase with poudriere.
  • PPP_NO_NAT (bool) β€” Build ppp(8) without support for network address translation (NAT).
  • PPP_NO_NETGRAPH (bool) β€” set this and ppp(8) gets built without Netgraph support. Bye Netgraph πŸ‘‹
  • PPP_NO_RADIUS (bool) β€” set this and ppp(8) gets built without RADIUS support. No radius, no problem.
  • PPP_NO_SUID (bool) β€” set this to turn off installing ppp(8) as a set-user-ID root program. Safer vibes πŸ’…
  • SENDMAIL_ADDITIONAL_MC (str) β€” extra .mc files that should get built into .cf files at build time. Bestie, put the full path to the .mc file(s) in here, like /etc/mail/foo.mc, /etc/mail/bar.mc.
  • SENDMAIL_ALIASES (str) β€” the list of aliases(5) files to rebuild when you're using /etc/mail/Makefile. Default is /etc/mail/aliases.
  • SENDMAIL_CFLAGS (str) β€” flags handed to the compile command when building sendmail(8). You can use the SENDMAIL_* flags to get SASL support going, like so:
SENDMAIL_CFLAGS=-I/usr/local/include -DSASL
SENDMAIL_LDFLAGS=-L/usr/local/lib
SENDMAIL_LDADD=-lsasl
  • SENDMAIL_CF_DIR (str) β€” overrides the default location of the m4(1) config files used to build a .cf file from a .mc file.
  • SENDMAIL_DPADD (str) β€” extra dependencies to tack on when building sendmail(8).
  • SENDMAIL_LDADD (str) β€” flags to add to the end of the ld(1) command when building sendmail(8).
  • SENDMAIL_LDFLAGS (str) β€” flags to pass to the ld(1) command when building sendmail(8).
  • SENDMAIL_M4_FLAGS (str) β€” flags passed to m4(1) when building a .cf file from a .mc file.
  • SENDMAIL_MAP_PERMS (str) β€” the mode to use when generating alias and map database files via /etc/mail/Makefile. Default is 0640.
  • SENDMAIL_MAP_SRC (str) β€” additional maps to rebuild when using /etc/mail/Makefile. Heads up: the access, bitdomain, domaintable, genericstable, mailertable, uucpdomain, and virtusertable maps always get rebuilt if they exist. Always. ✨
  • SENDMAIL_MAP_TYPE (str) β€” the database map type to use when generating map database files with /etc/mail/Makefile. Default is hash, and the alternative is btree.
  • SENDMAIL_MC (str) β€” the default m4(1) config file to use at install time. The value should include the full path to the .mc file, e.g. /etc/mail/myconfig.mc.
⚠️ Use with caution, bestie β€” a make install will overwrite any existing /etc/mail/sendmail.cf. Also note that SENDMAIL_CF is deprecated.
  • SENDMAIL_SET_USER_ID (bool) β€” if set, installs sendmail(8) as a set-user-ID root binary instead of a set-group-ID binary, and does not install /etc/mail/submit.{cf,mc}.
🚨 Using this flag is not recommended. If it's at all possible, follow the alternative advice in /etc/mail/README instead. Periodt.
  • SENDMAIL_START_SCRIPT (str) β€” the script that /etc/mail/Makefile uses to start, stop, and restart sendmail(8). Default is /etc/rc.d/sendmail.
  • SENDMAIL_SUBMIT_MC (str) β€” the default m4(1) config file for mail submission, used at install time. The value should include the full path to the .mc file, e.g. /etc/mail/mysubmit.mc.
⚠️ Again, with caution: a make install will overwrite any existing /etc/mail/submit.cf.
  • TOP_TABLE_SIZE (int) β€” top(1) uses a hash table for the user names, and you can tune the size of that hash to match your number of local users. The table size should be a prime number approximately twice as large as the number of lines in /etc/passwd. Default is 20011.
  • WANT_FORCE_OPTIMIZATION_DOWNGRADE (int) β€” makes the system compiler get built in a way that forces high optimization levels down to a lower one. cc(1) -O2 and above is known to trigger known optimizer bugs at various times 😭. The value you assign is the highest optimization value used.

πŸ¦‹ BUILDING DOCUMENTATION πŸ¦‹

Here's the name-and-short-description list for the variables used when building documentation:

  • DOC_LANG (str) β€” the list of languages to build and install when building documentation in /usr/doc.
  • PRINTERDEVICE (str) β€” the default format for system documentation in /usr/src/share/doc, depends on your printer. Set it to β€œascii” for simple printers, or β€œps” for postscript or graphics printers with a ghostscript filter, or both. Your printer, your rules πŸ–¨οΈ

🌈 BUILDING PORTS 🌈

Several make variables can be set that affect the building of ports. These variables and their effects are documented in ports(7), ${PORTSDIR}/Mk/* and the FreeBSD Porter's Handbook.


πŸŽ€ FILES πŸŽ€

/etc/make.conf
/usr/doc/Makefile
/usr/ports/Makefile
/usr/share/examples/etc/make.conf
/usr/share/mk/sys.mk
/usr/src/Makefile
/usr/src/Makefile.inc1

πŸ‘‘ SEE ALSO πŸ‘‘

cc(1), install(1), make(1), src.conf(5), style.Makefile(5), environ(7), ports(7), sendmail(8)


⭐ HISTORY ⭐

The make.conf file appeared sometime before FreeBSD 4.0. Ancient lore, fr fr 🏺


πŸ’– AUTHORS πŸ’–

This manual page was written by Mike W. Meyer <mwm@mired.org>. Gotta give credit where it's due 🫢


πŸ’€ CAVEATS πŸ’€

Okay so this one actually matters: MAKEOBJDIRPREFIX and MAKEOBJDIR are environment variables and should not be set in make.conf or as command line arguments to make(1) β€” put them in make's environment instead. Not me watching you put them in the wrong place πŸ™ˆ


πŸ“ BUGS πŸ“

This manual page may occasionally be out of date with respect to the options currently available for use in make.conf. Please check the /usr/share/examples/etc/make.conf file for the latest options which are available. Yes, the manpage has trust issues, check the file bestie 😭


This iconic little page comes to you from Debian, dated November 15, 2022 β€” MAKE.CONF(5), slay. πŸ’œ

πŸ“¦ where this page comes from