2 # Copyright (C) 2007-2014 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 OCAML_PKG_curses = @OCAML_PKG_curses@
29 OCAML_PKG_xml_light = @OCAML_PKG_xml_light@
30 OCAML_PKG_csv = @OCAML_PKG_csv@
31 OCAML_PKG_calendar = @OCAML_PKG_calendar@
32 is_calendar2 = @is_calendar2@
33 OCAML_PKG_gettext = @OCAML_PKG_gettext@
35 OCAMLCPACKAGES := -package unix,extlib,curses,str,libvirt
37 ifneq ($(OCAML_PKG_gettext),no)
38 OCAMLCPACKAGES += -package gettext-stub
46 ifneq ($(OCAML_PKG_xml_light),no)
48 OCAMLCPACKAGES += -package xml-light
50 ifneq ($(OCAML_PKG_csv),no)
52 OCAMLCPACKAGES += -package csv
54 ifneq ($(OCAML_PKG_calendar),no)
55 ifeq ($(is_calendar2),no)
56 OBJS += opt_calendar1.cmo
57 OCAMLCPACKAGES += -package calendar
59 OBJS += opt_calendar2.cmo
60 OCAMLCPACKAGES += -package calendar
65 XOBJS := $(OBJS:.cmo=.cmx)
67 OCAMLCFLAGS := -g -warn-error CDEFLMPSUVYZX-3
68 OCAMLCLIBS := -linkpkg
70 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
71 OCAMLOPTFLAGS := $(OCAMLCFLAGS)
72 OCAMLOPTLIBS := $(OCAMLCLIBS)
74 BYTE_TARGETS := virt-top
75 OPT_TARGETS := virt-top.opt
77 ifeq ($(HAVE_PERLDOC),perldoc)
78 BYTE_TARGETS += virt-top.1 virt-top.txt
79 OPT_TARGETS += virt-top.1 virt-top.txt
87 ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) -o $@ $^
89 virt-top.opt: $(XOBJS)
91 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
95 ifeq ($(HAVE_PERLDOC),perldoc)
96 virt-top.1: virt-top.pod
97 pod2man -c "Virtualization Support" --release "$(PACKAGE)-$(VERSION)" \
100 virt-top.txt: virt-top.pod
105 if [ -x virt-top.opt ]; then \
106 mkdir -p $(DESTDIR)$(bindir); \
107 $(INSTALL) -m 0755 virt-top.opt $(DESTDIR)$(bindir)/virt-top; \
110 include ../Make.rules