xref: /freebsd/sys/contrib/openzfs/cmd/zpool/Makefile.am (revision 6132212808e8dccedc9e5d85fea4390c2f38059a)
1include $(top_srcdir)/config/Rules.am
2
3AM_CFLAGS += $(LIBBLKID_CFLAGS) $(LIBUUID_CFLAGS)
4
5DEFAULT_INCLUDES += -I$(srcdir)
6
7sbin_PROGRAMS = zpool
8
9zpool_SOURCES = \
10	zpool_iter.c \
11	zpool_main.c \
12	zpool_util.c \
13	zpool_util.h \
14	zpool_vdev.c
15
16if BUILD_FREEBSD
17zpool_SOURCES += os/freebsd/zpool_vdev_os.c
18endif
19
20if BUILD_LINUX
21zpool_SOURCES += os/linux/zpool_vdev_os.c
22endif
23
24zpool_LDADD = \
25	$(abs_top_builddir)/lib/libzfs/libzfs.la \
26	$(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
27	$(abs_top_builddir)/lib/libnvpair/libnvpair.la \
28	$(abs_top_builddir)/lib/libuutil/libuutil.la
29
30zpool_LDADD += $(LTLIBINTL)
31
32if BUILD_FREEBSD
33zpool_LDADD += -lgeom
34endif
35zpool_LDADD += -lm $(LIBBLKID_LIBS) $(LIBUUID_LIBS)
36
37zpoolconfdir = $(sysconfdir)/zfs/zpool.d
38zpoolexecdir = $(zfsexecdir)/zpool.d
39
40EXTRA_DIST = zpool.d/README
41
42dist_zpoolexec_SCRIPTS = \
43	zpool.d/dm-deps \
44	zpool.d/enc \
45	zpool.d/encdev \
46	zpool.d/fault_led \
47	zpool.d/iostat \
48	zpool.d/iostat-1s \
49	zpool.d/iostat-10s \
50	zpool.d/label \
51	zpool.d/locate_led \
52	zpool.d/lsblk \
53	zpool.d/media \
54	zpool.d/model \
55	zpool.d/serial \
56	zpool.d/ses \
57	zpool.d/size \
58	zpool.d/slot \
59	zpool.d/smart \
60	zpool.d/smartx \
61	zpool.d/temp \
62	zpool.d/health \
63	zpool.d/r_proc \
64	zpool.d/w_proc \
65	zpool.d/r_ucor \
66	zpool.d/w_ucor \
67	zpool.d/nonmed \
68	zpool.d/defect \
69	zpool.d/hours_on \
70	zpool.d/realloc \
71	zpool.d/rep_ucor \
72	zpool.d/cmd_to \
73	zpool.d/pend_sec \
74	zpool.d/off_ucor \
75	zpool.d/ata_err \
76	zpool.d/nvme_err \
77	zpool.d/pwr_cyc \
78	zpool.d/upath \
79	zpool.d/vendor \
80	zpool.d/smart_test \
81	zpool.d/test_type \
82	zpool.d/test_status \
83	zpool.d/test_progress \
84	zpool.d/test_ended
85
86zpoolconfdefaults = \
87	dm-deps \
88	enc \
89	encdev \
90	fault_led \
91	iostat \
92	iostat-1s \
93	iostat-10s \
94	label \
95	locate_led \
96	lsblk \
97	media \
98	model \
99	serial \
100	ses \
101	size \
102	slot \
103	smart \
104	smartx \
105	temp \
106	health \
107	r_proc \
108	w_proc \
109	r_ucor \
110	w_ucor \
111	nonmed \
112	defect \
113	hours_on \
114	realloc \
115	rep_ucor \
116	cmd_to \
117	pend_sec \
118	off_ucor \
119	ata_err \
120	nvme_err \
121	pwr_cyc \
122	upath \
123	vendor \
124	smart_test \
125	test_type \
126	test_status \
127	test_progress \
128	test_ended
129
130install-data-hook:
131	$(MKDIR_P) "$(DESTDIR)$(zpoolconfdir)"
132	for f in $(zpoolconfdefaults); do \
133	  test -f "$(DESTDIR)$(zpoolconfdir)/$${f}" -o \
134	       -L "$(DESTDIR)$(zpoolconfdir)/$${f}" || \
135	    ln -s "$(zpoolexecdir)/$${f}" "$(DESTDIR)$(zpoolconfdir)"; \
136	done
137