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