1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210
|
# virt-customize
# Copyright (C) 2014-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 = \
$(SOURCES_MLI) $(SOURCES_ML) $(SOURCES_C) \
test-password.pl \
test-settings.sh \
test-virt-customize.sh \
test-virt-customize-docs.sh \
virt-customize.pod
SOURCES_MLI = \
customize_main.mli
SOURCES_ML = \
customize_main.ml
if HAVE_OCAML
# Build the virt-customize program.
bin_PROGRAMS = virt-customize
virt_customize_SOURCES = dummy.c
CUSTOMIZE_BOBJECTS = customize_main.cmo
CUSTOMIZE_XOBJECTS = $(CUSTOMIZE_BOBJECTS:.cmo=.cmx)
if !HAVE_OCAMLOPT
CUSTOMIZE_THEOBJECTS = $(CUSTOMIZE_BOBJECTS)
else
CUSTOMIZE_THEOBJECTS = $(CUSTOMIZE_XOBJECTS)
endif
OCAMLLINKFLAGS = \
mlstdutils.$(MLARCHIVE) \
mlguestfs.$(MLARCHIVE) \
mlgettext.$(MLARCHIVE) \
mlpcre.$(MLARCHIVE) \
mlxml.$(MLARCHIVE) \
mlcutils.$(MLARCHIVE) \
mltools.$(MLARCHIVE) \
mlcustomize.$(MLARCHIVE) \
$(LINK_CUSTOM_OCAMLC_ONLY)
OCAMLPACKAGES = \
-package str,unix,guestfs \
-I $(top_builddir)/common/utils/.libs \
-I $(top_builddir)/gnulib/lib/.libs \
-I $(top_builddir)/ocaml \
-I $(top_builddir)/common/mlstdutils \
-I $(top_builddir)/common/mlutils \
-I $(top_builddir)/common/mlgettext \
-I $(top_builddir)/common/mlpcre \
-I $(top_builddir)/common/mlxml \
-I $(top_builddir)/common/mltools \
-I $(top_builddir)/common/mlcustomize \
-I $(builddir)
if HAVE_OCAML_PKG_GETTEXT
OCAMLPACKAGES += -package gettext-stub
endif
OCAMLCLIBS = \
-pthread -lpthread \
-lutils \
$(LIBTINFO_LIBS) \
$(LIBGUESTFS_LIBS) \
$(LIBCRYPT_LIBS) \
$(LIBVIRT_LIBS) \
$(LIBXML2_LIBS) \
$(LIBOSINFO_LIBS) \
$(LIBINTL) \
-lgnu
OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
virt_customize_DEPENDENCIES = \
$(top_builddir)/ocaml-link.sh \
$(CUSTOMIZE_THEOBJECTS) \
$(CUSTOMIZE_CMA) \
../common/mlutils/mlcutils.$(MLARCHIVE) \
../common/mlgettext/mlgettext.$(MLARCHIVE) \
../common/mlpcre/mlpcre.$(MLARCHIVE) \
../common/mlxml/mlxml.$(MLARCHIVE) \
../common/mltools/mltools.$(MLARCHIVE) \
../common/mlcustomize/mlcustomize.$(MLARCHIVE)
virt_customize_LINK = \
$(top_builddir)/ocaml-link.sh -cclib '$(OCAMLCLIBS)' -- \
$(OCAMLFIND) $(BEST) $(OCAMLFLAGS) $(OCAMLPACKAGES) $(OCAMLLINKFLAGS) \
$(CUSTOMIZE_THEOBJECTS) -o $@
# Manual pages and HTML files for the website.
man_MANS = virt-customize.1
noinst_DATA = $(top_builddir)/website/virt-customize.1.html
virt-customize.1 $(top_builddir)/website/virt-customize.1.html: stamp-virt-customize.pod
stamp-virt-customize.pod: virt-customize.pod $(top_srcdir)/common/mlcustomize/customize-synopsis.pod $(top_srcdir)/common/mlcustomize/customize-options.pod
$(PODWRAPPER) \
--man virt-customize.1 \
--html $(top_builddir)/website/virt-customize.1.html \
--path $(top_srcdir)/common/options \
--insert $(top_srcdir)/common/mlcustomize/customize-synopsis.pod:__CUSTOMIZE_SYNOPSIS__ \
--insert $(top_srcdir)/common/mlcustomize/customize-options.pod:__CUSTOMIZE_OPTIONS__ \
--license GPLv2+ \
--warning general \
$<
touch $@
# Tests.
TESTS_ENVIRONMENT = $(top_builddir)/run --test
TESTS = \
test-virt-customize-docs.sh \
test-virt-customize.sh \
$(SLOW_TESTS)
check-valgrind:
$(MAKE) VG="@VG@" check
# Slow tests of virt-customize functionality in real guests.
SLOW_TESTS = \
$(password_test_scripts) \
$(settings_test_scripts)
check-slow:
$(MAKE) check TESTS="$(SLOW_TESTS)" SLOW=1
password_test_scripts := \
test-password-centos-7.2.sh \
test-password-debian-6.sh \
test-password-debian-7.sh \
test-password-debian-8.sh \
test-password-fedora-27.sh \
test-password-rhel-3.9.sh \
test-password-rhel-4.9.sh \
test-password-rhel-5.11.sh \
test-password-rhel-6.9.sh \
test-password-rhel-7.2.sh \
test-password-ubuntu-10.04.sh \
test-password-ubuntu-12.04.sh \
test-password-ubuntu-14.04.sh \
test-password-ubuntu-16.04.sh \
test-password-ubuntu-18.04.sh
test-password-%.sh:
rm -f $@ $@-t
f=`echo "$@" | $(SED) 's/test-password-\(.*\).sh/\1/'`; \
echo 'script=$@ exec $$srcdir/test-password.pl' "$$f" > $@-t
chmod 0755 $@-t
mv $@-t $@
settings_test_scripts := \
test-settings-rhel-4.9.sh \
test-settings-rhel-5.11.sh \
test-settings-rhel-6.8.sh \
test-settings-rhel-7.2.sh \
test-settings-debian-6.sh \
test-settings-debian-7.sh \
test-settings-debian-8.sh \
test-settings-fedora-27.sh \
test-settings-ubuntu-10.04.sh \
test-settings-ubuntu-12.04.sh \
test-settings-ubuntu-14.04.sh \
test-settings-ubuntu-16.04.sh \
test-settings-ubuntu-18.04.sh
# Since firstboot is broken, we cannot test settings in RHEL 3:
# test-settings-rhel-3.9.sh
test-settings-%.sh:
rm -f $@ $@-t
f=`echo "$@" | $(SED) 's/test-settings-\(.*\).sh/\1/'`; \
echo 'script=$@ exec $$srcdir/test-settings.sh' "$$f" > $@-t
chmod 0755 $@-t
mv $@-t $@
DISTCLEANFILES += \
$(password_test_scripts) \
$(settings_test_scripts)
CLEANFILES += \
password-*.img \
password-*.log \
settings-*.img
# OCaml dependencies.
.depend: $(srcdir)/*.mli $(srcdir)/*.ml
$(top_builddir)/ocaml-dep.sh $^
-include .depend
endif
.PHONY: docs
|