# virt-df # @configure_input@ # Copyright (C) 2007-2008 Red Hat Inc., Richard W.M. Jones # # 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., 675 Mass Ave, Cambridge, MA 02139, USA. PACKAGE := @PACKAGE_NAME@ VERSION := @PACKAGE_VERSION@ INSTALL := @INSTALL@ HAVE_PERLDOC := @HAVE_PERLDOC@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ pkg_gettext = @pkg_gettext@ OCAMLCPACKAGES := -package unix,extlib,xml-light,libvirt,bitstring.syntax,bitstring -I ../lib ifneq ($(pkg_gettext),no) OCAMLCPACKAGES += -package gettext-stub endif #---------------------------------------------------------------------- # Build up the list of object files. # Library objects. OBJS := virt_df_gettext.cmo virt_df_version.cmo virt_df.cmo # Plug-in objects. ifneq ($(pkg_csv),no) OCAMLCPACKAGES += -package csv OBJS += virt_df_csv.cmo endif # Main program. OBJS += virt_df_main.cmo XOBJS := $(OBJS:.cmo=.cmx) #---------------------------------------------------------------------- OCAMLCFLAGS := @OCAMLCFLAGS@ OCAMLCLIBS := -linkpkg diskimage.cma OCAMLOPTPACKAGES := $(OCAMLCPACKAGES) OCAMLOPTFLAGS := @OCAMLOPTFLAGS@ OCAMLOPTLIBS := -linkpkg diskimage.cmxa BYTE_TARGETS := virt-df OPT_TARGETS := virt-df.opt ifeq ($(HAVE_PERLDOC),perldoc) BYTE_TARGETS += virt-df.1 virt-df.txt endif all: $(BYTE_TARGETS) opt: $(OPT_TARGETS) virt-df: $(OBJS) ../lib/diskimage.cma ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \ -o $@ $(OBJS) virt-df.opt: $(XOBJS) ../lib/diskimage.cmxa ocamlfind ocamlopt \ $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \ -o $@ $(XOBJS) # Manual page. ifeq ($(HAVE_PERLDOC),perldoc) virt-df.1: virt-df.pod pod2man -c "Virtualization Support" --release "$(PACKAGE)-$(VERSION)" \ $< > $@ virt-df.txt: virt-df.pod pod2text $< > $@ endif install: if [ -x virt-df.opt ]; then \ mkdir -p $(DESTDIR)$(bindir); \ $(INSTALL) -m 0755 virt-df.opt $(DESTDIR)$(bindir)/virt-df; \ fi include ../Make.rules