/etc/portage/make.conf

The (formerly ) file is used to customize the Portage environment on a global level. Settings here will apply to every package that is emerged; they control many elements of Portage functionality such as global USE flags, language (linguas) options, Portage mirrors, etc.

An example setup can be found at

Precedence
Portage configuration is not limited to, global settings defined in this file are refined on a per-package basis in the files, as well as the local environment.

may exist as or, however the latter is deprecated for the former. Therefore if settings exist in should be migrated to. Settings from precedence over those in.

Variables
There are many possible variables to customize in, but only the most commonly used are explained in detail within this article. For more information, and the full list of variables, consult the man page by running:

CHOST
This variable is passed through the configure step of ebuilds to set the build-host of the system. See the CHOST article. Note that the profile already should have defined the appropriate CHOST value.

CFLAGS and CXXFLAGS
For example:

For details see the CFLAGS article and Handbook:Parts/Installation/Stage.

CPU_FLAGS_X86
See this news item. and CPU_FLAGS_X86.

GENTOO_MIRRORS
This variable defines a list of Gentoo mirrors to check before downloading from the source defined in the ebuild. Properly chosen mirrors will generally be able to offer faster download speeds. Try using mirrorselect to find the fastest mirror server.

See the Mirrors page on the main site for available URLs.

LINGUAS
See LINGUAS in the Localization guide.

MAKEOPTS
This variable is used to specify arguments passed to make when packages are built from source. Make can be told to run multiple jobs in parallel (a potentially substantial speed increase, depending on processor). This can be done either through  (short form:  ), which runs   (number) jobs at a time (without an argument,   will flood the processor with as many jobs as possible, and is not recommended). For example, to run three jobs:

Another option is  (short form  ), which will have make keep the load average of the system to , however many parallel tasks that ends up being or up to limit set by   if it is set as well.

PORTAGE_TMPDIR
The PORTAGE_TMPDIR variable defines the location of the temporary build directories. The value defaults to.

PORTAGE_TMPDIR should not be set to point anywhere under the location of a repository.

PORTDIR
The PORTDIR variable has been deprecated in favor of settings in repos.conf

PORTDIR_OVERLAY
This variable has been deprecated in favor of settings in repos.conf.

Layman versions <2.3.0 still use it.

SYNC
See SYNC.

USE
The USE variable allows the system wide setting or deactivation of USE flags in a space separated list.

For a fine grained per package control of USE flags, the file should be used instead.

USE_EXPAND
The USE_EXPAND list is set in profiles/base/make.defaults as of Portage 2.0.51.20.

External resources

 * https://devmanual.gentoo.org/general-concepts/features/