Remove ad-hoc run*locally scripts, replace with './run'
[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         virt-inspector.pod
37
38 CLEANFILES = stamp-virt-inspector.pod
39
40 docdir = @docdir@
41 dist_doc_DATA = \
42         virt-inspector.rng \
43         $(EXAMPLE_XML)
44
45 if HAVE_LIBXML2
46
47 bin_PROGRAMS = virt-inspector
48
49 SHARED_SOURCE_FILES = \
50         ../fish/config.c \
51         ../fish/inspect.c \
52         ../fish/keys.c \
53         ../fish/options.h \
54         ../fish/options.c \
55         ../fish/virt.c
56
57 virt_inspector_SOURCES = \
58         $(SHARED_SOURCE_FILES) \
59         virt-inspector.c
60
61 virt_inspector_CFLAGS = \
62         -I$(top_srcdir)/src -I$(top_builddir)/src \
63         -I$(top_srcdir)/fish \
64         -I$(srcdir)/../gnulib/lib -I../gnulib/lib \
65         -DLOCALEBASEDIR=\""$(datadir)/locale"\" \
66         $(LIBXML2_CFLAGS) \
67         $(LIBCONFIG_CFLAGS) \
68         $(WARN_CFLAGS) $(WERROR_CFLAGS)
69
70 virt_inspector_LDADD = \
71         $(LIBCONFIG_LIBS) \
72         $(top_builddir)/src/libguestfs.la \
73         $(LIBXML2_LIBS) \
74         ../gnulib/lib/libgnu.la
75
76 # Manual pages and HTML files for the website.
77 man_MANS = virt-inspector.1
78 noinst_DATA = $(top_builddir)/html/virt-inspector.1.html
79
80 virt-inspector.1 $(top_builddir)/html/virt-inspector.1.html: stamp-virt-inspector.pod
81
82 stamp-virt-inspector.pod: virt-inspector.pod
83         $(top_srcdir)/podwrapper.sh \
84           --man virt-inspector.1 \
85           --html $(top_builddir)/html/virt-inspector.1.html \
86           $<
87         touch $@
88
89 if HAVE_XMLLINT
90
91 TESTS = $(EXAMPLE_XML)
92 TESTS_ENVIRONMENT = $(XMLLINT) --noout --relaxng virt-inspector.rng
93
94 endif
95
96 endif
97
98 # These rules require virt-inspector so there is no good time that we
99 # can run them.  Instead you can run them by hand.
100
101 example-debian.xml:
102         rm -f $@ $@-t
103         ../run $(builddir)/virt-inspector ../images/debian.img > $@-t
104         mv $@-t $@
105 example-fedora.xml:
106         rm -f $@ $@-t
107         ../run $(builddir)/virt-inspector ../images/fedora.img > $@-t
108         mv $@-t $@
109 example-ubuntu.xml:
110         rm -f $@ $@-t
111         ../run $(builddir)/virt-inspector ../images/ubuntu.img > $@-t
112         mv $@-t $@
113 example-windows.xml:
114         rm -f $@ $@-t
115         ../run $(builddir)/virt-inspector ../images/windows.img | \
116             fgrep -v '<uuid>' > $@-t
117         mv $@-t $@