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