Updated deps.
[virt-df.git] / Make.rules.in
1 # virt-df -*- Makefile -*-
2 # @configure_input@
3 # Copyright (C) 2007 Red Hat Inc., Richard W.M. Jones
4 #
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.
9 #
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.
14 #
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
18
19 # This file is included by Makefiles in subdirectories.
20
21 OCAMLFIND       = @OCAMLFIND@
22 OCAMLDEP        = @OCAMLDEP@
23 OCAMLC          = @OCAMLC@
24 OCAMLOPT        = @OCAMLOPT@
25
26 OCAMLDOC        = @OCAMLDOC@
27 OCAMLDOCFLAGS   += -html -sort
28
29 # Common rules for building OCaml objects.
30
31 ifneq ($(OCAMLFIND),)
32 .mli.cmi:
33         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) -c $<
34 .ml.cmo:
35         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) $(OCAMLCPACKAGES) -c $<
36 .ml.cmx:
37         $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) $(OCAMLOPTPACKAGES) -c $<
38 else
39 .mli.cmi:
40         $(OCAMLC) $(OCAMLCFLAGS) $(OCAMLCINCS) -c $<
41 .ml.cmo:
42         $(OCAMLC) $(OCAMLCFLAGS) $(OCAMLCINCS) -c $<
43 .ml.cmx:
44         $(OCAMLOPT) $(OCAMLOPTFLAGS) $(OCAMLOPTINCS) -c $<
45 endif
46
47 %.ml %.mli: %.mly
48         ocamlyacc $<
49 .mll.ml:
50         ocamllex $<
51
52 # Dependencies.
53
54 depend: .depend
55
56 ifneq ($(OCAMLFIND),)
57 .depend: $(wildcard *.mli) $(wildcard *.ml)
58         rm -f .depend
59         $(OCAMLFIND) ocamldep $(OCAMLCPACKAGES) $(OCAMLDEPFLAGS) $^ > $@
60 else
61 .depend: $(wildcard *.mli) $(wildcard *.ml)
62         rm -f .depend
63         $(OCAMLDEP) $(OCAMLCINCS) $(OCAMLDEPFLAGS) $^ > $@
64 endif
65
66 ifeq ($(wildcard .depend),.depend)
67 include .depend
68 endif
69
70 # Developer documentation (in html/ subdirectory).
71
72 ifneq ($(OCAMLDOC),)
73 ifneq ($(OCAMLDOCFILES),)
74 doc:
75         rm -rf html
76         mkdir html
77         -$(OCAMLDOC) $(OCAMLDOCFLAGS) -d html $(OCAMLDOCFILES)
78 endif
79 endif
80
81 .PHONY: depend dist check-manifest dpkg doc
82
83 .SUFFIXES:      .cmo .cmi .cmx .ml .mli .mll .mly