Generate and install arm_neon.h on arm and arm64.
authorkettenis <kettenis@openbsd.org>
Mon, 10 Apr 2017 13:36:04 +0000 (13:36 +0000)
committerkettenis <kettenis@openbsd.org>
Mon, 10 Apr 2017 13:36:04 +0000 (13:36 +0000)
ok jsg@

gnu/usr.bin/clang/include/clang/intrin/Makefile

index 006c51b..4d84bfd 100644 (file)
@@ -1,12 +1,16 @@
-# $OpenBSD: Makefile,v 1.6 2017/01/24 08:44:47 patrick Exp $
+# $OpenBSD: Makefile,v 1.7 2017/04/10 13:36:04 kettenis Exp $
 
 .include <bsd.own.mk>
 
 LLVM_V=                        4.0.0
 CLANG_INTR_INCDIR=     /usr/lib/clang/${LLVM_V}/include
 
+TBLGEN= ${.OBJDIR}/../../../clang-tblgen/clang-tblgen
+CLANG_INC=${.CURDIR}/../../../../../llvm/tools/clang/include
+
 .PATH: ${.CURDIR}/../../../../../llvm/tools/clang/lib/Headers
 
+GEN=
 HEADERS=       stdalign.h \
                stdatomic.h \
                stdnoreturn.h \
@@ -16,7 +20,8 @@ HEADERS=      stdalign.h \
                module.modulemap \
 
 .if ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "arm"
-HEADERS+=      arm_acle.h
+GEN+=          arm_neon.h
+HEADERS+=      arm_acle.h ${GEN}
 .elif ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
 HEADERS+=      adxintrin.h \
                ammintrin.h \
@@ -78,7 +83,7 @@ depend:
        # Nothing here so far ...
 
 clean cleandir:
-       # Nothing here so far ...
+       rm -f ${GEN}
 
 install includes: ${HEADERS}
        ${INSTALL} -d -o ${SHAREOWN} -g ${SHAREGRP} -m ${DIRMODE} \
@@ -86,4 +91,7 @@ install includes: ${HEADERS}
        ${INSTALL} ${INSTALL_COPY} -m 444 ${.ALLSRC} \
                ${DESTDIR}${CLANG_INTR_INCDIR}
 
+arm_neon.h: ${CLANG_INC}/clang/Basic/arm_neon.td
+       ${TBLGEN} -gen-arm-neon -o ${.TARGET} ${.ALLSRC}
+
 .include <bsd.obj.mk>