Update MANIFEST
[ocaml-libvirt.git] / Make.rules.in
1 # ocaml-libvirt -*- Makefile -*-
2 # Copyright (C) 2007 Red Hat Inc., Richard W.M. Jones
3 #
4 # @configure_input@
5 #
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2 of the License, or (at your option) any later version.
10 #
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 # Lesser General Public License for more details.
15 #
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
19
20 # This file is included by Makefiles in subdirectories.
21
22 OCAMLFIND       = @OCAMLFIND@
23 OCAMLDEP        = @OCAMLDEP@
24 OCAMLC          = @OCAMLC@
25 OCAMLOPT        = @OCAMLOPT@
26
27 # Common rules for building OCaml objects.
28
29 ifneq ($(OCAMLFIND),)
30 .mli.cmi:
31         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) -c $<
32 .ml.cmo:
33         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) -c $<
34 .ml.cmx:
35         $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) -c $<
36 else
37 .mli.cmi:
38         $(OCAMLC) $(OCAMLCFLAGS) $(OCAMLCINCS) -c $<
39 .ml.cmo:
40         $(OCAMLC) $(OCAMLCFLAGS) $(OCAMLCINCS) -c $<
41 .ml.cmx:
42         $(OCAMLOPT) $(OCAMLOPTFLAGS) $(OCAMLOPTINCS) -c $<
43 endif
44
45 %.ml %.mli: %.mly
46         ocamlyacc $<
47 .mll.ml:
48         ocamllex $<
49
50 # Dependencies.
51
52 depend: .depend
53
54 ifneq ($(OCAMLFIND),)
55 .depend: $(wildcard *.mli) $(wildcard *.ml)
56         rm -f .depend
57         $(OCAMLFIND) ocamldep $(OCAMLCPACKAGES) $(OCAMLDEPFLAGS) $^ > $@
58 else
59 .depend: $(wildcard *.mli) $(wildcard *.ml)
60         rm -f .depend
61         $(OCAMLDEP) $(OCAMLCINCS) $(OCAMLDEPFLAGS) $^ > $@
62 endif
63
64 ifeq ($(wildcard .depend),.depend)
65 include .depend
66 endif
67
68 .PHONY: depend dist check-manifest dpkg doc
69
70 .SUFFIXES:      .cmo .cmi .cmx .ml .mli .mll .mly