2 # Copyright (C) 2007 Red Hat Inc., Richard W.M. Jones
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 PACKAGE := @PACKAGE_NAME@
19 VERSION := @PACKAGE_VERSION@
22 HAVE_PERLDOC := @HAVE_PERLDOC@
25 exec_prefix = @exec_prefix@
28 pkg_gettext = @pkg_gettext@
30 #OCAMLCPACKAGES := -package unix,extlib,xml-light,bitmatch
31 OCAMLCPACKAGES := -package unix,extlib,xml-light -I +bitmatch
33 ifneq ($(pkg_gettext),no)
34 OCAMLCPACKAGES += -package gettext-stub
41 virt_df_linux_swap.cmo \
46 XOBJS := $(OBJS:.cmo=.cmx)
48 SYNTAX := -pp "camlp4o -I`ocamlc -where`/bitmatch pa_bitmatch.cmo"
50 OCAMLCPACKAGES += -I ../libvirt
51 OCAMLCFLAGS := -g -w s $(SYNTAX)
52 #OCAMLCLIBS := -linkpkg
53 OCAMLCLIBS := -linkpkg bitmatch.cma
55 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
56 OCAMLOPTFLAGS := -w s $(SYNTAX)
57 #OCAMLOPTLIBS := $(OCAMLCLIBS)
58 OCAMLOPTLIBS := -linkpkg bitmatch.cmxa
60 OCAMLDEPFLAGS := $(SYNTAX)
62 export LIBRARY_PATH=../libvirt
63 export LD_LIBRARY_PATH=../libvirt
65 BYTE_TARGETS := virt-df
66 OPT_TARGETS := virt-df.opt
68 ifeq ($(HAVE_PERLDOC),perldoc)
69 BYTE_TARGETS += virt-df.1 virt-df.txt
77 ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
78 ../libvirt/mllibvirt.cma -o $@ $^
82 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
83 ../libvirt/mllibvirt.cmxa -o $@ $^
86 ifeq ($(HAVE_PERLDOC),perldoc)
87 virt-df.1: virt-df.pod
88 pod2man -c "Virtualization Support" --release "$(PACKAGE)-$(VERSION)" \
91 virt-df.txt: virt-df.pod
96 if [ -x virt-df.opt ]; then \
97 mkdir -p $(DESTDIR)$(bindir); \
98 $(INSTALL) -m 0755 virt-df.opt $(DESTDIR)$(bindir)/virt-df; \
101 include ../Make.rules