1 # libguestfs virt-cat 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
28 bin_PROGRAMS = virt-cat virt-ls
30 SHARED_SOURCE_FILES = \
38 $(SHARED_SOURCE_FILES) \
42 -I$(top_srcdir)/src -I$(top_builddir)/src \
43 -I$(top_srcdir)/fish \
44 -I$(srcdir)/../gnulib/lib -I../gnulib/lib \
45 -DLOCALEBASEDIR=\""$(datadir)/locale"\" \
46 $(WARN_CFLAGS) $(WERROR_CFLAGS)
49 $(top_builddir)/src/libguestfs.la \
50 ../gnulib/lib/libgnu.la
53 $(SHARED_SOURCE_FILES) \
57 -I$(top_srcdir)/src -I$(top_builddir)/src \
58 -I$(top_srcdir)/fish \
59 -I$(srcdir)/../gnulib/lib -I../gnulib/lib \
60 -DLOCALEBASEDIR=\""$(datadir)/locale"\" \
61 $(WARN_CFLAGS) $(WERROR_CFLAGS)
64 $(top_builddir)/src/libguestfs.la \
65 ../gnulib/lib/libgnu.la
67 # Manual pages and HTML files for the website.
68 man_MANS = virt-cat.1 virt-ls.1
71 $(top_builddir)/html/virt-cat.1.html \
72 $(top_builddir)/html/virt-ls.1.html
74 virt-cat.1: virt-cat.pod
77 -c "Virtualization Support" \
78 --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
79 $< > $@-t && mv $@-t $@
81 $(top_builddir)/html/virt-cat.1.html: virt-cat.pod
82 mkdir -p $(top_builddir)/html
83 cd $(top_builddir) && pod2html \
89 virt-ls.1: virt-ls.pod
92 -c "Virtualization Support" \
93 --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
94 $< > $@-t && mv $@-t $@
96 $(top_builddir)/html/virt-ls.1.html: virt-ls.pod
97 mkdir -p $(top_builddir)/html
98 cd $(top_builddir) && pod2html \
106 random_val := $(shell awk 'BEGIN{srand(); print 1+int(255*rand())}' < /dev/null)
108 TESTS_ENVIRONMENT = \
109 MALLOC_PERTURB_=$(random_val) \
110 LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
111 LIBGUESTFS_PATH=$(top_builddir)/appliance
113 TESTS = test-virt-cat.sh test-virt-ls.sh
115 # Build a partly-static binary (for the binary distribution).
117 virt-cat.static$(EXEEXT): $(virt_cat_OBJECTS) $(virt_cat_DEPENDENCIES)
118 $(top_srcdir)/relink-static.sh \
119 $(virt_cat_LINK) $(virt_cat_OBJECTS) -static $(virt_cat_LDADD) $(virt_cat_LIBS) $(LIBVIRT_LIBS) $(LIBXML2_LIBS) -lpcre -lhivex -lmagic -lz -lm
121 virt-ls.static$(EXEEXT): $(virt_ls_OBJECTS) $(virt_ls_DEPENDENCIES)
122 $(top_srcdir)/relink-static.sh \
123 $(virt_ls_LINK) $(virt_ls_OBJECTS) -static $(virt_ls_LDADD) $(virt_ls_LIBS) $(LIBVIRT_LIBS) $(LIBXML2_LIBS) -lpcre -lhivex -lmagic -lz -lm