xref: /freebsd/sys/contrib/openzfs/lib/libzfs/Makefile.am (revision 410556f1f10fd35b350102725fd8504c3cb0afc8)
1include $(top_srcdir)/config/Rules.am
2
3VPATH = \
4	$(top_srcdir)/module/icp \
5	$(top_srcdir)/module/zcommon \
6	$(top_srcdir)/lib/libzfs
7
8# Suppress unused but set variable warnings often due to ASSERTs
9AM_CFLAGS += $(NO_UNUSED_BUT_SET_VARIABLE)
10AM_CFLAGS += $(LIBCRYPTO_CFLAGS) $(ZLIB_CFLAGS)
11
12pkgconfig_DATA = libzfs.pc
13
14lib_LTLIBRARIES = libzfs.la
15
16include $(top_srcdir)/config/Abigail.am
17
18USER_C = \
19	libzfs_changelist.c \
20	libzfs_config.c \
21	libzfs_crypto.c \
22	libzfs_dataset.c \
23	libzfs_diff.c \
24	libzfs_import.c \
25	libzfs_iter.c \
26	libzfs_mount.c \
27	libzfs_pool.c \
28	libzfs_sendrecv.c \
29	libzfs_status.c \
30	libzfs_util.c
31
32
33if BUILD_FREEBSD
34USER_C += \
35	os/freebsd/libzfs_compat.c \
36	os/freebsd/libzfs_ioctl_compat.c \
37	os/freebsd/libzfs_zmount.c
38endif
39
40if BUILD_LINUX
41USER_C += \
42	os/linux/libzfs_mount_os.c \
43	os/linux/libzfs_pool_os.c \
44	os/linux/libzfs_sendrecv_os.c \
45	os/linux/libzfs_util_os.c
46endif
47
48KERNEL_C = \
49	algs/sha2/sha2.c \
50	cityhash.c \
51	zfeature_common.c \
52	zfs_comutil.c \
53	zfs_deleg.c \
54	zfs_fletcher.c \
55	zfs_fletcher_aarch64_neon.c \
56	zfs_fletcher_avx512.c \
57	zfs_fletcher_intel.c \
58	zfs_fletcher_sse.c \
59	zfs_fletcher_superscalar.c \
60	zfs_fletcher_superscalar4.c \
61	zfs_namecheck.c \
62	zfs_prop.c \
63	zpool_prop.c \
64	zprop_common.c
65
66dist_libzfs_la_SOURCES = \
67	$(USER_C)
68
69nodist_libzfs_la_SOURCES = \
70	$(KERNEL_C)
71
72libzfs_la_LIBADD = \
73	$(abs_top_builddir)/lib/libshare/libshare.la \
74	$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
75	$(abs_top_builddir)/lib/libnvpair/libnvpair.la \
76	$(abs_top_builddir)/lib/libuutil/libuutil.la
77
78libzfs_la_LIBADD += -lm $(LIBCRYPTO_LIBS) $(ZLIB_LIBS) $(LTLIBINTL)
79
80libzfs_la_LDFLAGS = -pthread
81
82if !ASAN_ENABLED
83libzfs_la_LDFLAGS += -Wl,-z,defs
84endif
85
86if BUILD_FREEBSD
87libzfs_la_LIBADD += -lutil -lgeom
88endif
89
90libzfs_la_LDFLAGS += -version-info 4:0:0
91
92include $(top_srcdir)/config/CppCheck.am
93
94# Library ABI
95EXTRA_DIST = libzfs.abi libzfs.suppr
96
97# Licensing data
98EXTRA_DIST += THIRDPARTYLICENSE.openssl THIRDPARTYLICENSE.openssl.descrip
99