summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/clang/llvm-config/Makefile
diff options
context:
space:
mode:
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>
+