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@
25 exec_prefix = @exec_prefix@
28 #OCAMLCPACKAGES := -package unix,extlib,bitmatch
29 OCAMLCPACKAGES := -package unix,extlib -I +bitmatch
31 #----------------------------------------------------------------------
32 # Build up the list of object files.
34 OBJS := diskimage_utils.cmo
37 OBJS += diskimage_ext2.cmo \
38 diskimage_linux_swap.cmo \
39 diskimage_lvm2_metadata.cmo \
40 diskimage_lvm2_parser.cmo \
41 diskimage_lvm2_lexer.cmo \
47 XOBJS := $(OBJS:.cmo=.cmx)
49 #----------------------------------------------------------------------
51 SYNTAX := -pp "camlp4o -I`ocamlc -where`/bitmatch pa_bitmatch.cmo"
53 OCAMLCFLAGS := -g -w s $(SYNTAX)
54 #OCAMLCLIBS := -linkpkg
55 OCAMLCLIBS := -linkpkg bitmatch.cma
57 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
58 OCAMLOPTFLAGS := -w s $(SYNTAX)
59 #OCAMLOPTLIBS := $(OCAMLCLIBS)
60 OCAMLOPTLIBS := -linkpkg bitmatch.cmxa
62 OCAMLDEPFLAGS := $(SYNTAX)
64 BYTE_TARGETS := diskimage.cma
65 OPT_TARGETS := diskimage.cmxa
71 diskimage.cma: $(OBJS)
72 ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
75 diskimage.cmxa: $(XOBJS)
77 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) \
80 # 'make depend' doesn't catch these dependencies because the .mli file
82 diskimage_lvm2_parser.cmo: diskimage_lvm2_parser.cmi
83 diskimage_lvm2_parser.cmx: diskimage_lvm2_parser.cmi
84 diskimage_lvm2_parser.cmi: diskimage_lvm2_parser.mli
87 ocamlfind install diskimage *.mli *.cma *.cmx *.cmxa *.a