inspector: Replace old examples with ones derived from phony images.
[libguestfs.git] / inspector / Makefile.am
index 0878725..5e6828f 100644 (file)
 
 include $(top_srcdir)/subdir-rules.mk
 
+EXAMPLE_XML = \
+       example-debian.xml \
+       example-fedora.xml \
+       example-ubuntu.xml \
+       example-windows.xml
+
 EXTRA_DIST = \
        run-inspector-locally \
-       virt-inspector \
-       inspector_generator.ml
+       virt-inspector
 
+docdir = @docdir@
 dist_doc_DATA = \
        virt-inspector.rng \
-       example1.xml example2.xml example3.xml example4.xml
+       $(EXAMPLE_XML)
 
 if HAVE_INSPECTOR
 
@@ -32,7 +38,7 @@ bin_SCRIPTS = virt-inspector
 man_MANS = virt-inspector.1
 
 noinst_DATA = \
-       $(top_builddir)/html/virt-inspector.1.html stamp-inspector-generator
+       $(top_builddir)/html/virt-inspector.1.html
 
 virt-inspector.1: virt-inspector
        $(POD2MAN) \
@@ -52,20 +58,30 @@ $(top_builddir)/html/virt-inspector.1.html: virt-inspector
 
 if HAVE_XMLLINT
 
-TESTS = example1.xml example2.xml example3.xml example4.xml
+TESTS = $(EXAMPLE_XML)
 TESTS_ENVIRONMENT = $(XMLLINT) --noout --relaxng virt-inspector.rng
 
 endif
 
-if HAVE_XML_LIGHT
-stamp-inspector-generator: inspector_generator.ml
-       cd $(top_srcdir) && \
-       ocaml -warn-error A \
-         inspector/inspector_generator.ml
-       touch $@
-else
-stamp-inspector-generator:
-       touch $@
-endif
+# These rules require virt-inspector so there is no good time that we
+# can run them.  Instead you can run them by hand.
+
+example-debian.xml:
+       ./run-inspector-locally ../images/debian.img > $@
+example-fedora.xml:
+       ./run-inspector-locally ../images/fedora.img > $@
+example-ubuntu.xml:
+       ./run-inspector-locally ../images/ubuntu.img > $@
+example-windows.xml:
+       ./run-inspector-locally ../images/windows.img | fgrep -v '<uuid>' > $@
 
 endif
+
+# Make symlink from virt-inspector.pl to virt-inspector.  This is just
+# to keep xgettext happy since it uses the file extension to determine
+# the implementation language of a file.
+
+all-local: virt-inspector.pl
+
+virt-inspector.pl: virt-inspector
+       ln -sf $< $@