Updated MANIFEST.
[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_gettext     = @pkg_gettext@
29
30 #OCAMLCPACKAGES := -package unix,extlib,xml-light,bitmatch
31 OCAMLCPACKAGES  := -package unix,extlib,xml-light -I +bitmatch
32
33 ifneq ($(pkg_gettext),no)
34 OCAMLCPACKAGES  += -package gettext-stub
35 endif
36
37 OBJS            := \
38         virt_df_gettext.cmo \
39         virt_df.cmo \
40         virt_df_ext2.cmo \
41         virt_df_linux_swap.cmo \
42         virt_df_lvm2_metadata.cmo \
43         virt_df_lvm2_parser.cmo \
44         virt_df_lvm2_lexer.cmo \
45         virt_df_lvm2.cmo \
46         virt_df_mbr.cmo \
47         virt_df_main.cmo
48
49 XOBJS           := $(OBJS:.cmo=.cmx)
50
51 SYNTAX          := -pp "camlp4o -I`ocamlc -where`/bitmatch pa_bitmatch.cmo"
52
53 OCAMLCPACKAGES  += -I ../libvirt
54 OCAMLCFLAGS     := -g -w s $(SYNTAX)
55 #OCAMLCLIBS     := -linkpkg
56 OCAMLCLIBS      := -linkpkg bitmatch.cma
57
58 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
59 OCAMLOPTFLAGS   := -w s $(SYNTAX)
60 #OCAMLOPTLIBS   := $(OCAMLCLIBS)
61 OCAMLOPTLIBS    := -linkpkg bitmatch.cmxa
62
63 OCAMLDEPFLAGS   := $(SYNTAX)
64
65 export LIBRARY_PATH=../libvirt
66 export LD_LIBRARY_PATH=../libvirt
67
68 BYTE_TARGETS    := virt-df
69 OPT_TARGETS     := virt-df.opt
70
71 ifeq ($(HAVE_PERLDOC),perldoc)
72 BYTE_TARGETS    += virt-df.1 virt-df.txt
73 endif
74
75 all: $(BYTE_TARGETS)
76
77 opt: $(OPT_TARGETS)
78
79 virt-df: $(OBJS)
80         ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
81           ../libvirt/mllibvirt.cma -o $@ $^
82
83 virt-df.opt: $(XOBJS)
84         ocamlfind ocamlopt \
85           $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
86           ../libvirt/mllibvirt.cmxa -o $@ $^
87
88 # 'make depend' doesn't catch these dependencies because the .mli file
89 # is auto-generated.
90 virt_df_lvm2_parser.cmo: virt_df_lvm2_parser.mli
91 virt_df_lvm2_parser.cmx: virt_df_lvm2_parser.mli
92
93 # Manual page.
94 ifeq ($(HAVE_PERLDOC),perldoc)
95 virt-df.1: virt-df.pod
96         pod2man -c "Virtualization Support" --release "$(PACKAGE)-$(VERSION)" \
97                 $< > $@
98
99 virt-df.txt: virt-df.pod
100         pod2text $< > $@
101 endif
102
103 install:
104         if [ -x virt-df.opt ]; then \
105           mkdir -p $(DESTDIR)$(bindir); \
106           $(INSTALL) -m 0755 virt-df.opt $(DESTDIR)$(bindir)/virt-df; \
107         fi
108
109 include ../Make.rules