# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-EXTRA_DIST = guestmount.pod
+include $(top_srcdir)/subdir-rules.mk
+
+EXTRA_DIST = guestmount.pod test-fuse.sh
if HAVE_FUSE
bin_PROGRAMS = guestmount
+# These source files (all related to option parsing) are shared
+# between guestfish and guestmount.
+SHARED_SOURCE_FILES = \
+ ../fish/inspect.c \
+ ../fish/options.h \
+ ../fish/options.c \
+ ../fish/virt.c
+
guestmount_SOURCES = \
+ $(SHARED_SOURCE_FILES) \
dircache.c \
dircache.h \
guestmount.c \
guestmount_CFLAGS = \
-I$(top_srcdir)/src -I$(top_builddir)/src \
+ -I$(top_srcdir)/fish \
-I$(srcdir)/../gnulib/lib -I../gnulib/lib \
-DGUESTFS_DEFAULT_PATH='"$(libdir)/guestfs"' \
- $(FUSE_CFLAGS) \
+ -DLOCALEBASEDIR=\""$(datadir)/locale"\" \
+ $(FUSE_CFLAGS) $(LIBVIRT_CFLAGS) $(LIBXML2_CFLAGS) \
$(WARN_CFLAGS) $(WERROR_CFLAGS)
guestmount_LDADD = \
$(FUSE_LIBS) -lulockmgr \
+ $(LIBVIRT_LIBS) $(LIBXML2_LIBS) \
$(top_builddir)/src/libguestfs.la \
../gnulib/lib/libgnu.la
+# Build a partly-static library (for the binary distribution).
+
+guestmount.static$(EXEEXT): $(guestmount_OBJECTS) $(guestmount_DEPENDENCIES)
+ $(top_srcdir)/relink-static.sh \
+ $(guestmount_LINK) $(guestmount_OBJECTS) -static $(guestmount_LDADD) $(guestmount_LIBS) -lpcre -lhivex -lmagic -lz -lm
+
# Documentation.
man_MANS = guestmount.1