xref: /freebsd/cddl/lib/libicp/Makefile (revision 924226fba12cc9a228c73b956e1b7fa24c60b055)
1# $FreeBSD$
2
3.PATH: ${SRCTOP}/sys/contrib/openzfs/module/icp
4
5PACKAGE=	utilities
6LIB=	icp
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/modes/ghash-x86_64.S \
18        asm-x86_64/sha2/sha256_impl.S \
19        asm-x86_64/sha2/sha512_impl.S \
20        asm-x86_64/blake3/blake3_avx2.S \
21        asm-x86_64/blake3/blake3_avx512.S \
22        asm-x86_64/blake3/blake3_sse2.S \
23        asm-x86_64/blake3/blake3_sse41.S
24
25CFLAGS+= -D__amd64 -D_SYS_STACK_H -UHAVE_AES
26.elif ${MACHINE_ARCH} == "aarch64"
27ASM_SOURCES_C =
28ASM_SOURCES_AS = \
29        asm-aarch64/blake3/b3_aarch64_sse2.S \
30        asm-aarch64/blake3/b3_aarch64_sse41.S
31.elif ${MACHINE_ARCH} == "powerpc64"
32ASM_SOURCES_C =
33ASM_SOURCES_AS = \
34        asm-ppc64/blake3/b3_ppc64le_sse2.S \
35        asm-ppc64/blake3/b3_ppc64le_sse41.S
36.else
37ASM_SOURCES_C =
38ASM_SOURCES_AS =
39.endif
40
41
42KERNEL_C = \
43        spi/kcf_spi.c \
44        api/kcf_ctxops.c \
45        api/kcf_cipher.c \
46        api/kcf_mac.c \
47        algs/aes/aes_impl_aesni.c \
48        algs/aes/aes_impl_generic.c \
49        algs/aes/aes_impl_x86-64.c \
50        algs/aes/aes_impl.c \
51        algs/aes/aes_modes.c \
52        algs/blake3/blake3.c \
53        algs/blake3/blake3_generic.c \
54        algs/blake3/blake3_impl.c \
55        algs/blake3/blake3_x86-64.c \
56        algs/edonr/edonr.c \
57        algs/modes/modes.c \
58        algs/modes/cbc.c \
59        algs/modes/gcm_generic.c \
60        algs/modes/gcm_pclmulqdq.c \
61        algs/modes/gcm.c \
62        algs/modes/ctr.c \
63        algs/modes/ccm.c \
64        algs/modes/ecb.c \
65        algs/sha2/sha2.c \
66        algs/skein/skein.c \
67        algs/skein/skein_block.c \
68        algs/skein/skein_iv.c \
69        illumos-crypto.c \
70        io/aes.c \
71        io/sha2_mod.c \
72        io/skein_mod.c \
73        core/kcf_sched.c \
74        core/kcf_prov_lib.c \
75        core/kcf_callprov.c \
76        core/kcf_mech_tabs.c \
77        core/kcf_prov_tabs.c \
78        $(ASM_SOURCES_C)
79
80
81
82
83
84
85SRCS= $(ASM_SOURCES_AS) $(KERNEL_C)
86
87WARNS?=	2
88SHLIB_MAJOR= 3
89CSTD=	c99
90CFLAGS+= -DIN_BASE
91CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include
92CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/
93CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd
94CFLAGS+= -I${SRCTOP}/sys
95CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include
96CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include
97CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h
98CFLAGS+= -DHAVE_ISSETUGID
99CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h
100
101
102CFLAGS.aes_amd64.S+= -DLOCORE
103CFLAGS.aes_aesni.S+= -DLOCORE
104CFLAGS.gcm_pclmulqdq.S+= -DLOCORE
105CFLAGS.aesni-gcm-x86_64.S+= -DLOCORE
106CFLAGS.ghash-x86_64.S+= -DLOCORE
107CFLAGS.sha256_impl.S+= -DLOCORE
108CFLAGS.sha512_impl.S+= -DLOCORE
109CFLAGS.blake3_avx2.S = -DLOCORE
110CFLAGS.blake3_avx512.S = -DLOCORE
111CFLAGS.blake3_sse2.S = -DLOCORE
112CFLAGS.blake3_sse41.S = -DLOCORE
113CFLAGS.b3_aarch64_sse2.S = -DLOCORE
114CFLAGS.b3_aarch64_sse41.S = -DLOCORE
115CFLAGS.b3_ppc64le_sse2.S = -DLOCORE
116CFLAGS.b3_ppc64le_sse41.S = -DLOCORE
117
118
119.include <bsd.lib.mk>
120