Remove bogus =end from end of manpage.
[virt-df.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,libvirt -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 OCAMLCFLAGS     := -g -w s $(SYNTAX)
54 #OCAMLCLIBS     := -linkpkg
55 OCAMLCLIBS      := -linkpkg bitmatch.cma
56
57 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
58 OCAMLOPTFLAGS   := -w s $(SYNTAX)
59 #OCAMLOPTLIBS   := $(OCAMLCLIBS)
60 OCAMLOPTLIBS    := -linkpkg bitmatch.cmxa
61
62 OCAMLDEPFLAGS   := $(SYNTAX)
63
64 BYTE_TARGETS    := virt-df
65 OPT_TARGETS     := virt-df.opt
66
67 ifeq ($(HAVE_PERLDOC),perldoc)
68 BYTE_TARGETS    += virt-df.1 virt-df.txt
69 endif
70
71 all: $(BYTE_TARGETS)
72
73 opt: $(OPT_TARGETS)
74
75 virt-df: $(OBJS)
76         ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
77           -o $@ $^
78
79 virt-df.opt: $(XOBJS)
80         ocamlfind ocamlopt \
81           $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
82           -o $@ $^
83
84 # 'make depend' doesn't catch these dependencies because the .mli file
85 # is auto-generated.
86 virt_df_lvm2_parser.cmi: virt_df_lvm2_parser.mli
87 virt_df_lvm2_parser.cmo: virt_df_lvm2_parser.mli
88 virt_df_lvm2_parser.cmx: virt_df_lvm2_parser.mli
89
90 # Manual page.
91 ifeq ($(HAVE_PERLDOC),perldoc)
92 virt-df.1: virt-df.pod
93         pod2man -c "Virtualization Support" --release "$(PACKAGE)-$(VERSION)" \
94                 $< > $@
95
96 virt-df.txt: virt-df.pod
97         pod2text $< > $@
98 endif
99
100 install:
101         if [ -x virt-df.opt ]; then \
102           mkdir -p $(DESTDIR)$(bindir); \
103           $(INSTALL) -m 0755 virt-df.opt $(DESTDIR)$(bindir)/virt-df; \
104         fi
105
106 include ../Make.rules