1# $OpenBSD: Makefile.arch,v 1.9 2021/04/29 05:32:01 drahn Exp $
2
3LLVM_ARCHS=AArch64 AMDGPU ARM Mips PowerPC RISCV Sparc X86
4
5LLVM_ARCH?=
6.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
7LLVM_ARCH=	X86
8.elif ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64"
9LLVM_ARCH=	PowerPC
10.elif ${MACHINE_ARCH} == "riscv64"
11LLVM_ARCH=	RISCV
12.elif ${MACHINE_ARCH} == "sparc64"
13LLVM_ARCH=	Sparc
14.elif ${MACHINE_ARCH} == "aarch64"
15LLVM_ARCH=	AArch64
16.elif ${MACHINE_ARCH} == "arm"
17LLVM_ARCH=	ARM
18.elif ${MACHINE_ARCH} == "mips64" || ${MACHINE_ARCH} == "mips64el"
19LLVM_ARCH=	Mips
20.endif
21
22BACKEND_ASMPARSER?=
23BACKEND_CODEGEN?=
24BACKEND_DESC?=
25BACKEND_DISASSEMBLER?=
26BACKEND_INFO?=
27BACKEND_UTILS?=
28
29.for arch in ${LLVM_ARCHS}
30.if "${arch}" == ${LLVM_ARCH} || "${arch}" == "AMDGPU" || make(obj)
31BACKEND_ASMPARSER+=	LLVM${arch}AsmParser
32BACKEND_CODEGEN+=	LLVM${arch}CodeGen
33BACKEND_DESC+=		LLVM${arch}Desc
34BACKEND_DISASSEMBLER+=	LLVM${arch}Disassembler
35BACKEND_INFO+=		LLVM${arch}Info
36.if "${arch}" == "X86" || "${arch}" == "AArch64" || "${arch}" == "ARM" \
37 || "${arch}" == "AMDGPU" || "${arch}" == "RISCV"
38BACKEND_UTILS+=		LLVM${arch}Utils
39.endif
40.endif
41.endfor
42
43BACKEND_LIBS+=		${BACKEND_ASMPARSER}
44BACKEND_LIBS+=		${BACKEND_CODEGEN}
45BACKEND_LIBS+=		${BACKEND_DESC}
46BACKEND_LIBS+=		${BACKEND_DISASSEMBLER}
47BACKEND_LIBS+=		${BACKEND_INFO}
48BACKEND_LIBS+=		${BACKEND_UTILS}
49