xref: /freebsd/cddl/lib/libzfs/Makefile (revision a521f2116473fbd8c09db395518f060a27d02334)
1# $FreeBSD$
2
3.PATH: ${SRCTOP}/sys/contrib/openzfs/module/icp
4.PATH: ${SRCTOP}/sys/contrib/openzfs/module/zcommon
5.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzfs
6.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzfs/os/freebsd
7.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libshare
8.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libshare/os/freebsd
9.PATH: ${SRCTOP}/sys/contrib/openzfs/include
10.PATH: ${SRCTOP}/sys/contrib/openzfs/module/zstd
11.PATH: ${SRCTOP}/sys/contrib/openzfs/module/zstd/lib
12
13PACKAGE=	runtime
14LIB=	zfs
15LIBADD= \
16	avl \
17	bsdxml \
18	crypto \
19	geom \
20	m \
21	md \
22	nvpair \
23	pthread \
24	umem \
25	util \
26	uutil \
27	z \
28	zfs_core \
29	zutil
30
31INCS=	libzfs.h
32USER_C = \
33        libzfs_changelist.c \
34        libzfs_config.c \
35        libzfs_crypto.c \
36        libzfs_dataset.c \
37        libzfs_diff.c \
38        libzfs_import.c \
39        libzfs_iter.c \
40        libzfs_mount.c \
41        libzfs_pool.c \
42        libzfs_sendrecv.c \
43        libzfs_status.c \
44        libzfs_util.c
45
46# FreeBSD
47USER_C += \
48        libzfs_compat.c \
49        libzfs_ioctl_compat.c \
50        libzfs_zmount.c
51
52# libshare
53USER_C += \
54	libshare.c \
55	nfs.c \
56	smb.c
57
58
59KERNEL_C = \
60        algs/sha2/sha2.c \
61        cityhash.c \
62        zfeature_common.c \
63        zfs_comutil.c \
64        zfs_deleg.c \
65        zfs_fletcher.c \
66        zfs_fletcher_superscalar.c \
67        zfs_fletcher_superscalar4.c \
68        zfs_namecheck.c \
69        zfs_prop.c \
70        zfs_uio.c \
71        zpool_prop.c \
72        zprop_common.c
73
74
75ARCH_C =
76.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
77ARCH_C += 	zfs_fletcher_intel.c \
78		zfs_fletcher_sse.c
79CFLAGS +=  -DHAVE_SSE2
80.endif
81.if ${MACHINE_ARCH} == "amd64"
82ARCH_C +=	zfs_fletcher_avx512.c
83CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_AVX512F
84.endif
85.if ${MACHINE_CPUARCH} == "aarch64"
86ARCH_C +=	zfs_fletcher_aarch64_neon.c
87.endif
88
89SRCS= $(USER_C) $(KERNEL_C) $(ARCH_C)
90
91WARNS?=	2
92SHLIB_MAJOR= 4
93CSTD=	c99
94CFLAGS+= -DIN_BASE
95CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include
96CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd
97CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include
98CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd
99CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libshare
100CFLAGS+= -I${SRCTOP}/sys/contrib/ck/include
101CFLAGS+= -I${SRCTOP}/sys
102CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include
103CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include
104CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h
105CFLAGS+= -DHAVE_ISSETUGID
106CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h
107
108
109.include <bsd.lib.mk>
110