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