xref: /freebsd/cddl/lib/libzfs/Makefile (revision cab6a39d7b343596a5823e65c0f7b426551ec22d)
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/include
9.PATH: ${SRCTOP}/sys/contrib/openzfs/module/zstd
10.PATH: ${SRCTOP}/sys/contrib/openzfs/module/zstd/lib
11
12PACKAGE=	runtime
13LIB=	zfs
14LIBADD= \
15	avl \
16	bsdxml \
17	crypto \
18	geom \
19	m \
20	md \
21	nvpair \
22	pthread \
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_ioctl_compat.c \
49        libzfs_zmount.c
50
51# libshare
52USER_C += \
53	libshare.c \
54	nfs.c \
55	os/freebsd/nfs.c \
56	os/freebsd/smb.c
57
58KERNEL_C = \
59        algs/sha2/sha2.c \
60        cityhash.c \
61        zfeature_common.c \
62        zfs_comutil.c \
63        zfs_deleg.c \
64        zfs_fletcher.c \
65        zfs_fletcher_superscalar.c \
66        zfs_fletcher_superscalar4.c \
67        zfs_namecheck.c \
68        zfs_prop.c \
69        zpool_prop.c \
70        zprop_common.c
71
72
73ARCH_C =
74.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
75ARCH_C += 	zfs_fletcher_intel.c \
76		zfs_fletcher_sse.c
77CFLAGS +=  -DHAVE_SSE2
78.endif
79.if ${MACHINE_ARCH} == "amd64"
80ARCH_C +=	zfs_fletcher_avx512.c
81CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_AVX512F
82.endif
83.if ${MACHINE_CPUARCH} == "aarch64"
84ARCH_C +=	zfs_fletcher_aarch64_neon.c
85.endif
86
87SRCS= $(USER_C) $(KERNEL_C) $(ARCH_C)
88
89WARNS?=	2
90SHLIB_MAJOR= 4
91CSTD=	c99
92CFLAGS+= -DIN_BASE
93CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include
94CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd
95CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include
96CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd
97CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libshare
98CFLAGS+= -I${SRCTOP}/sys/contrib/ck/include
99CFLAGS+= -I${SRCTOP}/sys
100CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include
101CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include
102CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h
103CFLAGS+= -DHAVE_ISSETUGID
104CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h
105CFLAGS+= -DSYSCONFDIR=\"/etc\"
106CFLAGS+= -DPKGDATADIR=\"/usr/share/zfs\"
107
108
109.include <bsd.lib.mk>
110