Gentoo reads /etc/portage/make.conf before package calculations, so a global setting in that file can change many future builds. Editing the file with a backup and a Portage parser check keeps system-wide defaults controlled before emerge uses them.
make.conf stores shell-like KEY=“value” assignments for Portage. User settings normally belong in /etc/portage/make.conf, which overrides the older /etc/make.conf path, while the selected profile still supplies baseline defaults below it.
Use make.conf for defaults that should apply broadly, such as MAKEOPTS, GENTOO_MIRRORS, FEATURES, and compiler flags already placed there by the stage. Package-specific USE flags belong under /etc/portage/package.use instead, and CHOST should not be changed casually because it describes the system's toolchain target.
Related: How to set Gentoo USE flags
Related: How to build Gentoo binary packages
Related: How to update a Gentoo world set
$ ls -ld /etc/portage/make.conf -rw-r--r-- 1 root root 543 Jun 8 02:57 /etc/portage/make.conf
If /etc/portage/make.conf is a directory, edit a file inside that directory instead. Portage reads the files there in lexical filename order as one combined make.conf.
$ cat /etc/portage/make.conf
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
COMMON_FLAGS="-O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult https://wiki.gentoo.org/wiki/Changing_the_CHOST_variable before changing.
CHOST="aarch64-unknown-linux-gnu"
##### snipped #####
$ sudo cp -a /etc/portage/make.conf /etc/portage/make.conf.before-edit
$ sudoedit /etc/portage/make.conf
MAKEOPTS="-j4 -l4"
MAKEOPTS controls parallel make jobs and load limits for packages that use make. Current Portage can choose defaults when it is unset, so set an explicit value only when the system needs a lower or different build limit.
$ portageq envvar MAKEOPTS -j4 -l4
Use the variable name changed in make.conf when checking a different setting, such as portageq envvar FEATURES or portageq envvar GENTOO_MIRRORS.
$ sudo emerge --pretend --verbose --update --deep --newuse @world
If emerge reports blockers, unexpected rebuilds, or invalid configuration output after the edit, restore the backup or correct make.conf before merging packages.