xref: /freebsd/cddl/lib/libicp/Makefile (revision 716fd348e01c5f2ba125f878a634a753436c2994)
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
21CFLAGS+= -D__amd64 -D_SYS_STACK_H -UHAVE_AES
22.else
23ASM_SOURCES_C =
24ASM_SOURCES_AS =
25.endif
26
27
28KERNEL_C = \
29        spi/kcf_spi.c \
30        api/kcf_ctxops.c \
31        api/kcf_cipher.c \
32        api/kcf_mac.c \
33        algs/aes/aes_impl_aesni.c \
34        algs/aes/aes_impl_generic.c \
35        algs/aes/aes_impl_x86-64.c \
36        algs/aes/aes_impl.c \
37        algs/aes/aes_modes.c \
38        algs/edonr/edonr.c \
39        algs/modes/modes.c \
40        algs/modes/cbc.c \
41        algs/modes/gcm_generic.c \
42        algs/modes/gcm_pclmulqdq.c \
43        algs/modes/gcm.c \
44        algs/modes/ctr.c \
45        algs/modes/ccm.c \
46        algs/modes/ecb.c \
47        algs/sha2/sha2.c \
48        algs/skein/skein.c \
49        algs/skein/skein_block.c \
50        algs/skein/skein_iv.c \
51        illumos-crypto.c \
52        io/aes.c \
53        io/sha2_mod.c \
54        io/skein_mod.c \
55        core/kcf_sched.c \
56        core/kcf_prov_lib.c \
57        core/kcf_callprov.c \
58        core/kcf_mech_tabs.c \
59        core/kcf_prov_tabs.c \
60        $(ASM_SOURCES_C)
61
62
63
64
65
66
67SRCS= $(ASM_SOURCES_AS) $(KERNEL_C)
68
69WARNS?=	2
70SHLIB_MAJOR= 3
71CSTD=	c99
72CFLAGS+= -DIN_BASE
73CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include
74CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/
75CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd
76CFLAGS+= -I${SRCTOP}/sys
77CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include
78CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include
79CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h
80CFLAGS+= -DHAVE_ISSETUGID
81CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h
82
83
84CFLAGS.aes_amd64.S+= -DLOCORE
85CFLAGS.aes_aesni.S+= -DLOCORE
86CFLAGS.gcm_pclmulqdq.S+= -DLOCORE
87CFLAGS.aesni-gcm-x86_64.S+= -DLOCORE
88CFLAGS.ghash-x86_64.S+= -DLOCORE
89CFLAGS.sha256_impl.S+= -DLOCORE
90CFLAGS.sha512_impl.S+= -DLOCORE
91
92.include <bsd.lib.mk>
93