xref: /illumos-gate/usr/src/lib/libzfs/Makefile.com (revision 02ac56e010f18fc0c5aafe47377586d8ba8c897c)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21#
22# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23# Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
24# Copyright (c) 2011, 2017 by Delphix. All rights reserved.
25# Copyright 2020 Joyent, Inc.
26# Copyright 2024 Oxide Computer Company
27#
28
29LIBRARY= libzfs.a
30VERS= .1
31
32amd64_OBJS_SHARED=		\
33	zfs_fletcher_avx512.o	\
34	zfs_fletcher_intel.o	\
35	zfs_fletcher_sse.o
36
37OBJS_SHARED=				\
38	$($(MACH64)_OBJS_SHARED)	\
39	zfeature_common.o		\
40	zfs_comutil.o			\
41	zfs_deleg.o			\
42	zfs_fletcher.o			\
43	zfs_fletcher_superscalar.o	\
44	zfs_fletcher_superscalar4.o	\
45	zfs_namecheck.o			\
46	zfs_prop.o			\
47	zpool_prop.o			\
48	zprop_common.o
49
50OBJS_COMMON=			\
51	libzfs_changelist.o	\
52	libzfs_config.o		\
53	libzfs_crypto.o		\
54	libzfs_dataset.o	\
55	libzfs_diff.o		\
56	libzfs_fru.o		\
57	libzfs_import.o		\
58	libzfs_iter.o		\
59	libzfs_mount.o		\
60	libzfs_pool.o		\
61	libzfs_sendrecv.o	\
62	libzfs_status.o		\
63	libzfs_util.o		\
64	libzfs_taskq.o
65
66OBJECTS= $(OBJS_COMMON) $(OBJS_SHARED)
67
68include ../../Makefile.lib
69
70# libzfs must be installed in the root filesystem for mount(8)
71include ../../Makefile.rootfs
72
73LIBS=	$(DYNLIB)
74
75SRCDIR =	../common
76
77INCS += -I$(SRCDIR)
78INCS += -I../../../uts/common/fs/zfs
79INCS += -I../../../common/zfs
80INCS += -I../../libc/inc
81INCS += -I../../libzutil/common
82
83CSTD=	$(CSTD_GNU99)
84LDLIBS +=	-lc -lm -ldevid -lgen -lnvpair -luutil -lavl -lefi \
85	-lidmap -ltsol -lcryptoutil -lpkcs11 -lmd -lumem -lzfs_core \
86	-ldevinfo -lzutil
87CPPFLAGS +=	$(INCS) -D_LARGEFILE64_SOURCE=1 -D_REENTRANT
88$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
89
90# not linted
91SMATCH=off
92
93LDLIBS +=	-lz
94NATIVE_LIBS += libz.so
95
96SRCS=	$(OBJS_COMMON:%.o=$(SRCDIR)/%.c)	\
97	$(OBJS_SHARED:%.o=$(SRC)/common/zfs/%.c)
98
99.KEEP_STATE:
100
101all: $(LIBS)
102
103pics/%.o: ../../../common/zfs/%.c
104	$(COMPILE.c) -o $@ $<
105	$(POST_PROCESS_O)
106
107include ../../Makefile.targ
108