Version 1.10.0.
[libguestfs.git] / inspector / Makefile.am
1 # libguestfs virt-inspector
2 # Copyright (C) 2009-2011 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 include $(top_srcdir)/subdir-rules.mk
19
20 EXAMPLE_XML = \
21         example-debian.xml \
22         example-fedora.xml \
23         example-ubuntu.xml \
24         example-windows.xml \
25         example-debian-netinst-cd.xml \
26         example-fedora-dvd.xml \
27         example-fedora-netinst-cd.xml \
28         example-rhel-6-dvd.xml \
29         example-rhel-6-netinst-cd.xml \
30         example-ubuntu-live-cd.xml \
31         example-windows-2003-x64-cd.xml \
32         example-windows-2003-x86-cd.xml \
33         example-windows-xp-cd.xml
34
35 EXTRA_DIST = \
36         run-inspector-locally \
37         virt-inspector.pod
38
39 CLEANFILES = stamp-virt-inspector.pod
40
41 docdir = @docdir@
42 dist_doc_DATA = \
43         virt-inspector.rng \
44         $(EXAMPLE_XML)
45
46 if HAVE_LIBXML2
47
48 bin_PROGRAMS = virt-inspector
49
50 SHARED_SOURCE_FILES = \
51         ../fish/config.c \
52         ../fish/inspect.c \
53         ../fish/keys.c \
54         ../fish/options.h \
55         ../fish/options.c \
56         ../fish/virt.c
57
58 virt_inspector_SOURCES = \
59         $(SHARED_SOURCE_FILES) \
60         virt-inspector.c
61
62 virt_inspector_CFLAGS = \
63         -I$(top_srcdir)/src -I$(top_builddir)/src \
64         -I$(top_srcdir)/fish \
65         -I$(srcdir)/../gnulib/lib -I../gnulib/lib \
66         -DLOCALEBASEDIR=\""$(datadir)/locale"\" \
67         $(LIBXML2_CFLAGS) \
68         $(LIBCONFIG_CFLAGS) \
69         $(WARN_CFLAGS) $(WERROR_CFLAGS)
70
71 virt_inspector_LDADD = \
72         $(LIBCONFIG_LIBS) \
73         $(top_builddir)/src/libguestfs.la \
74         $(LIBXML2_LIBS) \
75         ../gnulib/lib/libgnu.la
76
77 # Manual pages and HTML files for the website.
78 man_MANS = virt-inspector.1
79 noinst_DATA = $(top_builddir)/html/virt-inspector.1.html
80
81 virt-inspector.1 $(top_builddir)/html/virt-inspector.1.html: stamp-virt-inspector.pod
82
83 stamp-virt-inspector.pod: virt-inspector.pod
84         $(top_srcdir)/podwrapper.sh \
85           --man virt-inspector.1 \
86           --html $(top_builddir)/html/virt-inspector.1.html \
87           $<
88         touch $@
89
90 if HAVE_XMLLINT
91
92 TESTS = $(EXAMPLE_XML)
93 TESTS_ENVIRONMENT = $(XMLLINT) --noout --relaxng virt-inspector.rng
94
95 endif
96
97 endif
98
99 # These rules require virt-inspector so there is no good time that we
100 # can run them.  Instead you can run them by hand.
101
102 example-debian.xml:
103         ./run-inspector-locally ../images/debian.img > $@
104 example-fedora.xml:
105         ./run-inspector-locally ../images/fedora.img > $@
106 example-ubuntu.xml:
107         ./run-inspector-locally ../images/ubuntu.img > $@
108 example-windows.xml:
109         ./run-inspector-locally ../images/windows.img | fgrep -v '<uuid>' > $@