1# $FreeBSD$ 2 3.PATH: ${SRCTOP}/sys/contrib/openzfs/module/icp 4 5PACKAGE= utilities 6LIB= icp_rescue 7LIBADD= 8 9 10.if ${MACHINE_ARCH} == "amd64" 11ASM_SOURCES_C = asm-x86_64/aes/aeskey.c 12ASM_SOURCES_AS = \ 13 asm-x86_64/aes/aes_amd64.S \ 14 asm-x86_64/aes/aes_aesni.S \ 15 asm-x86_64/modes/gcm_pclmulqdq.S \ 16 asm-x86_64/modes/aesni-gcm-x86_64.S \ 17 asm-x86_64/sha2/sha256_impl.S \ 18 asm-x86_64/sha2/sha512_impl.S 19 20CFLAGS+= -D__amd64 -D_SYS_STACK_H 21.else 22ASM_SOURCES_C = 23ASM_SOURCES_AS = 24.endif 25 26 27KERNEL_C = \ 28 spi/kcf_spi.c \ 29 api/kcf_ctxops.c \ 30 api/kcf_cipher.c \ 31 api/kcf_mac.c \ 32 algs/aes/aes_impl_aesni.c \ 33 algs/aes/aes_impl_generic.c \ 34 algs/aes/aes_impl_x86-64.c \ 35 algs/aes/aes_impl.c \ 36 algs/aes/aes_modes.c \ 37 algs/edonr/edonr.c \ 38 algs/modes/modes.c \ 39 algs/modes/cbc.c \ 40 algs/modes/gcm_generic.c \ 41 algs/modes/gcm_pclmulqdq.c \ 42 algs/modes/gcm.c \ 43 algs/modes/ctr.c \ 44 algs/modes/ccm.c \ 45 algs/modes/ecb.c \ 46 algs/sha2/sha2.c \ 47 algs/skein/skein_block.c \ 48 illumos-crypto.c \ 49 io/aes.c \ 50 io/sha2_mod.c \ 51 io/skein_mod.c \ 52 core/kcf_sched.c \ 53 core/kcf_prov_lib.c \ 54 core/kcf_callprov.c \ 55 core/kcf_mech_tabs.c \ 56 core/kcf_prov_tabs.c \ 57 $(ASM_SOURCES_C) 58 59SRCS= $(ASM_SOURCES_AS) $(KERNEL_C) 60 61WARNS?= 2 62SHLIB_MAJOR= 3 63CSTD= c99 64CFLAGS+= -DIN_BASE 65CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include 66CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ 67CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd 68CFLAGS+= -I${SRCTOP}/sys 69CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include 70CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include 71CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h 72CFLAGS+= -DHAVE_ISSETUGID -UHAVE_AVX -DRESCUE 73CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h 74 75 76CFLAGS.aes_amd64.S+= -DLOCORE 77CFLAGS.aes_aesni.S+= -DLOCORE 78CFLAGS.gcm_pclmulqdq.S+= -DLOCORE 79CFLAGS.aesni-gcm-x86_64.S+= -DLOCORE 80CFLAGS.ghash-x86_64.S+= -DLOCORE 81CFLAGS.sha256_impl.S+= -DLOCORE 82CFLAGS.sha512_impl.S+= -DLOCORE 83CFLAGS.gcm.c+= -UCAN_USE_GCM_ASM 84 85.include <bsd.lib.mk> 86