Fix parsing error with ~ versus -
[virt-df.git] / virt-df / Makefile.in
1 # virt-df
2 # @configure_input@
3 # Copyright (C) 2007-2008 Red Hat Inc., Richard W.M. Jones
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19 PACKAGE         := @PACKAGE_NAME@
20 VERSION         := @PACKAGE_VERSION@
21
22 INSTALL         := @INSTALL@
23 HAVE_PERLDOC    := @HAVE_PERLDOC@
24
25 prefix          = @prefix@
26 exec_prefix     = @exec_prefix@
27 bindir          = @bindir@
28
29 pkg_gettext     = @pkg_gettext@
30
31 OCAMLCPACKAGES  := -package unix,extlib,xml-light,libvirt,bitstring.syntax,bitstring -I ../lib
32
33 ifneq ($(pkg_gettext),no)
34 OCAMLCPACKAGES  += -package gettext-stub
35 endif
36
37 #----------------------------------------------------------------------
38 # Build up the list of object files.
39
40 # Library objects.
41 OBJS            := virt_df_gettext.cmo virt_df_version.cmo virt_df.cmo
42
43 # Plug-in objects.
44 ifneq ($(pkg_csv),no)
45 OCAMLCPACKAGES  += -package csv
46 OBJS            += virt_df_csv.cmo
47 endif
48
49 # Main program.
50 OBJS            += virt_df_main.cmo
51
52 XOBJS           := $(OBJS:.cmo=.cmx)
53
54 #----------------------------------------------------------------------
55
56 OCAMLCFLAGS     := @OCAMLCFLAGS@
57 OCAMLCLIBS      := -linkpkg diskimage.cma
58
59 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
60 OCAMLOPTFLAGS   := @OCAMLOPTFLAGS@
61 OCAMLOPTLIBS    := -linkpkg diskimage.cmxa
62
63 BYTE_TARGETS    := virt-df
64 OPT_TARGETS     := virt-df.opt
65
66 ifeq ($(HAVE_PERLDOC),perldoc)
67 BYTE_TARGETS    += virt-df.1 virt-df.txt
68 endif
69
70 all: $(BYTE_TARGETS)
71
72 opt: $(OPT_TARGETS)
73
74 virt-df: $(OBJS) ../lib/diskimage.cma
75         ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
76           -o $@ $(OBJS)
77
78 virt-df.opt: $(XOBJS) ../lib/diskimage.cmxa
79         ocamlfind ocamlopt \
80           $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
81           -o $@ $(XOBJS)
82
83 # Manual page.
84 ifeq ($(HAVE_PERLDOC),perldoc)
85 virt-df.1: virt-df.pod
86         pod2man -c "Virtualization Support" --release "$(PACKAGE)-$(VERSION)" \
87                 $< > $@
88
89 virt-df.txt: virt-df.pod
90         pod2text $< > $@
91 endif
92
93 install:
94         if [ -x virt-df.opt ]; then \
95           mkdir -p $(DESTDIR)$(bindir); \
96           $(INSTALL) -m 0755 virt-df.opt $(DESTDIR)$(bindir)/virt-df; \
97         fi
98
99 include ../Make.rules