Added GNU GPL/LGPL copyright notices everywhere.
[virt-top.git] / virt-df / Makefile.in
1 # virt-df
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_xml_light   = @pkg_xml_light@
29
30 OCAMLCPACKAGES  := -package unix,extlib,xml-light
31
32 OBJS            := virt_df.cmo \
33                    virt_df_ext2.cmo \
34                    virt_df_linux_swap.cmo \
35                    virt_df_lvm2.cmo \
36                    virt_df_main.cmo
37 XOBJS           := $(OBJS:.cmo=.cmx)
38
39 OCAMLCPACKAGES  += -I ../libvirt
40 OCAMLCFLAGS     := -g -w s
41 OCAMLCLIBS      := -linkpkg
42
43 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
44 OCAMLOPTFLAGS   := -w s
45 OCAMLOPTLIBS    := $(OCAMLCLIBS)
46
47 export LIBRARY_PATH=../libvirt
48 export LD_LIBRARY_PATH=../libvirt
49
50 BYTE_TARGETS    := virt-df
51 OPT_TARGETS     := virt-df.opt
52
53 #ifeq ($(HAVE_PERLDOC),perldoc)
54 #BYTE_TARGETS   += virt-df.1 virt-df.txt
55 #endif
56
57 all: $(BYTE_TARGETS)
58
59 opt: $(OPT_TARGETS)
60
61 virt-df: $(OBJS)
62         ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
63           ../libvirt/mllibvirt.cma -o $@ $^
64
65 virt-df.opt: $(XOBJS)
66         ocamlfind ocamlopt \
67           $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
68           ../libvirt/mllibvirt.cmxa -cclib -lncurses -o $@ $^
69
70 # Manual page.
71 #ifeq ($(HAVE_PERLDOC),perldoc)
72 #virt-df.1: virt-df.pod
73 #       pod2man -c "Virtualization Support" --release "$(PACKAGE)-$(VERSION)" \
74 #               $< > $@
75 #
76 #virt-df.txt: virt-df.pod
77 #       pod2text $< > $@
78 #endif
79
80 install:
81         if [ -x virt-df.opt ]; then \
82           mkdir -p $(DESTDIR)$(bindir); \
83           $(INSTALL) -m 0755 virt-df.opt $(DESTDIR)$(bindir)/virt-df; \
84         fi
85
86 include ../Make.rules