2 # Copyright (C) 2007-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 pkg_gettext = @pkg_gettext@
30 #OCAMLCPACKAGES := -package unix,extlib,bitmatch -I ../lib
31 OCAMLCPACKAGES := -package unix,extlib -I +bitmatch -I ../lib
33 ifneq ($(pkg_gettext),no)
34 OCAMLCPACKAGES += -package gettext-stub
37 OBJS := diskzip_gettext.cmo diskzip_bitmap.cmo diskzip.cmo
38 XOBJS := $(OBJS:.cmo=.cmx)
40 SYNTAX := -pp "camlp4o -I`ocamlc -where`/bitmatch pa_bitmatch.cmo"
42 OCAMLCFLAGS := @OCAMLCFLAGS@ $(SYNTAX)
43 #OCAMLCLIBS := -linkpkg diskimage.cma
44 OCAMLCLIBS := -linkpkg bitmatch.cma diskimage.cma
46 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
47 OCAMLOPTFLAGS := @OCAMLOPTFLAGS@ $(SYNTAX)
48 #OCAMLOPTLIBS := -linkpkg diskimage.cmxa
49 OCAMLOPTLIBS := -linkpkg bitmatch.cmxa diskimage.cmxa
51 OCAMLDEPFLAGS := $(SYNTAX)
53 BYTE_TARGETS := diskzip
54 OPT_TARGETS := diskzip.opt
56 ifeq ($(HAVE_PERLDOC),perldoc)
57 BYTE_TARGETS += diskzip.1 diskzip.txt
64 diskzip: $(OBJS) ../lib/diskimage.cma
65 ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
68 diskzip.opt: $(XOBJS) ../lib/diskimage.cmxa
70 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
74 ifeq ($(HAVE_PERLDOC),perldoc)
75 diskzip.1: diskzip.pod
76 pod2man -c "Disk images" --release "$(PACKAGE)-$(VERSION)" \
79 diskzip.txt: diskzip.pod
84 if [ -x diskzip.opt ]; then \
85 mkdir -p $(DESTDIR)$(bindir); \
86 $(INSTALL) -m 0755 diskzip.opt $(DESTDIR)$(bindir)/diskzip; \