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