1# $FreeBSD$ 2 3.PATH: ${SRCTOP}/sys/crypto/openssl 4.PATH: ${SRCTOP}/sys/crypto/openssl/${MACHINE_CPUARCH} 5 6KMOD= ossl 7OBJS+= ${OBJS.${MACHINE_CPUARCH}} 8SRCS= bus_if.h \ 9 cryptodev_if.h \ 10 device_if.h \ 11 ossl.c \ 12 ossl_aes.c \ 13 ossl_chacha20.c \ 14 ossl_poly1305.c \ 15 ossl_sha1.c \ 16 ossl_sha256.c \ 17 ossl_sha512.c \ 18 ${SRCS.${MACHINE_CPUARCH}} 19 20SRCS.aarch64= \ 21 chacha-armv8.S \ 22 poly1305-armv8.S \ 23 sha1-armv8.S \ 24 sha256-armv8.S \ 25 sha512-armv8.S \ 26 vpaes-armv8.S \ 27 ossl_aarch64.c 28 29SRCS.amd64= \ 30 aes-gcm-avx512.S \ 31 aesni-x86_64.S \ 32 aesni-gcm-x86_64.S \ 33 chacha-x86_64.S \ 34 ghash-x86_64.S \ 35 poly1305-x86_64.S \ 36 sha1-x86_64.S \ 37 sha256-x86_64.S \ 38 sha512-x86_64.S \ 39 ossl_aes_gcm.c \ 40 ossl_x86.c 41 42SRCS.i386= \ 43 aesni-x86.S \ 44 chacha-x86.S \ 45 poly1305-x86.S \ 46 sha1-586.S \ 47 sha256-586.S \ 48 sha512-586.S \ 49 ossl_x86.c 50 51# For arm64, we are forced to rewrite the compiler invocation for the assembly 52# files, to remove -mgeneral-regs-only. 53${SRCS.aarch64:M*.S:S/S/o/}: ${.TARGET:R}.S 54 ${CC} -c ${CFLAGS:N-mgeneral-regs-only} ${WERROR} ${PROF} ${.IMPSRC} 55 ${CTFCONVERT_CMD} 56 57# Based on modules/armv8crypto/Makefile. 58# Clang doesn't recognize "aes*" instructions without -march set. 59aesv8-armx.o: aesv8-armx.S 60 ${CC} -c ${CFLAGS:N-mgeneral-regs-only} ${WERROR} ${PROF} \ 61 -march=armv8-a+crypto ${.IMPSRC} 62 ${CTFCONVERT_CMD} 63 64OBJS.aarch64= aesv8-armx.o 65 66.include <bsd.kmod.mk> 67