xref: /freebsd/cddl/lib/libicp/Makefile (revision e2df9bb44109577475aeb186e7186ac040f9bde1)
19e5787d2SMatt Macy.PATH: ${SRCTOP}/sys/contrib/openzfs/module/icp
29e5787d2SMatt Macy
3a71ea7beSEmmanuel VadotPACKAGE=	zfs
49e5787d2SMatt MacyLIB=	icp
59e5787d2SMatt MacyLIBADD=
69e5787d2SMatt Macy
79e5787d2SMatt Macy.if ${MACHINE_ARCH} == "amd64"
89e5787d2SMatt MacyASM_SOURCES_C = asm-x86_64/aes/aeskey.c
99e5787d2SMatt MacyASM_SOURCES_AS = \
109e5787d2SMatt Macy        asm-x86_64/aes/aes_amd64.S \
119e5787d2SMatt Macy        asm-x86_64/aes/aes_aesni.S \
129e5787d2SMatt Macy        asm-x86_64/modes/gcm_pclmulqdq.S \
139e5787d2SMatt Macy        asm-x86_64/modes/aesni-gcm-x86_64.S \
149e5787d2SMatt Macy        asm-x86_64/modes/ghash-x86_64.S \
152a58b312SMartin Matuska        asm-x86_64/sha2/sha256-x86_64.S \
162a58b312SMartin Matuska        asm-x86_64/sha2/sha512-x86_64.S \
171f1e2261SMartin Matuska        asm-x86_64/blake3/blake3_avx2.S \
181f1e2261SMartin Matuska        asm-x86_64/blake3/blake3_avx512.S \
191f1e2261SMartin Matuska        asm-x86_64/blake3/blake3_sse2.S \
201f1e2261SMartin Matuska        asm-x86_64/blake3/blake3_sse41.S
219e5787d2SMatt Macy
229e5787d2SMatt MacyCFLAGS+= -D__amd64 -D_SYS_STACK_H -UHAVE_AES
23bc6051a0SDimitry Andric.elif ${MACHINE_CPUARCH} == "arm"
242a58b312SMartin MatuskaASM_SOURCES_C =
252a58b312SMartin MatuskaASM_SOURCES_AS = \
262a58b312SMartin Matuska        asm-arm/sha2/sha256-armv7.S \
272a58b312SMartin Matuska        asm-arm/sha2/sha512-armv7.S
281f1e2261SMartin Matuska.elif ${MACHINE_ARCH} == "aarch64"
291f1e2261SMartin MatuskaASM_SOURCES_C =
301f1e2261SMartin MatuskaASM_SOURCES_AS = \
311f1e2261SMartin Matuska        asm-aarch64/blake3/b3_aarch64_sse2.S \
322a58b312SMartin Matuska        asm-aarch64/blake3/b3_aarch64_sse41.S \
332a58b312SMartin Matuska        asm-aarch64/sha2/sha256-armv8.S \
342a58b312SMartin Matuska        asm-aarch64/sha2/sha512-armv8.S
352a58b312SMartin Matuska.elif ${MACHINE_ARCH} == "powerpc64"
362a58b312SMartin MatuskaASM_SOURCES_C =
372a58b312SMartin MatuskaASM_SOURCES_AS = \
382a58b312SMartin Matuska        asm-ppc64/sha2/sha256-ppc.S \
392a58b312SMartin Matuska        asm-ppc64/sha2/sha512-ppc.S \
402a58b312SMartin Matuska        asm-ppc64/sha2/sha256-p8.S \
412a58b312SMartin Matuska        asm-ppc64/sha2/sha512-p8.S
429921563fSJessica Clarke.elif ${MACHINE_ARCH} == "powerpc64le"
431f1e2261SMartin MatuskaASM_SOURCES_C =
441f1e2261SMartin MatuskaASM_SOURCES_AS = \
451f1e2261SMartin Matuska        asm-ppc64/blake3/b3_ppc64le_sse2.S \
462a58b312SMartin Matuska        asm-ppc64/blake3/b3_ppc64le_sse41.S \
472a58b312SMartin Matuska        asm-ppc64/sha2/sha256-ppc.S \
482a58b312SMartin Matuska        asm-ppc64/sha2/sha512-ppc.S \
492a58b312SMartin Matuska        asm-ppc64/sha2/sha256-p8.S \
502a58b312SMartin Matuska        asm-ppc64/sha2/sha512-p8.S
519e5787d2SMatt Macy.else
529e5787d2SMatt MacyASM_SOURCES_C =
539e5787d2SMatt MacyASM_SOURCES_AS =
549e5787d2SMatt Macy.endif
559e5787d2SMatt Macy
569e5787d2SMatt MacyKERNEL_C = \
579e5787d2SMatt Macy        spi/kcf_spi.c \
589e5787d2SMatt Macy        api/kcf_ctxops.c \
599e5787d2SMatt Macy        api/kcf_cipher.c \
609e5787d2SMatt Macy        api/kcf_mac.c \
619e5787d2SMatt Macy        algs/aes/aes_impl_aesni.c \
629e5787d2SMatt Macy        algs/aes/aes_impl_generic.c \
639e5787d2SMatt Macy        algs/aes/aes_impl_x86-64.c \
649e5787d2SMatt Macy        algs/aes/aes_impl.c \
659e5787d2SMatt Macy        algs/aes/aes_modes.c \
661f1e2261SMartin Matuska        algs/blake3/blake3.c \
671f1e2261SMartin Matuska        algs/blake3/blake3_generic.c \
681f1e2261SMartin Matuska        algs/blake3/blake3_impl.c \
699e5787d2SMatt Macy        algs/edonr/edonr.c \
709e5787d2SMatt Macy        algs/modes/modes.c \
719e5787d2SMatt Macy        algs/modes/gcm_generic.c \
729e5787d2SMatt Macy        algs/modes/gcm_pclmulqdq.c \
739e5787d2SMatt Macy        algs/modes/gcm.c \
749e5787d2SMatt Macy        algs/modes/ccm.c \
752a58b312SMartin Matuska        algs/sha2/sha2_generic.c \
762a58b312SMartin Matuska        algs/sha2/sha256_impl.c \
772a58b312SMartin Matuska        algs/sha2/sha512_impl.c \
789e5787d2SMatt Macy        algs/skein/skein.c \
799e5787d2SMatt Macy        algs/skein/skein_block.c \
809e5787d2SMatt Macy        algs/skein/skein_iv.c \
819e5787d2SMatt Macy        illumos-crypto.c \
829e5787d2SMatt Macy        io/aes.c \
839e5787d2SMatt Macy        io/sha2_mod.c \
849e5787d2SMatt Macy        core/kcf_sched.c \
859e5787d2SMatt Macy        core/kcf_prov_lib.c \
869e5787d2SMatt Macy        core/kcf_callprov.c \
879e5787d2SMatt Macy        core/kcf_mech_tabs.c \
889e5787d2SMatt Macy        core/kcf_prov_tabs.c \
899e5787d2SMatt Macy        $(ASM_SOURCES_C)
909e5787d2SMatt Macy
912a58b312SMartin Matuska.PATH: ${SRCTOP}/sys/contrib/openzfs/module/zfs
922a58b312SMartin MatuskaKERNEL_C+=	zfs_impl.c
939e5787d2SMatt Macy
949e5787d2SMatt MacySRCS= $(ASM_SOURCES_AS) $(KERNEL_C)
959e5787d2SMatt Macy
969e5787d2SMatt MacyWARNS?=	2
979e5787d2SMatt MacySHLIB_MAJOR= 3
989e5787d2SMatt MacyCSTD=	c99
999e5787d2SMatt MacyCFLAGS+= -DIN_BASE
1009e5787d2SMatt MacyCFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include
1019e5787d2SMatt MacyCFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/
1029e5787d2SMatt MacyCFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd
1039e5787d2SMatt MacyCFLAGS+= -I${SRCTOP}/sys
1049e5787d2SMatt MacyCFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include
1059e5787d2SMatt MacyCFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include
106*e2df9bb4SMartin MatuskaCFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzpool/include
1079e5787d2SMatt MacyCFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h
1089e5787d2SMatt MacyCFLAGS+= -DHAVE_ISSETUGID
1099e5787d2SMatt MacyCFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h
1109e5787d2SMatt Macy
1119e5787d2SMatt MacyCFLAGS.aes_amd64.S+= -DLOCORE
1129e5787d2SMatt MacyCFLAGS.aes_aesni.S+= -DLOCORE
1139e5787d2SMatt MacyCFLAGS.gcm_pclmulqdq.S+= -DLOCORE
1149e5787d2SMatt MacyCFLAGS.aesni-gcm-x86_64.S+= -DLOCORE
1159e5787d2SMatt MacyCFLAGS.ghash-x86_64.S+= -DLOCORE
1162a58b312SMartin MatuskaCFLAGS.sha256-x86_64.S+= -DLOCORE
1172a58b312SMartin MatuskaCFLAGS.sha512-x86_64.S+= -DLOCORE
1181f1e2261SMartin MatuskaCFLAGS.blake3_avx2.S = -DLOCORE
1191f1e2261SMartin MatuskaCFLAGS.blake3_avx512.S = -DLOCORE
1201f1e2261SMartin MatuskaCFLAGS.blake3_sse2.S = -DLOCORE
1211f1e2261SMartin MatuskaCFLAGS.blake3_sse41.S = -DLOCORE
1221f1e2261SMartin MatuskaCFLAGS.b3_aarch64_sse2.S = -DLOCORE
1231f1e2261SMartin MatuskaCFLAGS.b3_aarch64_sse41.S = -DLOCORE
1242a58b312SMartin MatuskaCFLAGS.sha256-armv7.S = -DLOCORE
1252a58b312SMartin MatuskaCFLAGS.sha256-armv8.S = -DLOCORE
1262a58b312SMartin MatuskaCFLAGS.sha512-armv7.S = -DLOCORE
1272a58b312SMartin MatuskaCFLAGS.sha512-armv8.S = -DLOCORE
1281f1e2261SMartin MatuskaCFLAGS.b3_ppc64le_sse2.S = -DLOCORE
1291f1e2261SMartin MatuskaCFLAGS.b3_ppc64le_sse41.S = -DLOCORE
1302a58b312SMartin MatuskaCFLAGS.sha256-p8.S = -DLOCORE
1312a58b312SMartin MatuskaCFLAGS.sha256-ppc.S = -DLOCORE
1322a58b312SMartin MatuskaCFLAGS.sha512-p8.S = -DLOCORE
1332a58b312SMartin MatuskaCFLAGS.sha512-ppc.S = -DLOCORE
1341f1e2261SMartin Matuska
1359e5787d2SMatt Macy
1367e3e70ceSJohn BaldwinLDFLAGS.bfd+= -Wl,-znoexecstack
1377e3e70ceSJohn Baldwin
1389e5787d2SMatt Macy.include <bsd.lib.mk>
139