2 # Copyright (C) 2007 Red Hat Inc., Richard W.M. Jones
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.
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.
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
18 OCAMLFIND = @OCAMLFIND@
20 OCAMLCPACKAGES := -package unix -I ../libvirt
22 OCAMLCLIBS := -linkpkg
23 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
25 OCAMLOPTLIBS := $(OCAMLCLIBS)
27 export LIBRARY_PATH=../libvirt
28 export LD_LIBRARY_PATH=../libvirt
30 BYTE_TARGETS := list_domains node_info get_cpu_stats domain_events
31 OPT_TARGETS := $(BYTE_TARGETS:%=%.opt)
37 list_domains: list_domains.cmo
39 $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
40 ../libvirt/mllibvirt.cma -o $@ $<
42 list_domains.opt: list_domains.cmx
43 $(OCAMLFIND) ocamlopt \
44 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
45 ../libvirt/mllibvirt.cmxa -o $@ $<
47 node_info: node_info.cmo
49 $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
50 ../libvirt/mllibvirt.cma -o $@ $<
52 node_info.opt: node_info.cmx
53 $(OCAMLFIND) ocamlopt \
54 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
55 ../libvirt/mllibvirt.cmxa -o $@ $<
57 get_cpu_stats: get_cpu_stats.cmo
59 $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
60 ../libvirt/mllibvirt.cma -o $@ $<
62 get_cpu_stats.opt: get_cpu_stats.cmx
63 $(OCAMLFIND) ocamlopt \
64 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
65 ../libvirt/mllibvirt.cmxa -o $@ $<
67 domain_events: domain_events.cmo
69 $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
70 ../libvirt/mllibvirt.cma -o $@ $<
72 domain_events.opt: domain_events.cmx
73 $(OCAMLFIND) ocamlopt \
74 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
75 ../libvirt/mllibvirt.cmxa -o $@ $<
78 install-opt install-byte: