summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/clang/llvm-config/Makefile
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2019-03-05 01:55:19 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2019-03-05 01:55:19 +0000
commit1a6a430f4a78b2eda0e0cb88f6e7d1d293f0bfe0 (patch)
treefc74284a171b77c91a0a0b2427f45f4f959b771d /gnu/usr.bin/clang/llvm-config/Makefile
parentc16fcc8479a39500d0f20cff27859b88b402b322 (diff)
add Makefile for llvm-config
A build time dependency on python is avoided by generating the arch specific list of library components in advance. A 'reconf' target is included to regenerate them. Approach discussed with patrick@
Diffstat (limited to 'gnu/usr.bin/clang/llvm-config/Makefile')
-rw-r--r--gnu/usr.bin/clang/llvm-config/Makefile43
1 files changed, 43 insertions, 0 deletions
diff --git a/gnu/usr.bin/clang/llvm-config/Makefile b/gnu/usr.bin/clang/llvm-config/Makefile
new file mode 100644
index 00000000000..56eb9ed5775
--- /dev/null
+++ b/gnu/usr.bin/clang/llvm-config/Makefile
@@ -0,0 +1,43 @@
+# $OpenBSD: Makefile,v 1.1 2019/03/05 01:55:18 jsg Exp $
+
+PROG= llvm-config
+BINDIR= /usr/bin
+NOMAN=
+
+NATIVE_ARCHS=AArch64 ARM Mips PowerPC Sparc X86
+
+PYTHON= python2
+LLVMBUILD= ${.CURDIR}/../../../llvm/utils/llvm-build/llvm-build
+
+.include <bsd.own.mk>
+SRCS= llvm-config.cpp
+
+CPPFLAGS+= -I${.CURDIR}
+
+llvm-config.o: BuildVariables.inc LibraryDependencies.inc
+
+BuildVariables.inc: ${.CURDIR}/BuildVariables.inc.def
+ cp ${.CURDIR}/BuildVariables.inc.def ${.OBJDIR}/BuildVariables.inc
+ echo "#define LLVM_TARGETS_BUILT \"${LLVM_ARCH} AMDGPU\"" >> \
+ ${.OBJDIR}/BuildVariables.inc
+
+LibraryDependencies.inc:
+ cp ${.CURDIR}/LibraryDependencies.inc.${LLVM_ARCH} \
+ ${.OBJDIR}/LibraryDependencies.inc
+
+LLVM_LIBDEPS= LLVMTableGen LLVMSupport
+
+reconf:
+.for arch in ${NATIVE_ARCHS}
+ ${PYTHON} -B ${LLVMBUILD} \
+ --native-target ${LLVM_ARCH} \
+ --enable-targets "${arch} AMDGPU" \
+ --write-library-table ${.CURDIR}/LibraryDependencies.inc.${arch}
+.endfor
+
+CLEANFILES+= BuildVariables.inc LibraryDependencies.inc
+
+.PATH: ${.CURDIR}/../../../llvm/tools/llvm-config
+
+.include <bsd.prog.mk>
+