a976aceb1b3bc61554c8b28e951658545c68bde6
[virt-df.git] / diskzip / Makefile.in
1 # diskzip
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,bitmatch -I ../lib
32 OCAMLCPACKAGES  := -package unix,extlib -I +bitmatch -I ../lib
33
34 ifneq ($(pkg_gettext),no)
35 OCAMLCPACKAGES  += -package gettext-stub
36 endif
37
38 OBJS            := diskzip_gettext.cmo diskzip.cmo
39 XOBJS           := $(OBJS:.cmo=.cmx)
40
41 SYNTAX          := -pp "camlp4o -I`ocamlc -where`/bitmatch bitmatch.cma pa_bitmatch.cmo"
42
43 OCAMLCFLAGS     := @OCAMLCFLAGS@ $(SYNTAX)
44 #OCAMLCLIBS     := -linkpkg diskimage.cma
45 OCAMLCLIBS      := -linkpkg bitmatch.cma diskimage.cma
46
47 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
48 OCAMLOPTFLAGS   := @OCAMLOPTFLAGS@ $(SYNTAX)
49 #OCAMLOPTLIBS   := -linkpkg diskimage.cmxa
50 OCAMLOPTLIBS    := -linkpkg bitmatch.cmxa diskimage.cmxa
51
52 OCAMLDEPFLAGS   := $(SYNTAX)
53
54 OCAMLDOCFLAGS   := $(SYNTAX) -I +extlib -I +bitmatch -I ../lib
55 OCAMLDOCFILES   := diskzip.ml
56
57 BYTE_TARGETS    := diskzip
58 OPT_TARGETS     := diskzip.opt
59
60 ifeq ($(HAVE_PERLDOC),perldoc)
61 BYTE_TARGETS    += diskzip.1 diskzip.txt
62 endif
63
64 all: $(BYTE_TARGETS)
65
66 opt: $(OPT_TARGETS)
67
68 diskzip: $(OBJS) ../lib/diskimage.cma
69         ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
70           -o $@ $(OBJS)
71
72 diskzip.opt: $(XOBJS) ../lib/diskimage.cmxa
73         ocamlfind ocamlopt \
74           $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
75           -o $@ $(XOBJS)
76
77 # Manual page.
78 ifeq ($(HAVE_PERLDOC),perldoc)
79 diskzip.1: diskzip.pod
80         pod2man -c "Disk images" --release "$(PACKAGE)-$(VERSION)" \
81                 $< > $@
82
83 diskzip.txt: diskzip.pod
84         pod2text $< > $@
85 endif
86
87 install:
88         if [ -x diskzip.opt ]; then \
89           mkdir -p $(DESTDIR)$(bindir); \
90           $(INSTALL) -m 0755 diskzip.opt $(DESTDIR)$(bindir)/diskzip; \
91         fi
92
93 include ../Make.rules