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