xref: /freebsd/share/mk/bsd.endian.mk (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1
2.if ${MACHINE_CPUARCH} == "aarch64" || \
3    ${MACHINE_CPUARCH} == "arm" || \
4    ${MACHINE_ARCH} == "amd64" || \
5    ${MACHINE_ARCH} == "i386" || \
6    ${MACHINE_ARCH} == "powerpc64le" || \
7    ${MACHINE_CPUARCH} == "riscv"
8TARGET_ENDIANNESS= 1234
9CAP_MKDB_ENDIAN= -l
10LOCALEDEF_ENDIAN= -l
11.elif ${MACHINE_ARCH} == "powerpc" || \
12    ${MACHINE_ARCH} == "powerpc64" || \
13    ${MACHINE_ARCH} == "powerpcspe"
14TARGET_ENDIANNESS= 4321
15CAP_MKDB_ENDIAN= -b
16LOCALEDEF_ENDIAN= -b
17.elif ${.MAKE.OS} == "FreeBSD"
18.error Don't know the endian of this architecture
19.else
20#
21# During bootstrapping on !FreeBSD OSes, we need to define some value.  Short of
22# having an exhaustive list for all variants of Linux and MacOS we simply do not
23# set TARGET_ENDIANNESS and poison the other variables. They should be unused
24# during the bootstrap phases (apart from one place that's adequately protected
25# in bsd.compiler.mk) where we're building the bootstrap tools.
26#
27CAP_MKDB_ENDIAN= -B	# Poisoned value, invalid flags for both cap_mkdb
28LOCALEDEF_ENDIAN= -B	# and localedef.
29.endif
30