> Date: Mon, 10 Apr 2017 21:42:11 +1000
> From: Jonathan Gray <j...@jsg.id.au>
> 
> On Mon, Apr 10, 2017 at 01:35:57PM +0200, Mark Kettenis wrote:
> > Looking into arm_neon.h.  This header file is supposed to be generated
> > using the clang_tablegen tool, which is why we missed it.
> 
> Index: Makefile
> ===================================================================
> RCS file: /cvs/src/gnu/usr.bin/clang/include/clang/intrin/Makefile,v
> retrieving revision 1.6
> diff -u -p -r1.6 Makefile
> --- Makefile  24 Jan 2017 08:44:47 -0000      1.6
> +++ Makefile  10 Apr 2017 11:39:51 -0000
> @@ -4,6 +4,8 @@
>  
>  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
>  
> @@ -16,7 +18,8 @@ HEADERS=    stdalign.h \
>               module.modulemap \
>  
>  .if ${MACHINE_ARCH} == "aarch64" || ${MACHINE_ARCH} == "arm"
> -HEADERS+=    arm_acle.h
> +HEADERS+=    arm_acle.h \
> +             arm_neon.h
>  .elif ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
>  HEADERS+=    adxintrin.h \
>               ammintrin.h \
> @@ -73,6 +76,10 @@ HEADERS+=  altivec.h \
>  .endif
>  
>  all: ${HEADERS}
> +
> +arm_neon.h: ${CLANG_INC}/clang/Basic/arm_neon.td
> +     ${TBLGEN} -I${CLANG_INC} -gen-arm-neon \
> +             -o ${.TARGET} ${.ALLSRC}   
>  
>  depend:
>       # Nothing here so far ...
> 

Here's a slightly better version that removes the generated header
file when you do "make clean":

Index: gnu/usr.bin/clang/include/clang/intrin/Makefile
===================================================================
RCS file: /cvs/src/gnu/usr.bin/clang/include/clang/intrin/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- gnu/usr.bin/clang/include/clang/intrin/Makefile     24 Jan 2017 08:44:47 
-0000      1.6
+++ gnu/usr.bin/clang/include/clang/intrin/Makefile     10 Apr 2017 12:48:05 
-0000
@@ -5,8 +5,12 @@
 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,12 +83,15 @@ 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} \
                ${DESTDIR}${CLANG_INTR_INCDIR}
        ${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>

Reply via email to