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
|
# Library code used by virt-v2v and helpers.
# Copyright (C) 2011-2021 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
CONFIGURE_GENERATED_ML = \
config.ml
# lib/guestfs-internal-all.h is a hack, remove it eventually XXX
EXTRA_DIST = \
guestfs-internal-all.h \
$(SOURCES_MLI) \
$(SOURCES_ML) \
$(SOURCES_C)
SOURCES_MLI = \
config.mli \
create_ovf.mli \
YAML.mli \
libvirt_utils.mli \
nbdkit.mli \
networks.mli \
qemuNBD.mli \
types.mli \
utils.mli
SOURCES_ML = \
types.ml \
utils.ml \
nbdkit.ml \
qemuNBD.ml \
networks.ml \
YAML.ml \
create_ovf.ml \
libvirt_utils.ml
SOURCES_C = \
dummy.c
# We pretend that we're building a C library. automake handles the
# compilation of the C sources for us. At the end we take the C
# objects and OCaml objects and link them into the OCaml library.
# This C library is never used.
noinst_LIBRARIES = libmlv2vlib.a
if !HAVE_OCAMLOPT
MLV2VLIB_CMA = mlv2vlib.cma
else
MLV2VLIB_CMA = mlv2vlib.cmxa
endif
noinst_DATA = $(MLV2VLIB_CMA)
libmlv2vlib_a_SOURCES = $(SOURCES_C)
libmlv2vlib_a_CPPFLAGS = \
-DCAML_NAME_SPACE \
-I. \
-I$(top_builddir) \
-I$(shell $(OCAMLC) -where)
libmlv2vlib_a_CFLAGS = \
$(WARN_CFLAGS) $(WERROR_CFLAGS) \
-fPIC
BOBJECTS = config.cmo $(SOURCES_ML:.ml=.cmo)
XOBJECTS = $(BOBJECTS:.cmo=.cmx)
OCAMLPACKAGES = \
-package str,unix,libvirt,nbd \
-I $(builddir) \
-I $(top_builddir)/common/mlgettext \
-I $(top_builddir)/common/mlpcre \
-I $(top_builddir)/common/mlstdutils \
-I $(top_builddir)/common/mltools \
-I $(top_builddir)/common/mlutils \
-I $(top_builddir)/common/mlv2v \
-I $(top_builddir)/common/mlxml
OCAMLPACKAGES_TESTS = $(MLV2VLIB_CMA)
OCAMLFLAGS = $(OCAML_FLAGS) $(OCAML_WARN_ERROR) -ccopt '$(CFLAGS)'
if !HAVE_OCAMLOPT
OBJECTS = $(BOBJECTS)
else
OBJECTS = $(XOBJECTS)
endif
libmlv2vlib_a_DEPENDENCIES = $(OBJECTS)
$(MLV2VLIB_CMA): $(OBJECTS) libmlv2vlib.a
$(OCAMLFIND) mklib $(OCAMLPACKAGES) \
$(OBJECTS) $(libmlv2vlib_a_OBJECTS) -o mlv2vlib
# OCaml dependencies.
.depend: \
$(srcdir)/*.mli \
$(srcdir)/*.ml \
$(CONFIGURE_GENERATED_ML)
$(top_builddir)/ocaml-dep.sh $^
-include .depend
.PHONY: docs
|