Added configure_input headers to generated files.
[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,bitmatch -I ../lib
32 OCAMLCPACKAGES  := -package unix,extlib,xml-light,libvirt -I +bitmatch -I ../lib
33
34 ifneq ($(pkg_gettext),no)
35 OCAMLCPACKAGES  += -package gettext-stub
36 endif
37
38 #----------------------------------------------------------------------
39 # Build up the list of object files.
40
41 # Library objects.
42 OBJS            := virt_df_gettext.cmo virt_df.cmo
43
44 # Plug-in objects.
45 ifneq ($(pkg_csv),no)
46 OCAMLCPACKAGES  += -package csv
47 OBJS            += virt_df_csv.cmo
48 endif
49
50 # Main program.
51 OBJS            += virt_df_main.cmo
52
53 XOBJS           := $(OBJS:.cmo=.cmx)
54
55 #----------------------------------------------------------------------
56
57 OCAMLCFLAGS     := @OCAMLCFLAGS@
58 #OCAMLCLIBS     := -linkpkg diskimage.cma
59 OCAMLCLIBS      := -linkpkg bitmatch.cma diskimage.cma
60
61 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
62 OCAMLOPTFLAGS   := @OCAMLOPTFLAGS@
63 #OCAMLOPTLIBS   := -linkpkg diskimage.cmxa
64 OCAMLOPTLIBS    := -linkpkg bitmatch.cmxa diskimage.cmxa
65
66 BYTE_TARGETS    := virt-df
67 OPT_TARGETS     := virt-df.opt
68
69 ifeq ($(HAVE_PERLDOC),perldoc)
70 BYTE_TARGETS    += virt-df.1 virt-df.txt
71 endif
72
73 all: $(BYTE_TARGETS)
74
75 opt: $(OPT_TARGETS)
76
77 virt-df: $(OBJS) ../lib/diskimage.cma
78         ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
79           -o $@ $(OBJS)
80
81 virt-df.opt: $(XOBJS) ../lib/diskimage.cmxa
82         ocamlfind ocamlopt \
83           $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
84           -o $@ $(XOBJS)
85
86 # Manual page.
87 ifeq ($(HAVE_PERLDOC),perldoc)
88 virt-df.1: virt-df.pod
89         pod2man -c "Virtualization Support" --release "$(PACKAGE)-$(VERSION)" \
90                 $< > $@
91
92 virt-df.txt: virt-df.pod
93         pod2text $< > $@
94 endif
95
96 install:
97         if [ -x virt-df.opt ]; then \
98           mkdir -p $(DESTDIR)$(bindir); \
99           $(INSTALL) -m 0755 virt-df.opt $(DESTDIR)$(bindir)/virt-df; \
100         fi
101
102 include ../Make.rules