1 # Administration utilities Makefile
3 AM_CFLAGS := -fPIC -D_GNU_SOURCE \
4 -D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DLUSTRE_UTILS=1 $(UTILS_CFLAGS)
5 AM_LDFLAGS := $(UTILS_LDFLAGS)
8 EXTRA_PROGRAMS = wirecheck
15 GSSSRC = gss/err_util.c gss/err_util.h
17 GSSSRC += gss/sk_utils.c gss/sk_utils.h
19 GSSLIB = -lcrypto -lssl -lkeyutils -lm
25 # mount only finds helpers in /sbin
26 rootsbin_PROGRAMS = mount.lustre
27 bin_SCRIPTS = llstat llobdstat plot-llstat
29 sbin_SCRIPTS = ldlm_debug_upcall
30 sbin_PROGRAMS = lctl l_getidentity llverfs lustre_rsync ll_decode_linkea \
34 sbin_PROGRAMS += wiretest
38 sbin_PROGRAMS += mkfs.lustre tunefs.lustre llverdev lr_reader lshowmount \
39 ll_decode_filter_fid llog_reader l_tunedisk
42 sbin_PROGRAMS += lhsmtool_posix
47 sbin_PROGRAMS += l_getsepol
54 libiam_a_SOURCES = libiam.c
55 lib_LIBRARIES += libiam.a
59 lib_LTLIBRARIES = liblustreapi.la
62 lctl_SOURCES = portals.c debug.c obd.c lustre_cfg.c lctl.c obdctl.h
64 lctl_SOURCES += lustre_lfsck.c lsnapshot.c
66 lctl_LDADD := liblustreapi.la $(PTHREAD_LIBS) -lyaml
67 lctl_DEPENDENCIES := liblustreapi.la
69 lfs_SOURCES = lfs.c lfs_project.c lfs_project.h
70 lfs_LDADD := liblustreapi.la -lz
71 lfs_LDADD += $(top_builddir)/lnet/utils/lnetconfig/liblnetconfig.la
72 lfs_DEPENDENCIES := liblustreapi.la
74 lustre_rsync_SOURCES = lustre_rsync.c lustre_rsync.h callvpe.c callvpe.h
75 lustre_rsync_LDADD := liblustreapi.la $(PTHREAD_LIBS)
76 lustre_rsync_DEPENDENCIES := liblustreapi.la
78 llsom_sync_LDADD := liblustreapi.la
79 llsom_sync_DEPENDENCIES := liblustreapi.la
81 lshowmount_SOURCES = lshowmount.c nidlist.c nidlist.h
82 lshowmount_LDADD := liblustreapi.la
93 BLKIDLIB = -lblkid -luuid
98 llverfs_LDADD := $(EXT2FSLIB) $(E2PLIB)
100 llverdev_LDADD := $(EXT2FSLIB) $(BLKIDLIB)
102 liblustreapi_la_SOURCES = liblustreapi.c liblustreapi_hsm.c \
103 liblustreapi_nodemap.c lustreapi_internal.h \
104 liblustreapi_json.c liblustreapi_layout.c \
105 liblustreapi_lease.c liblustreapi_util.c \
106 liblustreapi_kernelconn.c liblustreapi_param.c \
107 liblustreapi_mirror.c \
108 liblustreapi_ladvise.c liblustreapi_chlg.c \
109 liblustreapi_heat.c liblustreapi_pcc.c
110 liblustreapi_la_LDFLAGS = $(LIBREADLINE) -version-info 1:0:0 \
111 -Wl,--version-script=liblustreapi.map
112 liblustreapi_la_LIBADD = $(top_builddir)/libcfs/libcfs/libcfs.la
118 LIB_TARGETS += mount_osd_ldiskfs.so
121 LIB_TARGETS += mount_osd_zfs.so
127 $(mkinstalldirs) $(DESTDIR)$(libdir)
128 $(mkinstalldirs) $(DESTDIR)$(libdir)/lustre
129 for p in $(LIB_TARGETS); do \
130 if test -f $$p; then \
131 f="`echo $$p | sed -e 's|^.*/||'`"; \
132 echo " $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/lustre/$$f"; \
133 $(INSTALL_DATA) $$p $(DESTDIR)$(libdir)/lustre/$$f; \
138 llog_reader_SOURCES = llog_reader.c
139 llog_reader_LDADD := liblustreapi.la
140 llog_reader_DEPENDENCIES := liblustreapi.la
142 lr_reader_SOURCES = lr_reader.c
148 MNTMODLDFLAGS := -rdynamic
150 MNTMODCFLAGS := -DPLUGIN_DIR=\"${pkglibdir}\"
154 noinst_LIBRARIES += libmount_utils_zfs.a
156 libmount_utils_zfs_a_SOURCES = libmount_utils_zfs.c
157 libmount_utils_zfs_a_CPPFLAGS := -DHAVE_IOCTL_IN_UNISTD_H $(ZFS_LIBZFS_INCLUDE)
160 lib_LTLIBRARIES += libmount_utils_zfs.la
161 libmount_utils_zfs.la : libmount_utils_zfs.a
162 $(CC) $(LDFLAGS) $(MNTMODLDFLAGS) -shared -export-dynamic -pthread \
163 $(ZFS_LIBZFS_LDFLAGS) -o mount_osd_zfs.so \
164 `$(AR) -t libmount_utils_zfs.a` \
165 $(MNTMODLIBS) $(ZFS_LIBZFS_LIBS)
167 MNTMODLDFLAGS := $(ZFS_LIBZFS_LDFLAGS)
168 MNTMODLIBS := $(ZFS_LIBZFS_LIBS)
169 PLUGIN_LIB += libmount_utils_zfs.a
174 noinst_LIBRARIES += libmount_utils_ldiskfs.a
176 libmount_utils_ldiskfs_a_SOURCES = libmount_utils_ldiskfs.c
177 libmount_utils_ldiskfs_a_CPPFLAGS := $(SELINUX)
180 lib_LTLIBRARIES += libmount_utils_ldiskfs.la
181 libmount_utils_ldiskfs.la : libmount_utils_ldiskfs.a
182 $(CC) $(LDFLAGS) $(MNTMODLDFLAGS) -shared -export-dynamic \
183 -o mount_osd_ldiskfs.so \
184 `$(AR) -t libmount_utils_ldiskfs.a` \
185 $(MNTMODLIBS) $(SELINUX)
187 PLUGIN_LIB += libmount_utils_ldiskfs.a
189 endif # LDISKFS_ENABLED
191 mount_lustre_SOURCES = mount_lustre.c mount_utils.c mount_utils.h $(GSSSRC)
192 mount_lustre_CPPFLAGS := ${MNTMODCFLAGS}
193 mount_lustre_LDFLAGS := ${MNTMODLDFLAGS}
194 mount_lustre_LDADD := $(SELINUX) $(LDLIBMOUNT) $(PLUGIN_LIB) $(GSSLIB) \
195 $(top_builddir)/libcfs/libcfs/libcfs.la $(MNTMODLIBS)
197 mkfs_lustre_SOURCES = mkfs_lustre.c mount_utils.c mount_utils.h $(GSSSRC)
198 mkfs_lustre_CPPFLAGS := -UTUNEFS ${MNTMODCFLAGS}
199 mkfs_lustre_LDFLAGS := ${MNTMODLDFLAGS}
200 mkfs_lustre_LDADD := $(mount_lustre_LDADD)
202 tunefs_lustre_SOURCES = mkfs_lustre.c mount_utils.c mount_utils.h $(GSSSRC)
203 tunefs_lustre_CPPFLAGS := -DTUNEFS ${MNTMODCFLAGS}
204 tunefs_lustre_LDFLAGS := ${MNTMODLDFLAGS}
205 tunefs_lustre_LDADD := $(mkfs_lustre_LDADD)
207 l_tunedisk_SOURCES = l_tunedisk.c mount_utils.c mount_utils.h $(GSSSRC)
208 l_tunedisk_CPPFLAGS := ${MNTMODCFLAGS}
209 l_tunedisk_LDFLAGS := ${MNTMODLDFLAGS}
210 l_tunedisk_LDADD := $(mount_lustre_LDADD)
212 l_getidentity_SOURCES = l_getidentity.c
213 l_getidentity_LDADD := $(top_builddir)/libcfs/libcfs/libcfs.la
214 l_getidentity_DEPENDENCIES := $(top_builddir)/libcfs/libcfs/libcfs.la
216 lhsmtool_posix_SOURCES = lhsmtool_posix.c
217 lhsmtool_posix_LDADD := liblustreapi.la $(PTHREAD_LIBS)
218 lhsmtool_posix_DEPENDENCIES := liblustreapi.la
220 l_getsepol_SOURCES = l_getsepol.c
221 l_getsepol_LDADD := liblustreapi.la -lcrypto $(SELINUX)
222 l_getsepol_DEPENDENCIES := liblustreapi.la
224 wirecheck_SOURCES = wirecheck.c
225 wirecheck_CPPFLAGS := -DCC="\"$(CC)\""
227 wiretest_SOURCES = wiretest.c
231 EXTRA_DIST = llstat llobdstat plot-llstat ldlm_debug_upcall liblustreapi.map
233 # NOTE: this should only be run on i386.
234 newwiretest: wirehdr.c wirecheck
235 cp wirehdr.c wiretest.c
236 LANG=C ./wirecheck >> wiretest.c
237 cp ../ptlrpc/wirehdr.c ../ptlrpc/wiretest.c
238 LANG=C ./wirecheck >> ../ptlrpc/wiretest.c