New tool: virt-tar
[libguestfs.git] / tools / Makefile.am
1 # libguestfs virt-* tools
2 # Copyright (C) 2009 Red Hat Inc.
3 #
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.
8 #
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.
13 #
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.
17
18 tools = cat df edit rescue tar
19
20 EXTRA_DIST = \
21         run-locally \
22         $(tools:%=virt-%)
23
24 if HAVE_TOOLS
25
26 bin_SCRIPTS = $(tools:%=virt-%)
27
28 # XXX Bug in automake?  If you list virt-cat.1 explicitly, then it
29 # builds and installs the man pages.  However if this is removed,
30 # then the man pages are neither built nor installed.
31 man_MANS = virt-cat.1 $(patsubst %,virt-%.1,$(filter-out cat,$(tools)))
32
33 noinst_DATA = $(tools:%=$(top_builddir)/html/virt-%.1.html)
34
35 virt-%.1: virt-%
36         $(POD2MAN) \
37           --section 1 \
38           -c "Virtualization Support" \
39           --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
40           $< > $@-t && mv $@-t $@
41
42 $(top_builddir)/html/virt-%.1.html: virt-%
43         mkdir -p $(top_builddir)/html
44         cd $(top_builddir) && pod2html \
45           --css 'pod.css' \
46           --htmldir html \
47           --outfile html/$<.1.html \
48           tools/$<
49
50 endif