* virt-top/virt_top_calendar.ml: Added --end-time option.
[virt-top.git] / virt-top / Makefile.in
1 # virt-top
2 # Copyright (C) 2007 Red Hat Inc., Richard W.M. Jones
3 #
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.
8 #
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.
13 #
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.
17
18 PACKAGE         := @PACKAGE_NAME@
19 VERSION         := @PACKAGE_VERSION@
20
21 INSTALL         := @INSTALL@
22 HAVE_PERLDOC    := @HAVE_PERLDOC@
23
24 prefix          = @prefix@
25 exec_prefix     = @exec_prefix@
26 bindir          = @bindir@
27
28 pkg_curses      = @pkg_curses@
29 pkg_xml_light   = @pkg_xml_light@
30 pkg_csv         = @pkg_csv@
31 pkg_calendar    = @pkg_calendar@
32
33 OCAMLCPACKAGES  := -package unix,extlib,curses,str
34
35 OBJS            := virt_top_utils.cmo virt_top.cmo
36 ifeq ($(pkg_xml_light),yes)
37 OBJS            += virt_top_xml.cmo
38 OCAMLCPACKAGES  := $(OCAMLCPACKAGES),xml-light
39 endif
40 ifeq ($(pkg_csv),yes)
41 OBJS            += virt_top_csv.cmo
42 OCAMLCPACKAGES  := $(OCAMLCPACKAGES),csv
43 endif
44 ifeq ($(pkg_calendar),yes)
45 OBJS            += virt_top_calendar.cmo
46 OCAMLCPACKAGES  := $(OCAMLCPACKAGES),calendar
47 endif
48 OBJS            += virt_top_main.cmo
49
50 XOBJS           := $(OBJS:.cmo=.cmx)
51
52 OCAMLCPACKAGES  += -I ../libvirt
53 OCAMLCFLAGS     := -g -w s
54 OCAMLCLIBS      := -linkpkg
55
56 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
57 OCAMLOPTFLAGS   := -w s
58 OCAMLOPTLIBS    := $(OCAMLCLIBS)
59
60 export LIBRARY_PATH=../libvirt
61 export LD_LIBRARY_PATH=../libvirt
62
63 BYTE_TARGETS    := virt-top
64 OPT_TARGETS     := virt-top.opt
65
66 ifeq ($(HAVE_PERLDOC),perldoc)
67 BYTE_TARGETS    += virt-top.1 virt-top.txt
68 endif
69
70 all: $(BYTE_TARGETS)
71
72 opt: $(OPT_TARGETS)
73
74 virt-top: $(OBJS)
75         ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
76           ../libvirt/mllibvirt.cma -o $@ $^
77
78 virt-top.opt: $(XOBJS)
79         ocamlfind ocamlopt \
80           $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
81           ../libvirt/mllibvirt.cmxa -cclib -lncurses -o $@ $^
82
83 # Manual page.
84 ifeq ($(HAVE_PERLDOC),perldoc)
85 virt-top.1: virt-top.pod
86         pod2man -c "Virtualization Support" --release "$(PACKAGE)-$(VERSION)" \
87                 $< > $@
88
89 virt-top.txt: virt-top.pod
90         pod2text $< > $@
91 endif
92
93 install:
94         if [ -x virt-top.opt ]; then \
95           mkdir -p $(DESTDIR)$(bindir); \
96           $(INSTALL) -m 0755 virt-top.opt $(DESTDIR)$(bindir)/virt-top; \
97         fi
98
99 include ../Make.rules