2 # Copyright (C) 2008 Red Hat Inc., Richard W.M. Jones
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.
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.
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.
18 PACKAGE := @PACKAGE_NAME@
19 VERSION := @PACKAGE_VERSION@
22 HAVE_PERLDOC := @HAVE_PERLDOC@
24 OCAML_WORD_SIZE := @OCAML_WORD_SIZE@
27 exec_prefix = @exec_prefix@
30 #OCAMLCPACKAGES := -package unix,extlib,bitmatch
31 OCAMLCPACKAGES := -package unix,extlib -I +bitmatch
33 #----------------------------------------------------------------------
34 # Build up the list of object files.
40 OBJS += diskimage_ext2.cmo \
41 diskimage_linux_swap.cmo \
42 diskimage_linux_swsuspend.cmo \
43 diskimage_lvm2_metadata.cmo \
44 diskimage_lvm2_parser.cmo \
45 diskimage_lvm2_lexer.cmo \
51 XOBJS := $(OBJS:.cmo=.cmx)
53 #----------------------------------------------------------------------
55 SYNTAX := -pp "camlp4o -I`ocamlc -where`/bitmatch pa_bitmatch.cmo"
57 OCAMLCFLAGS := -g -w s $(SYNTAX)
58 #OCAMLCLIBS := -linkpkg
59 OCAMLCLIBS := -linkpkg bitmatch.cma
61 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
62 OCAMLOPTFLAGS := -w s $(SYNTAX)
63 #OCAMLOPTLIBS := $(OCAMLCLIBS)
64 OCAMLOPTLIBS := -linkpkg bitmatch.cmxa
66 OCAMLDEPFLAGS := $(SYNTAX)
68 BYTE_TARGETS := diskimage.cma
69 OPT_TARGETS := diskimage.cmxa
75 diskimage.cma: $(OBJS)
76 ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
79 diskimage.cmxa: $(XOBJS)
81 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) \
84 # 'make depend' doesn't catch these dependencies because the .mli file
86 diskimage_lvm2_parser.cmo: diskimage_lvm2_parser.cmi
87 diskimage_lvm2_parser.cmx: diskimage_lvm2_parser.cmi
88 diskimage_lvm2_parser.cmi: diskimage_lvm2_parser.mli
90 # Int63 module implementation is defined differently on
91 # 32 and 64 bit platforms.
92 int63.ml: int63_on_$(OCAML_WORD_SIZE).ml Makefile
94 echo "(* WARNING: THIS FILE IS GENERATED FROM $< *)" | \
101 #test_int63.opt: int63.cmx test_int63.cmx
102 # $(OCAMLFIND) ocamlopt $^ -o $@
105 ocamlfind install diskimage *.mli *.cma *.cmx *.cmxa *.a
107 include ../Make.rules