3 # Copyright (C) 2008 Red Hat Inc., Richard W.M. Jones
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2 of the License, or (at your option) any later version.
10 # This library 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 GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 PACKAGE = @PACKAGE_NAME@
20 VERSION = @PACKAGE_VERSION@
24 SYNTAX = -pp "camlp4o -I`ocamlc -where`/bitmatch bitmatch.cma pa_bitmatch.cmo"
26 #OCAMLCPACKAGES = -package unix,bigarray,extlib,bitmatch
27 OCAMLCPACKAGES = -package unix,bigarray,extlib -I +bitmatch
29 ifneq ($(pkg_gettext),no)
30 OCAMLCPACKAGES += -package gettext-stub
33 OCAMLCFLAGS = @OCAMLCFLAGS@ $(SYNTAX)
34 OCAMLCLIBS = -linkpkg bitmatch.cma
36 OCAMLOPTFLAGS = @OCAMLOPTFLAGS@ $(SYNTAX)
37 OCAMLOPTPACKAGES = $(OCAMLCPACKAGES)
38 OCAMLOPTLIBS = -linkpkg bitmatch.cmxa
40 OCAMLDOCFLAGS = -html -stars -sort $(OCAMLCPACKAGES) $(SYNTAX)
42 TARGETS = virt-mem virt-mem.opt
44 OBJS = virt_mem_gettext.cmo \
48 XOBJS = virt_mem_gettext.cmx \
57 $(OCAMLCFLAGS) $(OCAMLCPACKAGES) $(OCAMLCLIBS) $^ -o $@
59 virt-mem.opt: $(XOBJS)
61 $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) $(OCAMLOPTLIBS) $^ -o $@
63 # Common rules for building OCaml objects.
66 ocamlfind ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) -c $<
68 ocamlfind ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) -c $<
70 ocamlfind ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) -c $<
73 rm -f *.cmi *.cmo *.cmx *.cma *.cmxa *.o *.a \
74 *.so *.opt *~ *.dll *.exe *.annot core
79 $(MAKE) check-manifest
80 rm -rf $(PACKAGE)-$(VERSION)
81 mkdir $(PACKAGE)-$(VERSION)
82 tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
83 $(INSTALL) -m 0755 configure $(PACKAGE)-$(VERSION)/
84 tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
85 rm -rf $(PACKAGE)-$(VERSION)
86 ls -l $(PACKAGE)-$(VERSION).tar.gz
89 hg manifest | sort > .check-manifest; \
90 sort MANIFEST > .orig-manifest; \
91 diff -u .orig-manifest .check-manifest; rv=$$?; \
92 rm -f .orig-manifest .check-manifest; \
95 # Developer documentation (in html/ subdirectory).
100 -ocamlfind ocamldoc $(OCAMLDOCFLAGS) -d html *.{ml,mli}
106 .depend: $(wildcard *.mli) $(wildcard *.ml)
108 ocamldep $(SYNTAX) $^ > $@
110 ifeq ($(wildcard .depend),.depend)
114 .PHONY: all opt depend install clean distclean configure dist check-manifest \
115 release release_stage_2 release_stage_3 force
117 .SUFFIXES: .cmo .cmi .cmx .ml .mli