1 # libguestfs virt-cat, virt-filesystems and virt-ls.
2 # Copyright (C) 2010 Red Hat Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 include $(top_srcdir)/subdir-rules.mk
24 run-filesystems-locally \
25 test-virt-filesystems.sh \
26 virt-filesystems.pod \
31 bin_PROGRAMS = virt-cat virt-filesystems virt-ls
33 SHARED_SOURCE_FILES = \
41 $(SHARED_SOURCE_FILES) \
45 -I$(top_srcdir)/src -I$(top_builddir)/src \
46 -I$(top_srcdir)/fish \
47 -I$(srcdir)/../gnulib/lib -I../gnulib/lib \
48 -DLOCALEBASEDIR=\""$(datadir)/locale"\" \
49 $(WARN_CFLAGS) $(WERROR_CFLAGS)
52 $(top_builddir)/src/libguestfs.la \
53 ../gnulib/lib/libgnu.la
55 virt_filesystems_SOURCES = \
56 $(SHARED_SOURCE_FILES) \
59 virt_filesystems_CFLAGS = \
60 -I$(top_srcdir)/src -I$(top_builddir)/src \
61 -I$(top_srcdir)/fish \
62 -I$(srcdir)/../gnulib/lib -I../gnulib/lib \
63 -DLOCALEBASEDIR=\""$(datadir)/locale"\" \
64 $(WARN_CFLAGS) $(WERROR_CFLAGS)
66 virt_filesystems_LDADD = \
67 $(top_builddir)/src/libguestfs.la \
68 ../gnulib/lib/libgnu.la
71 $(SHARED_SOURCE_FILES) \
75 -I$(top_srcdir)/src -I$(top_builddir)/src \
76 -I$(top_srcdir)/fish \
77 -I$(srcdir)/../gnulib/lib -I../gnulib/lib \
78 -DLOCALEBASEDIR=\""$(datadir)/locale"\" \
79 $(WARN_CFLAGS) $(WERROR_CFLAGS)
82 $(top_builddir)/src/libguestfs.la \
83 ../gnulib/lib/libgnu.la
85 # Manual pages and HTML files for the website.
86 man_MANS = virt-cat.1 virt-filesystems.1 virt-ls.1
89 $(top_builddir)/html/virt-cat.1.html \
90 $(top_builddir)/html/virt-filesystems.1.html \
91 $(top_builddir)/html/virt-ls.1.html
93 virt-cat.1: virt-cat.pod
96 -c "Virtualization Support" \
97 --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
98 $< > $@-t && mv $@-t $@
100 $(top_builddir)/html/virt-cat.1.html: virt-cat.pod
101 mkdir -p $(top_builddir)/html
102 cd $(top_builddir) && pod2html \
108 virt-filesystems.1: virt-filesystems.pod
111 -c "Virtualization Support" \
112 --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
113 $< > $@-t && mv $@-t $@
115 $(top_builddir)/html/virt-filesystems.1.html: virt-filesystems.pod
116 mkdir -p $(top_builddir)/html
117 cd $(top_builddir) && pod2html \
123 virt-ls.1: virt-ls.pod
126 -c "Virtualization Support" \
127 --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
128 $< > $@-t && mv $@-t $@
130 $(top_builddir)/html/virt-ls.1.html: virt-ls.pod
131 mkdir -p $(top_builddir)/html
132 cd $(top_builddir) && pod2html \
140 random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
142 TESTS_ENVIRONMENT = \
143 MALLOC_PERTURB_=$(random_val) \
144 LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
145 LIBGUESTFS_PATH=$(top_builddir)/appliance
147 TESTS = test-virt-cat.sh test-virt-filesystems.sh test-virt-ls.sh
149 # Build a partly-static binary (for the binary distribution).
151 virt-cat.static$(EXEEXT): $(virt_cat_OBJECTS) $(virt_cat_DEPENDENCIES)
152 $(top_srcdir)/relink-static.sh \
153 $(virt_cat_LINK) $(virt_cat_OBJECTS) -static $(virt_cat_LDADD) $(virt_cat_LIBS) $(LIBVIRT_LIBS) $(LIBXML2_LIBS) -lpcre -lhivex -lmagic -lz -lm
155 virt-filesystems.static$(EXEEXT): $(virt_filesystems_OBJECTS) $(virt_filesystems_DEPENDENCIES)
156 $(top_srcdir)/relink-static.sh \
157 $(virt_filesystems_LINK) $(virt_filesystems_OBJECTS) -static $(virt_filesystems_LDADD) $(virt_filesystems_LIBS) $(LIBVIRT_LIBS) $(LIBXML2_LIBS) -lpcre -lhivex -lmagic -lz -lm
159 virt-ls.static$(EXEEXT): $(virt_ls_OBJECTS) $(virt_ls_DEPENDENCIES)
160 $(top_srcdir)/relink-static.sh \
161 $(virt_ls_LINK) $(virt_ls_OBJECTS) -static $(virt_ls_LDADD) $(virt_ls_LIBS) $(LIBVIRT_LIBS) $(LIBXML2_LIBS) -lpcre -lhivex -lmagic -lz -lm