Added some more common logical operators.
[virt-df.git] / lib / Makefile.in
1 # Diskimage library.
2 # Copyright (C) 2008 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 OCAML_WORD_SIZE := @OCAML_WORD_SIZE@
25
26 prefix          = @prefix@
27 exec_prefix     = @exec_prefix@
28 bindir          = @bindir@
29
30 #OCAMLCPACKAGES := -package unix,extlib,bitmatch
31 OCAMLCPACKAGES  := -package unix,extlib -I +bitmatch
32
33 #----------------------------------------------------------------------
34 # Build up the list of object files.
35
36 OBJS            := int63.cmo \
37                    diskimage_utils.cmo
38
39 # Plugin objects.
40 OBJS            += diskimage_ext2.cmo \
41                    diskimage_linux_swap.cmo \
42                    diskimage_lvm2_metadata.cmo \
43                    diskimage_lvm2_parser.cmo \
44                    diskimage_lvm2_lexer.cmo \
45                    diskimage_lvm2.cmo \
46                    diskimage_mbr.cmo
47
48 OBJS            += diskimage.cmo
49
50 XOBJS           := $(OBJS:.cmo=.cmx)
51
52 #----------------------------------------------------------------------
53
54 SYNTAX          := -pp "camlp4o -I`ocamlc -where`/bitmatch pa_bitmatch.cmo"
55
56 OCAMLCFLAGS     := -g -w s $(SYNTAX)
57 #OCAMLCLIBS     := -linkpkg
58 OCAMLCLIBS      := -linkpkg bitmatch.cma
59
60 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
61 OCAMLOPTFLAGS   := -w s $(SYNTAX)
62 #OCAMLOPTLIBS   := $(OCAMLCLIBS)
63 OCAMLOPTLIBS    := -linkpkg bitmatch.cmxa
64
65 OCAMLDEPFLAGS   := $(SYNTAX)
66
67 BYTE_TARGETS    := diskimage.cma
68 OPT_TARGETS     := diskimage.cmxa
69
70 all: $(BYTE_TARGETS)
71
72 opt: $(OPT_TARGETS)
73
74 diskimage.cma: $(OBJS)
75         ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
76           -a -o $@ $^
77
78 diskimage.cmxa: $(XOBJS)
79         ocamlfind ocamlopt \
80           $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) \
81           -a -o $@ $^
82
83 # 'make depend' doesn't catch these dependencies because the .mli file
84 # is auto-generated.
85 diskimage_lvm2_parser.cmo: diskimage_lvm2_parser.cmi
86 diskimage_lvm2_parser.cmx: diskimage_lvm2_parser.cmi
87 diskimage_lvm2_parser.cmi: diskimage_lvm2_parser.mli
88
89 # Int63 module implementation is defined differently on
90 # 32 and 64 bit platforms.
91 int63.ml: int63_on_$(OCAML_WORD_SIZE).ml Makefile
92         rm -f $@
93         echo "(* WARNING: THIS FILE IS GENERATED FROM $< *)" | \
94         cat - $< > $@
95
96 int63.cmo: int63.cmi
97 int63.cmx: int63.cmi
98 int63.cmi: int63.ml
99
100 #test_int63.opt: int63.cmx test_int63.cmx
101 #       $(OCAMLFIND) ocamlopt $^ -o $@
102
103 install:
104         ocamlfind install diskimage *.mli *.cma *.cmx *.cmxa *.a
105
106 include ../Make.rules