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