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_curses = @pkg_curses@
29 pkg_xml_light = @pkg_xml_light@
31 pkg_calendar = @pkg_calendar@
32 pkg_calendar2 = @pkg_calendar2@
33 pkg_gettext = @pkg_gettext@
35 OCAMLCPACKAGES := -package unix,extlib,curses,str,libvirt
37 ifeq ($(pkg_gettext),yes)
38 OCAMLCPACKAGES += -package gettext-stub
42 virt_top_version.cmo \
43 virt_top_gettext.cmo \
46 ifeq ($(pkg_xml_light),yes)
47 OBJS += virt_top_xml.cmo
48 OCAMLCPACKAGES += -package xml-light
51 OBJS += virt_top_csv.cmo
52 OCAMLCPACKAGES += -package csv
54 ifeq ($(pkg_calendar),yes)
55 OBJS += virt_top_calendar1.cmo
56 OCAMLCPACKAGES += -package calendar
58 ifneq ($(pkg_calendar2),no)
59 OBJS += virt_top_calendar2.cmo
60 OCAMLCPACKAGES += -package calendar
62 OBJS += virt_top_main.cmo
64 XOBJS := $(OBJS:.cmo=.cmx)
66 OCAMLCFLAGS := -g -w s
67 OCAMLCLIBS := -linkpkg
69 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
71 OCAMLOPTLIBS := $(OCAMLCLIBS)
73 BYTE_TARGETS := virt-top
74 OPT_TARGETS := virt-top.opt
76 ifeq ($(HAVE_PERLDOC),perldoc)
77 BYTE_TARGETS += virt-top.1 virt-top.txt
85 ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) -o $@ $^
87 virt-top.opt: $(XOBJS)
89 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
93 ifeq ($(HAVE_PERLDOC),perldoc)
94 virt-top.1: virt-top.pod
95 pod2man -c "Virtualization Support" --release "$(PACKAGE)-$(VERSION)" \
98 virt-top.txt: virt-top.pod
103 if [ -x virt-top.opt ]; then \
104 mkdir -p $(DESTDIR)$(bindir); \
105 $(INSTALL) -m 0755 virt-top.opt $(DESTDIR)$(bindir)/virt-top; \
108 include ../Make.rules