xref: /freebsd/sys/contrib/openzfs/cmd/zpool/Makefile.am (revision 3332f1b444d4a73238e9f59cca27bfc95fe936bd)
1include $(top_srcdir)/config/Rules.am
2include $(top_srcdir)/config/Shellcheck.am
3
4AM_CFLAGS += $(LIBBLKID_CFLAGS) $(LIBUUID_CFLAGS)
5
6DEFAULT_INCLUDES += -I$(srcdir)
7
8sbin_PROGRAMS = zpool
9
10zpool_SOURCES = \
11	zpool_iter.c \
12	zpool_main.c \
13	zpool_util.c \
14	zpool_util.h \
15	zpool_vdev.c
16
17if BUILD_FREEBSD
18zpool_SOURCES += os/freebsd/zpool_vdev_os.c
19endif
20
21if BUILD_LINUX
22zpool_SOURCES += os/linux/zpool_vdev_os.c
23endif
24
25zpool_LDADD = \
26	$(abs_top_builddir)/lib/libzfs/libzfs.la \
27	$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
28	$(abs_top_builddir)/lib/libnvpair/libnvpair.la \
29	$(abs_top_builddir)/lib/libuutil/libuutil.la \
30	$(abs_top_builddir)/lib/libzutil/libzutil.la
31
32zpool_LDADD += $(LTLIBINTL)
33
34if BUILD_FREEBSD
35zpool_LDADD += -lgeom
36endif
37zpool_LDADD += -lm $(LIBBLKID_LIBS) $(LIBUUID_LIBS)
38
39include $(top_srcdir)/config/CppCheck.am
40
41zpoolconfdir = $(sysconfdir)/zfs/zpool.d
42zpoolexecdir = $(zfsexecdir)/zpool.d
43
44EXTRA_DIST = zpool.d/README compatibility.d
45
46dist_zpoolexec_SCRIPTS = \
47	zpool.d/dm-deps \
48	zpool.d/enc \
49	zpool.d/encdev \
50	zpool.d/fault_led \
51	zpool.d/iostat \
52	zpool.d/iostat-1s \
53	zpool.d/iostat-10s \
54	zpool.d/label \
55	zpool.d/locate_led \
56	zpool.d/lsblk \
57	zpool.d/media \
58	zpool.d/model \
59	zpool.d/serial \
60	zpool.d/ses \
61	zpool.d/size \
62	zpool.d/slot \
63	zpool.d/smart \
64	zpool.d/smartx \
65	zpool.d/temp \
66	zpool.d/health \
67	zpool.d/r_proc \
68	zpool.d/w_proc \
69	zpool.d/r_ucor \
70	zpool.d/w_ucor \
71	zpool.d/nonmed \
72	zpool.d/defect \
73	zpool.d/hours_on \
74	zpool.d/realloc \
75	zpool.d/rep_ucor \
76	zpool.d/cmd_to \
77	zpool.d/pend_sec \
78	zpool.d/off_ucor \
79	zpool.d/ata_err \
80	zpool.d/nvme_err \
81	zpool.d/pwr_cyc \
82	zpool.d/upath \
83	zpool.d/vendor \
84	zpool.d/smart_test \
85	zpool.d/test_type \
86	zpool.d/test_status \
87	zpool.d/test_progress \
88	zpool.d/test_ended
89
90zpoolconfdefaults = \
91	dm-deps \
92	enc \
93	encdev \
94	fault_led \
95	iostat \
96	iostat-1s \
97	iostat-10s \
98	label \
99	locate_led \
100	lsblk \
101	media \
102	model \
103	serial \
104	ses \
105	size \
106	slot \
107	smart \
108	smartx \
109	temp \
110	health \
111	r_proc \
112	w_proc \
113	r_ucor \
114	w_ucor \
115	nonmed \
116	defect \
117	hours_on \
118	realloc \
119	rep_ucor \
120	cmd_to \
121	pend_sec \
122	off_ucor \
123	ata_err \
124	nvme_err \
125	pwr_cyc \
126	upath \
127	vendor \
128	smart_test \
129	test_type \
130	test_status \
131	test_progress \
132	test_ended
133
134zpoolcompatdir = $(pkgdatadir)/compatibility.d
135
136dist_zpoolcompat_DATA = \
137	compatibility.d/compat-2018 \
138	compatibility.d/compat-2019 \
139	compatibility.d/compat-2020 \
140	compatibility.d/compat-2021 \
141	compatibility.d/freebsd-11.0 \
142	compatibility.d/freebsd-11.2 \
143	compatibility.d/freebsd-11.3 \
144	compatibility.d/freenas-9.10.2 \
145	compatibility.d/grub2 \
146	compatibility.d/openzfsonosx-1.7.0 \
147	compatibility.d/openzfsonosx-1.8.1 \
148	compatibility.d/openzfsonosx-1.9.3 \
149	compatibility.d/openzfs-2.0-freebsd \
150	compatibility.d/openzfs-2.0-linux \
151	compatibility.d/openzfs-2.1-freebsd \
152	compatibility.d/openzfs-2.1-linux \
153	compatibility.d/zol-0.6.1 \
154	compatibility.d/zol-0.6.4 \
155	compatibility.d/zol-0.6.5 \
156	compatibility.d/zol-0.7 \
157	compatibility.d/zol-0.8
158
159# canonical <- alias symbolic link pairs
160# eg: "2018" is a link to "compat-2018"
161zpoolcompatlinks = \
162	"compat-2018		2018" \
163	"compat-2019		2019" \
164	"compat-2020		2020" \
165	"compat-2021		2021" \
166	"freebsd-11.0		freebsd-11.1" \
167	"freebsd-11.0		freenas-11.0" \
168	"freebsd-11.2		freenas-11.2" \
169	"freebsd-11.3		freebsd-11.4" \
170	"freebsd-11.3		freebsd-12.0" \
171	"freebsd-11.3		freebsd-12.1" \
172	"freebsd-11.3		freebsd-12.2" \
173	"freebsd-11.3		freenas-11.3" \
174	"freenas-11.0		freenas-11.1" \
175	"openzfsonosx-1.9.3	openzfsonosx-1.9.4" \
176	"openzfs-2.0-freebsd	truenas-12.0" \
177	"zol-0.7		ubuntu-18.04" \
178	"zol-0.8		ubuntu-20.04"
179
180install-data-hook:
181	$(MKDIR_P) "$(DESTDIR)$(zpoolconfdir)"
182	for f in $(zpoolconfdefaults); do \
183	  test -f "$(DESTDIR)$(zpoolconfdir)/$${f}" -o \
184	       -L "$(DESTDIR)$(zpoolconfdir)/$${f}" || \
185	    ln -s "$(zpoolexecdir)/$${f}" "$(DESTDIR)$(zpoolconfdir)"; \
186	done
187	for l in $(zpoolcompatlinks); do \
188		(cd "$(DESTDIR)$(zpoolcompatdir)"; ln -sf $${l} ); \
189	done
190