3 # Copyright (C) 2007-2008 Red Hat Inc., Richard W.M. Jones
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 PACKAGE := @PACKAGE_NAME@
20 VERSION := @PACKAGE_VERSION@
23 HAVE_PERLDOC := @HAVE_PERLDOC@
26 exec_prefix = @exec_prefix@
29 pkg_gettext = @pkg_gettext@
31 #OCAMLCPACKAGES := -package unix,extlib,xml-light,libvirt,bitmatch -I ../lib
32 OCAMLCPACKAGES := -package unix,extlib,xml-light,libvirt -I +bitmatch -I ../lib
34 ifneq ($(pkg_gettext),no)
35 OCAMLCPACKAGES += -package gettext-stub
38 OCAMLDOCFLAGS := -I +extlib -I +bitmatch -I +libvirt -I +xml-light \
39 -I +csv -I +gettext -I +gettext-stub -I ../lib
40 OCAMLDOCFILES := $(wildcard *.mli) $(wildcard *.ml)
42 #----------------------------------------------------------------------
43 # Build up the list of object files.
46 OBJS := virt_df_gettext.cmo virt_df.cmo
50 OCAMLCPACKAGES += -package csv
51 OBJS += virt_df_csv.cmo
55 OBJS += virt_df_main.cmo
57 XOBJS := $(OBJS:.cmo=.cmx)
59 #----------------------------------------------------------------------
61 OCAMLCFLAGS := @OCAMLCFLAGS@
62 #OCAMLCLIBS := -linkpkg diskimage.cma
63 OCAMLCLIBS := -linkpkg bitmatch.cma diskimage.cma
65 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
66 OCAMLOPTFLAGS := @OCAMLOPTFLAGS@
67 #OCAMLOPTLIBS := -linkpkg diskimage.cmxa
68 OCAMLOPTLIBS := -linkpkg bitmatch.cmxa diskimage.cmxa
70 BYTE_TARGETS := virt-df
71 OPT_TARGETS := virt-df.opt
73 ifeq ($(HAVE_PERLDOC),perldoc)
74 BYTE_TARGETS += virt-df.1 virt-df.txt
81 virt-df: $(OBJS) ../lib/diskimage.cma
82 ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
85 virt-df.opt: $(XOBJS) ../lib/diskimage.cmxa
87 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
91 ifeq ($(HAVE_PERLDOC),perldoc)
92 virt-df.1: virt-df.pod
93 pod2man -c "Virtualization Support" --release "$(PACKAGE)-$(VERSION)" \
96 virt-df.txt: virt-df.pod
101 if [ -x virt-df.opt ]; then \
102 mkdir -p $(DESTDIR)$(bindir); \
103 $(INSTALL) -m 0755 virt-df.opt $(DESTDIR)$(bindir)/virt-df; \
106 include ../Make.rules