xref: /freebsd/cddl/lib/libicp_rescue/Makefile (revision e2df9bb44109577475aeb186e7186ac040f9bde1)
19e5787d2SMatt Macy.PATH: ${SRCTOP}/sys/contrib/openzfs/module/icp
29e5787d2SMatt Macy
3b5fc9e35SEmmanuel VadotPACKAGE=	utilities
49e5787d2SMatt MacyLIB=	icp_rescue
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 \
142a58b312SMartin Matuska        asm-x86_64/sha2/sha256-x86_64.S \
152a58b312SMartin Matuska        asm-x86_64/sha2/sha512-x86_64.S \
161f1e2261SMartin Matuska        asm-x86_64/blake3/blake3_avx2.S \
171f1e2261SMartin Matuska        asm-x86_64/blake3/blake3_avx512.S \
181f1e2261SMartin Matuska        asm-x86_64/blake3/blake3_sse2.S \
191f1e2261SMartin Matuska        asm-x86_64/blake3/blake3_sse41.S
209e5787d2SMatt Macy
219e5787d2SMatt MacyCFLAGS+= -D__amd64 -D_SYS_STACK_H
22bc6051a0SDimitry Andric.elif ${MACHINE_CPUARCH} == "arm"
232a58b312SMartin MatuskaASM_SOURCES_C =
242a58b312SMartin MatuskaASM_SOURCES_AS = \
252a58b312SMartin Matuska        asm-arm/sha2/sha256-armv7.S \
262a58b312SMartin Matuska        asm-arm/sha2/sha512-armv7.S
271f1e2261SMartin Matuska.elif ${MACHINE_ARCH} == "aarch64"
281f1e2261SMartin MatuskaASM_SOURCES_C =
291f1e2261SMartin MatuskaASM_SOURCES_AS = \
301f1e2261SMartin Matuska        asm-aarch64/blake3/b3_aarch64_sse2.S \
312a58b312SMartin Matuska        asm-aarch64/blake3/b3_aarch64_sse41.S \
322a58b312SMartin Matuska        asm-aarch64/sha2/sha256-armv8.S \
332a58b312SMartin Matuska        asm-aarch64/sha2/sha512-armv8.S
342a58b312SMartin Matuska.elif ${MACHINE_ARCH} == "powerpc64"
352a58b312SMartin MatuskaASM_SOURCES_C =
362a58b312SMartin MatuskaASM_SOURCES_AS = \
372a58b312SMartin Matuska        asm-ppc64/sha2/sha256-ppc.S \
382a58b312SMartin Matuska        asm-ppc64/sha2/sha512-ppc.S \
392a58b312SMartin Matuska        asm-ppc64/sha2/sha256-p8.S \
402a58b312SMartin Matuska        asm-ppc64/sha2/sha512-p8.S
41b0a8333aSJessica Clarke.elif ${MACHINE_ARCH} == "powerpc64le"
421f1e2261SMartin MatuskaASM_SOURCES_C =
431f1e2261SMartin MatuskaASM_SOURCES_AS = \
441f1e2261SMartin Matuska        asm-ppc64/blake3/b3_ppc64le_sse2.S \
452a58b312SMartin Matuska        asm-ppc64/blake3/b3_ppc64le_sse41.S \
462a58b312SMartin Matuska        asm-ppc64/sha2/sha256-ppc.S \
472a58b312SMartin Matuska        asm-ppc64/sha2/sha512-ppc.S \
482a58b312SMartin Matuska        asm-ppc64/sha2/sha256-p8.S \
492a58b312SMartin Matuska        asm-ppc64/sha2/sha512-p8.S
509e5787d2SMatt Macy.else
519e5787d2SMatt MacyASM_SOURCES_C =
529e5787d2SMatt MacyASM_SOURCES_AS =
539e5787d2SMatt Macy.endif
549e5787d2SMatt Macy
559e5787d2SMatt MacyKERNEL_C = \
569e5787d2SMatt Macy        spi/kcf_spi.c \
579e5787d2SMatt Macy        api/kcf_ctxops.c \
589e5787d2SMatt Macy        api/kcf_cipher.c \
599e5787d2SMatt Macy        api/kcf_mac.c \
609e5787d2SMatt Macy        algs/aes/aes_impl_aesni.c \
619e5787d2SMatt Macy        algs/aes/aes_impl_generic.c \
629e5787d2SMatt Macy        algs/aes/aes_impl_x86-64.c \
639e5787d2SMatt Macy        algs/aes/aes_impl.c \
649e5787d2SMatt Macy        algs/aes/aes_modes.c \
651f1e2261SMartin Matuska        algs/blake3/blake3.c \
661f1e2261SMartin Matuska        algs/blake3/blake3_generic.c \
671f1e2261SMartin Matuska        algs/blake3/blake3_impl.c \
689e5787d2SMatt Macy        algs/edonr/edonr.c \
699e5787d2SMatt Macy        algs/modes/modes.c \
709e5787d2SMatt Macy        algs/modes/gcm_generic.c \
719e5787d2SMatt Macy        algs/modes/gcm_pclmulqdq.c \
729e5787d2SMatt Macy        algs/modes/gcm.c \
739e5787d2SMatt Macy        algs/modes/ccm.c \
742a58b312SMartin Matuska        algs/sha2/sha2_generic.c \
752a58b312SMartin Matuska        algs/sha2/sha256_impl.c \
762a58b312SMartin Matuska        algs/sha2/sha512_impl.c \
779e5787d2SMatt Macy        algs/skein/skein_block.c \
789e5787d2SMatt Macy        illumos-crypto.c \
799e5787d2SMatt Macy        io/aes.c \
809e5787d2SMatt Macy        io/sha2_mod.c \
819e5787d2SMatt Macy        core/kcf_sched.c \
829e5787d2SMatt Macy        core/kcf_prov_lib.c \
839e5787d2SMatt Macy        core/kcf_callprov.c \
849e5787d2SMatt Macy        core/kcf_mech_tabs.c \
859e5787d2SMatt Macy        core/kcf_prov_tabs.c \
869e5787d2SMatt Macy        $(ASM_SOURCES_C)
879e5787d2SMatt Macy
882a58b312SMartin Matuska.PATH: ${SRCTOP}/sys/contrib/openzfs/module/zfs
892a58b312SMartin MatuskaKERNEL_C+=	zfs_impl.c
902a58b312SMartin Matuska
919e5787d2SMatt MacySRCS= $(ASM_SOURCES_AS) $(KERNEL_C)
929e5787d2SMatt Macy
939e5787d2SMatt MacyWARNS?=	2
949e5787d2SMatt MacySHLIB_MAJOR= 3
959e5787d2SMatt MacyCSTD=	c99
969e5787d2SMatt MacyCFLAGS+= -DIN_BASE
979e5787d2SMatt MacyCFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include
989e5787d2SMatt MacyCFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/
999e5787d2SMatt MacyCFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd
1009e5787d2SMatt MacyCFLAGS+= -I${SRCTOP}/sys
1019e5787d2SMatt MacyCFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include
1029e5787d2SMatt MacyCFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include
103*e2df9bb4SMartin MatuskaCFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzpool/include
1049e5787d2SMatt MacyCFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h
1059e5787d2SMatt MacyCFLAGS+= -DHAVE_ISSETUGID -UHAVE_AVX -DRESCUE
1069e5787d2SMatt MacyCFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h
1079e5787d2SMatt Macy
1089e5787d2SMatt MacyCFLAGS.aes_amd64.S+= -DLOCORE
1099e5787d2SMatt MacyCFLAGS.aes_aesni.S+= -DLOCORE
1109e5787d2SMatt MacyCFLAGS.gcm_pclmulqdq.S+= -DLOCORE
1119e5787d2SMatt MacyCFLAGS.aesni-gcm-x86_64.S+= -DLOCORE
1129e5787d2SMatt MacyCFLAGS.ghash-x86_64.S+= -DLOCORE
1132a58b312SMartin MatuskaCFLAGS.sha256-x86_64.S+= -DLOCORE
1142a58b312SMartin MatuskaCFLAGS.sha512-x86_64.S+= -DLOCORE
1159e5787d2SMatt MacyCFLAGS.gcm.c+= -UCAN_USE_GCM_ASM
1161f1e2261SMartin MatuskaCFLAGS.blake3_avx2.S = -DLOCORE
1171f1e2261SMartin MatuskaCFLAGS.blake3_avx512.S = -DLOCORE
1181f1e2261SMartin MatuskaCFLAGS.blake3_sse2.S = -DLOCORE
1191f1e2261SMartin MatuskaCFLAGS.blake3_sse41.S = -DLOCORE
1201f1e2261SMartin MatuskaCFLAGS.b3_aarch64_sse2.S = -DLOCORE
1211f1e2261SMartin MatuskaCFLAGS.b3_aarch64_sse41.S = -DLOCORE
1222a58b312SMartin MatuskaCFLAGS.sha256-armv7.S = -DLOCORE
1232a58b312SMartin MatuskaCFLAGS.sha512-armv7.S = -DLOCORE
1242a58b312SMartin MatuskaCFLAGS.sha256-armv8.S = -DLOCORE
1252a58b312SMartin MatuskaCFLAGS.sha512-armv8.S = -DLOCORE
1261f1e2261SMartin MatuskaCFLAGS.b3_ppc64le_sse2.S = -DLOCORE
1271f1e2261SMartin MatuskaCFLAGS.b3_ppc64le_sse41.S = -DLOCORE
1282a58b312SMartin MatuskaCFLAGS.sha256-ppc.S = -DLOCORE
1292a58b312SMartin MatuskaCFLAGS.sha256-p8.S = -DLOCORE
1302a58b312SMartin MatuskaCFLAGS.sha512-ppc.S = -DLOCORE
1312a58b312SMartin MatuskaCFLAGS.sha512-p8.S = -DLOCORE
1329e5787d2SMatt Macy
1337e3e70ceSJohn BaldwinLDFLAGS.bfd+= -Wl,-znoexecstack
1347e3e70ceSJohn Baldwin
1359e5787d2SMatt Macy.include <bsd.lib.mk>
136