# libguestfs virt-v2v tool
# Copyright (C) 2009-2025 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

include $(top_srcdir)/subdir-rules.mk

EXTRA_DIST = \
	test-docs.sh \
	virt-v2v.pod \
	virt-v2v-hacking.pod \
	virt-v2v-input-vmware.pod \
	virt-v2v-input-xen.pod \
	virt-v2v-output-local.pod \
	virt-v2v-output-openstack.pod \
	virt-v2v-output-ovirt.pod \
	virt-v2v-release-notes-1.42.pod \
	virt-v2v-release-notes-2.0.pod \
	virt-v2v-release-notes-2.2.pod \
	virt-v2v-release-notes-2.4.pod \
	virt-v2v-release-notes-2.6.pod \
	virt-v2v-release-notes-2.8.pod \
	virt-v2v-release-notes-2.10.pod \
	virt-v2v-support.pod \
	vm-generation-id-across-hypervisors.txt \
	$(NULL)

# Manual pages and HTML files for the website.

man_MANS = \
	virt-v2v.1 \
	virt-v2v-hacking.1 \
	virt-v2v-input-vmware.1 \
	virt-v2v-output-local.1 \
	virt-v2v-output-openstack.1 \
	virt-v2v-release-notes-1.42.1 \
	virt-v2v-release-notes-2.0.1 \
	virt-v2v-release-notes-2.2.1 \
	virt-v2v-release-notes-2.4.1 \
	virt-v2v-release-notes-2.6.1 \
	virt-v2v-release-notes-2.8.1 \
	virt-v2v-release-notes-2.10.1 \
	virt-v2v-support.1 \
	$(NULL)

noinst_DATA = \
	$(top_builddir)/website/virt-v2v.1.html \
	$(top_builddir)/website/virt-v2v-hacking.1.html \
	$(top_builddir)/website/virt-v2v-input-vmware.1.html \
	$(top_builddir)/website/virt-v2v-output-local.1.html \
	$(top_builddir)/website/virt-v2v-output-openstack.1.html \
	$(top_builddir)/website/virt-v2v-release-notes-1.42.1.html \
	$(top_builddir)/website/virt-v2v-release-notes-2.0.1.html \
	$(top_builddir)/website/virt-v2v-release-notes-2.2.1.html \
	$(top_builddir)/website/virt-v2v-release-notes-2.4.1.html \
	$(top_builddir)/website/virt-v2v-release-notes-2.6.1.html \
	$(top_builddir)/website/virt-v2v-release-notes-2.8.1.html \
	$(top_builddir)/website/virt-v2v-release-notes-2.10.1.html \
	$(top_builddir)/website/virt-v2v-support.1.html \
	$(NULL)

if ENABLE_XEN
man_MANS += virt-v2v-input-xen.1
noinst_DATA += $(top_builddir)/website/virt-v2v-input-xen.1.html
endif

if ENABLE_OVIRT
man_MANS += virt-v2v-output-ovirt.1
noinst_DATA += $(top_builddir)/website/virt-v2v-output-ovirt.1.html
endif

# Some man pages are preprocessed with m4 for conditional sections.
PP_M4 = \
	m4 \
	-D ENABLE_BLOCK_DRIVER=$(ENABLE_BLOCK_DRIVER) \
	-D ENABLE_XEN=$(ENABLE_XEN) \
	-D ENABLE_GLANCE=$(ENABLE_GLANCE) \
	-D ENABLE_OVIRT=$(ENABLE_OVIRT) \
	$(NULL)

virt-v2v.1 $(top_builddir)/website/virt-v2v.1.html: stamp-virt-v2v.pod

stamp-virt-v2v.pod: virt-v2v.pod
	$(PODWRAPPER) \
	  --pp "$(PP_M4)" \
	  --man virt-v2v.1 \
	  --html $(top_builddir)/website/virt-v2v.1.html \
	  --path $(top_srcdir)/common/options \
	  --insert $(top_srcdir)/common/mlcustomize/v2v-customize-options.pod:__CUSTOMIZE_OPTIONS__ \
	  --license GPLv2+ \
	  --warning safe \
	  $<
	$(AM_V_at)touch $@

virt-v2v-hacking.1 $(top_builddir)/website/virt-v2v-hacking.1.html: stamp-virt-v2v-hacking.pod

stamp-virt-v2v-hacking.pod: virt-v2v-hacking.pod
	$(PODWRAPPER) \
	  --man virt-v2v-hacking.1 \
	  --html $(top_builddir)/website/virt-v2v-hacking.1.html \
	  --license GPLv2+ \
	  --warning safe \
	  $<
	$(AM_V_at)touch $@

virt-v2v-input-vmware.1 $(top_builddir)/website/virt-v2v-input-vmware.1.html: stamp-virt-v2v-input-vmware.pod

stamp-virt-v2v-input-vmware.pod: virt-v2v-input-vmware.pod
	$(PODWRAPPER) \
	  --man virt-v2v-input-vmware.1 \
	  --html $(top_builddir)/website/virt-v2v-input-vmware.1.html \
	  --license GPLv2+ \
	  --warning safe \
	  $<
	$(AM_V_at)touch $@

if ENABLE_XEN
virt-v2v-input-xen.1 $(top_builddir)/website/virt-v2v-input-xen.1.html: stamp-virt-v2v-input-xen.pod

stamp-virt-v2v-input-xen.pod: virt-v2v-input-xen.pod
	$(PODWRAPPER) \
	  --man virt-v2v-input-xen.1 \
	  --html $(top_builddir)/website/virt-v2v-input-xen.1.html \
	  --license GPLv2+ \
	  --warning safe \
	  $<
	$(AM_V_at)touch $@
endif

virt-v2v-output-local.1 $(top_builddir)/website/virt-v2v-output-local.1.html: stamp-virt-v2v-output-local.pod

stamp-virt-v2v-output-local.pod: virt-v2v-output-local.pod
	$(PODWRAPPER) \
	  --man virt-v2v-output-local.1 \
	  --html $(top_builddir)/website/virt-v2v-output-local.1.html \
	  --license GPLv2+ \
	  --warning safe \
	  $<
	$(AM_V_at)touch $@

virt-v2v-output-openstack.1 $(top_builddir)/website/virt-v2v-output-openstack.1.html: stamp-virt-v2v-output-openstack.pod

stamp-virt-v2v-output-openstack.pod: virt-v2v-output-openstack.pod
	$(PODWRAPPER) \
	  --pp "$(PP_M4)" \
	  --man virt-v2v-output-openstack.1 \
	  --html $(top_builddir)/website/virt-v2v-output-openstack.1.html \
	  --license GPLv2+ \
	  --warning safe \
	  $<
	$(AM_V_at)touch $@

if ENABLE_OVIRT
virt-v2v-output-ovirt.1 $(top_builddir)/website/virt-v2v-output-ovirt.1.html: stamp-virt-v2v-output-ovirt.pod

stamp-virt-v2v-output-ovirt.pod: virt-v2v-output-ovirt.pod
	$(PODWRAPPER) \
	  --man virt-v2v-output-ovirt.1 \
	  --html $(top_builddir)/website/virt-v2v-output-ovirt.1.html \
	  --license GPLv2+ \
	  --warning safe \
	  $<
	$(AM_V_at)touch $@
endif

virt-v2v-release-notes-1.42.1 $(top_builddir)/website/virt-v2v-release-notes-1.42.1.html: stamp-virt-v2v-release-notes-1.42.pod

stamp-virt-v2v-release-notes-1.42.pod: virt-v2v-release-notes-1.42.pod
	$(PODWRAPPER) \
	  --man virt-v2v-release-notes-1.42.1 \
	  --html $(top_builddir)/website/virt-v2v-release-notes-1.42.1.html \
	  --license GPLv2+ \
	  --warning safe \
	  $<
	$(AM_V_at)touch $@

virt-v2v-release-notes-2.0.1 $(top_builddir)/website/virt-v2v-release-notes-2.0.1.html: stamp-virt-v2v-release-notes-2.0.pod

stamp-virt-v2v-release-notes-2.0.pod: virt-v2v-release-notes-2.0.pod
	$(PODWRAPPER) \
	  --man virt-v2v-release-notes-2.0.1 \
	  --html $(top_builddir)/website/virt-v2v-release-notes-2.0.1.html \
	  --license GPLv2+ \
	  --warning safe \
	  $<
	$(AM_V_at)touch $@

virt-v2v-release-notes-2.2.1 $(top_builddir)/website/virt-v2v-release-notes-2.2.1.html: stamp-virt-v2v-release-notes-2.2.pod

stamp-virt-v2v-release-notes-2.2.pod: virt-v2v-release-notes-2.2.pod
	$(PODWRAPPER) \
	  --man virt-v2v-release-notes-2.2.1 \
	  --html $(top_builddir)/website/virt-v2v-release-notes-2.2.1.html \
	  --license GPLv2+ \
	  --warning safe \
	  $<
	$(AM_V_at)touch $@

virt-v2v-release-notes-2.4.1 $(top_builddir)/website/virt-v2v-release-notes-2.4.1.html: stamp-virt-v2v-release-notes-2.4.pod

stamp-virt-v2v-release-notes-2.4.pod: virt-v2v-release-notes-2.4.pod
	$(PODWRAPPER) \
	  --man virt-v2v-release-notes-2.4.1 \
	  --html $(top_builddir)/website/virt-v2v-release-notes-2.4.1.html \
	  --license GPLv2+ \
	  --warning safe \
	  $<
	$(AM_V_at)touch $@

virt-v2v-release-notes-2.6.1 $(top_builddir)/website/virt-v2v-release-notes-2.6.1.html: stamp-virt-v2v-release-notes-2.6.pod

stamp-virt-v2v-release-notes-2.6.pod: virt-v2v-release-notes-2.6.pod
	$(PODWRAPPER) \
	  --man virt-v2v-release-notes-2.6.1 \
	  --html $(top_builddir)/website/virt-v2v-release-notes-2.6.1.html \
	  --license GPLv2+ \
	  --warning safe \
	  $<
	$(AM_V_at)touch $@

virt-v2v-release-notes-2.8.1 $(top_builddir)/website/virt-v2v-release-notes-2.8.1.html: stamp-virt-v2v-release-notes-2.8.pod

stamp-virt-v2v-release-notes-2.8.pod: virt-v2v-release-notes-2.8.pod
	$(PODWRAPPER) \
	  --man virt-v2v-release-notes-2.8.1 \
	  --html $(top_builddir)/website/virt-v2v-release-notes-2.8.1.html \
	  --license GPLv2+ \
	  --warning safe \
	  $<
	$(AM_V_at)touch $@

virt-v2v-release-notes-2.10.1 $(top_builddir)/website/virt-v2v-release-notes-2.10.1.html: stamp-virt-v2v-release-notes-2.10.pod

stamp-virt-v2v-release-notes-2.10.pod: virt-v2v-release-notes-2.10.pod
	$(PODWRAPPER) \
	  --man virt-v2v-release-notes-2.10.1 \
	  --html $(top_builddir)/website/virt-v2v-release-notes-2.10.1.html \
	  --license GPLv2+ \
	  --warning safe \
	  $<
	$(AM_V_at)touch $@

virt-v2v-support.1 $(top_builddir)/website/virt-v2v-support.1.html: stamp-virt-v2v-support.pod

stamp-virt-v2v-support.pod: virt-v2v-support.pod
	$(PODWRAPPER) \
	  --man virt-v2v-support.1 \
	  --html $(top_builddir)/website/virt-v2v-support.1.html \
	  --license GPLv2+ \
	  --warning safe \
	  $<
	$(AM_V_at)touch $@

TESTS_ENVIRONMENT = $(top_builddir)/run --test
TESTS = test-docs.sh
