xref: /freebsd/sys/modules/aesni/Makefile (revision 02e9120893770924227138ba49df1edb3896112a)
1
2.PATH: ${SRCTOP}/sys/crypto/aesni
3.PATH: ${SRCTOP}/contrib/llvm-project/clang/lib/Headers
4
5KMOD=	aesni
6SRCS=	aesni.c
7SRCS+=	aeskeys_${MACHINE_CPUARCH}.S
8SRCS+=	device_if.h bus_if.h opt_bus.h cryptodev_if.h
9
10OBJS+=	aesni_ghash.o aesni_wrap.o aesni_ccm.o
11OBJS+=	intel_sha1.o intel_sha256.o
12
13# Remove -nostdinc so we can get the intrinsics.
14aesni_ghash.o: aesni_ghash.c
15	${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} \
16	     -mmmx -msse -msse4 -maes -mpclmul ${.IMPSRC}
17	${CTFCONVERT_CMD}
18
19aesni_ccm.o: aesni_ccm.c
20	${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} \
21	     -mmmx -msse -msse4 -maes -mpclmul ${.IMPSRC}
22	${CTFCONVERT_CMD}
23
24aesni_wrap.o: aesni_wrap.c
25	${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} \
26	     -mmmx -msse -msse4 -maes ${.IMPSRC}
27	${CTFCONVERT_CMD}
28
29intel_sha1.o: intel_sha1.c
30	${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} \
31	     -mmmx -msse -msse4 -msha ${.IMPSRC}
32	${CTFCONVERT_CMD}
33
34intel_sha256.o: intel_sha256.c
35	${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${PROF} \
36	     -mmmx -msse -msse4 -msha ${.IMPSRC}
37	${CTFCONVERT_CMD}
38
39aesni_ghash.o: aesni.h
40aesni_wrap.o: aesni.h
41aesni_ccm.o: aesni.h
42intel_sha1.o: sha_sse.h immintrin.h shaintrin.h tmmintrin.h xmmintrin.h
43intel_sha256.o: sha_sse.h immintrin.h shaintrin.h tmmintrin.h xmmintrin.h
44
45.include <bsd.kmod.mk>
46
47CWARNFLAGS.aesni_ghash.c=	${NO_WCAST_QUAL}
48CWARNFLAGS.aesni_wrap.c=	${NO_WCAST_QUAL}
49