BSD.PORT.ARCH.MK(5) File Formats Manual BSD.PORT.ARCH.MK(5)

bsd.port.arch.mkports tree Makefile fragment, concerned with arch issues

# Set up such as
MULTI_PACKAGES = -main -special
ONLY_FOR_ARCHS-special = i386

.include <>

#some more lines such as
.if ${BUILD_PACKAGES:M-special}
CONFIGURE_ARGS += --enable-special

.include <> holds the logic used for arch-dependent builds in the ports tree. It is normally included as part of the larger, but it is also available separately for ports that require it.

  • multi-packages ports that need to remove some subpackages based on pseudo-flavors or architecture constraints.
  • ports that need to make explicit tests on arch-dependent constants. assumes the following variables are already defined:

and optionally, if the default won't be appropriate

It will set up the following variables for use in the rest of the Makefile:

Most importantly, BUILD_PACKAGES will be correctly set up, taking ONLY_FOR_ARCHS[-<sub>] and NOT_FOR_ARCHS[-<sub>] limitations into account, as well as pseudo-flavors.

Note that thanks to the way make(1) variables are evaluated, a setup such as

.include <>

is perfectly admissible, since ONLY_FOR_ARCHS-foo will be used only after LP64_ARCHS is defined.

Also, you do not need to explicitly include just to define


since does define arch constants before evaluating ONLY_FOR_ARCHS. A more detailed description of each variable is available in

All the constant values ARCH, ALL_ARCHS, COMPILER_VERSION, GCC3_ARCHS, GCC4_ARCHS, LP64_ARCHS and PROPERTIES are also available from MODULES and from ${.CURDIR}/../ was split from in OpenBSD 5.1.

December 8, 2019 OpenBSD 7.5