3 # Copyright (C) 2008 Red Hat Inc., Richard W.M. Jones
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.
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.
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.
19 PACKAGE := @PACKAGE_NAME@
20 VERSION := @PACKAGE_VERSION@
23 HAVE_PERLDOC := @HAVE_PERLDOC@
25 OCAML_WORD_SIZE := @OCAML_WORD_SIZE@
28 exec_prefix = @exec_prefix@
31 #OCAMLCPACKAGES := -package unix,extlib,bitmatch
32 OCAMLCPACKAGES := -package unix,extlib -I +bitmatch
34 #----------------------------------------------------------------------
35 # Build up the list of object files.
41 OBJS += diskimage_ext2.cmo \
42 diskimage_linux_swap.cmo \
43 diskimage_linux_swsuspend.cmo \
46 diskimage_lvm2_metadata.cmo \
47 diskimage_lvm2_parser.cmo \
48 diskimage_lvm2_lexer.cmo \
54 XOBJS := $(OBJS:.cmo=.cmx)
56 #----------------------------------------------------------------------
58 SYNTAX := -pp "camlp4o -I`ocamlc -where`/bitmatch bitmatch.cma pa_bitmatch.cmo"
60 OCAMLCFLAGS := @OCAMLCFLAGS@ $(SYNTAX)
61 #OCAMLCLIBS := -linkpkg
62 OCAMLCLIBS := -linkpkg bitmatch.cma
64 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
65 OCAMLOPTFLAGS := @OCAMLOPTFLAGS@ $(SYNTAX)
66 #OCAMLOPTLIBS := $(OCAMLCLIBS)
67 OCAMLOPTLIBS := -linkpkg bitmatch.cmxa
69 OCAMLDEPFLAGS := $(SYNTAX)
71 OCAMLDOCFLAGS += $(SYNTAX) -I +extlib -I +bitmatch
72 OCAMLDOCFILES := int63.mli diskimage.mli
74 BYTE_TARGETS := diskimage.cma
75 OPT_TARGETS := diskimage.cmxa
81 diskimage.cma: $(OBJS)
82 ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
85 diskimage.cmxa: $(XOBJS)
87 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) \
90 # 'make depend' doesn't catch these dependencies because the .mli file
92 diskimage_lvm2_parser.cmo: diskimage_lvm2_parser.cmi
93 diskimage_lvm2_parser.cmx: diskimage_lvm2_parser.cmi
94 diskimage_lvm2_parser.cmi: diskimage_lvm2_parser.mli
96 diskimage_lvm2_lexer.cmo: diskimage_impl.cmi
97 diskimage_lvm2_parser.cmo: diskimage_impl.cmi
98 diskimage_lvm2_lexer.cmx: diskimage_impl.cmi
99 diskimage_lvm2_parser.cmx: diskimage_impl.cmi
101 # Int63 module is defined differently on 32 and 64 bit platforms.
102 int63.ml: int63_on_$(OCAML_WORD_SIZE).ml Makefile
104 echo "(* WARNING: THIS FILE IS GENERATED FROM $< *)" | \
107 int63.mli: int63_on_$(OCAML_WORD_SIZE).mli Makefile
109 echo "(* WARNING: THIS FILE IS GENERATED FROM $< *)" | \
114 int63.cmi: int63.ml int63.mli
116 #test_int63.opt: int63.cmx test_int63.cmx
117 # $(OCAMLFIND) ocamlopt $^ -o $@
120 ocamlfind install diskimage META *.mli *.cma *.cmx *.cmxa *.a
122 include ../Make.rules