3 # Copyright (C) 2007-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@
26 exec_prefix = @exec_prefix@
29 pkg_gettext = @pkg_gettext@
31 OCAMLCPACKAGES := -package unix,extlib,bitmatch.syntax,bitmatch -I ../lib
33 ifneq ($(pkg_gettext),no)
34 OCAMLCPACKAGES += -package gettext-stub
37 OBJS := diskzip_gettext.cmo diskzip.cmo
38 XOBJS := $(OBJS:.cmo=.cmx)
40 SYNTAX := -syntax bitmatch.syntax
42 OCAMLCFLAGS := @OCAMLCFLAGS@ $(SYNTAX)
43 OCAMLCLIBS := -linkpkg diskimage.cma
45 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
46 OCAMLOPTFLAGS := @OCAMLOPTFLAGS@ $(SYNTAX)
47 OCAMLOPTLIBS := -linkpkg diskimage.cmxa
49 OCAMLDEPFLAGS := $(SYNTAX)
51 OCAMLDOCFLAGS := $(SYNTAX) -I +extlib -I +bitmatch -I ../lib
52 OCAMLDOCFILES := diskzip.ml
54 BYTE_TARGETS := diskzip
55 OPT_TARGETS := diskzip.opt
57 ifeq ($(HAVE_PERLDOC),perldoc)
58 BYTE_TARGETS += diskzip.1 diskzip.txt
65 diskzip: $(OBJS) ../lib/diskimage.cma
66 ocamlfind ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
69 diskzip.opt: $(XOBJS) ../lib/diskimage.cmxa
71 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
75 ifeq ($(HAVE_PERLDOC),perldoc)
76 diskzip.1: diskzip.pod
77 pod2man -c "Disk images" --release "$(PACKAGE)-$(VERSION)" \
80 diskzip.txt: diskzip.pod
85 if [ -x diskzip.opt ]; then \
86 mkdir -p $(DESTDIR)$(bindir); \
87 $(INSTALL) -m 0755 diskzip.opt $(DESTDIR)$(bindir)/diskzip; \