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