Update MANIFEST
[ocaml-libvirt.git] / examples / Makefile.in
1 # ocaml-libvirt
2 # Copyright (C) 2007 Red Hat Inc., Richard W.M. Jones
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2 of the License, or (at your option) any later version.
8 #
9 # This library 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 GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
17
18 OCAMLFIND       = @OCAMLFIND@
19
20 OCAMLCPACKAGES  := -package unix -I ../libvirt
21 OCAMLCFLAGS     := -g -warn-error CDEFLMPSUVYZX-3
22 OCAMLCLIBS      := -linkpkg
23 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
24 OCAMLOPTFLAGS   := -g -warn-error CDEFLMPSUVYZX-3
25 OCAMLOPTLIBS    := $(OCAMLCLIBS)
26
27 export LIBRARY_PATH=../libvirt
28 export LD_LIBRARY_PATH=../libvirt
29
30 BYTE_TARGETS    := list_domains node_info get_cpu_stats \
31                    get_all_domain_stats domain_events
32 OPT_TARGETS     := $(BYTE_TARGETS:%=%.opt)
33
34 all: $(BYTE_TARGETS)
35
36 opt: $(OPT_TARGETS)
37
38 list_domains: list_domains.cmo
39         $(OCAMLFIND) ocamlc \
40           $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
41           ../libvirt/mllibvirt.cma -o $@ $<
42
43 list_domains.opt: list_domains.cmx
44         $(OCAMLFIND) ocamlopt \
45           $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
46           ../libvirt/mllibvirt.cmxa -o $@ $<
47
48 node_info: node_info.cmo
49         $(OCAMLFIND) ocamlc \
50           $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
51           ../libvirt/mllibvirt.cma -o $@ $<
52
53 node_info.opt: node_info.cmx
54         $(OCAMLFIND) ocamlopt \
55           $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
56           ../libvirt/mllibvirt.cmxa -o $@ $<
57
58 get_cpu_stats: get_cpu_stats.cmo
59         $(OCAMLFIND) ocamlc \
60           $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
61           ../libvirt/mllibvirt.cma -o $@ $<
62
63 get_cpu_stats.opt: get_cpu_stats.cmx
64         $(OCAMLFIND) ocamlopt \
65           $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
66           ../libvirt/mllibvirt.cmxa -o $@ $<
67
68 get_all_domain_stats: get_all_domain_stats.cmo
69         $(OCAMLFIND) ocamlc \
70           $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
71           ../libvirt/mllibvirt.cma -o $@ $<
72
73 get_all_domain_stats.opt: get_all_domain_stats.cmx
74         $(OCAMLFIND) ocamlopt \
75           $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
76           ../libvirt/mllibvirt.cmxa -o $@ $<
77
78 domain_events: domain_events.cmo
79         $(OCAMLFIND) ocamlc \
80           $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
81           ../libvirt/mllibvirt.cma -o $@ $<
82
83 domain_events.opt: domain_events.cmx
84         $(OCAMLFIND) ocamlopt \
85           $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
86           ../libvirt/mllibvirt.cmxa -o $@ $<
87
88
89 install-opt install-byte:
90
91 include ../Make.rules