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
21 OCAMLCFLAGS := -g -warn-error CDEFLMPSUVYZX-3
22 OCAMLCLIBS := -linkpkg
23 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
24 OCAMLOPTFLAGS := -g -warn-error CDEFLMPSUVYZX-3
25 OCAMLOPTLIBS := $(OCAMLCLIBS)
27 export LIBRARY_PATH=../libvirt
28 export LD_LIBRARY_PATH=../libvirt
30 BYTE_TARGETS := list_domains list_secrets node_info get_cpu_stats \
31 get_all_domain_stats domain_events
32 OPT_TARGETS := $(BYTE_TARGETS:%=%.opt)
38 list_domains: list_domains.cmo
40 $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
41 ../libvirt/mllibvirt.cma -o $@ $<
43 list_domains.opt: list_domains.cmx
44 $(OCAMLFIND) ocamlopt \
45 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
46 ../libvirt/mllibvirt.cmxa -o $@ $<
48 list_secrets: list_secrets
50 $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
51 ../libvirt/mllibvirt.cma -o $@ $<
53 list_secrets.opt: list_secrets.cmx
54 $(OCAMLFIND) ocamlopt \
55 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
56 ../libvirt/mllibvirt.cmxa -o $@ $<
58 node_info: node_info.cmo
60 $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
61 ../libvirt/mllibvirt.cma -o $@ $<
63 node_info.opt: node_info.cmx
64 $(OCAMLFIND) ocamlopt \
65 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
66 ../libvirt/mllibvirt.cmxa -o $@ $<
68 get_cpu_stats: get_cpu_stats.cmo
70 $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
71 ../libvirt/mllibvirt.cma -o $@ $<
73 get_cpu_stats.opt: get_cpu_stats.cmx
74 $(OCAMLFIND) ocamlopt \
75 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
76 ../libvirt/mllibvirt.cmxa -o $@ $<
78 get_all_domain_stats: get_all_domain_stats.cmo
80 $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
81 ../libvirt/mllibvirt.cma -o $@ $<
83 get_all_domain_stats.opt: get_all_domain_stats.cmx
84 $(OCAMLFIND) ocamlopt \
85 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
86 ../libvirt/mllibvirt.cmxa -o $@ $<
88 domain_events: domain_events.cmo
90 $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
91 ../libvirt/mllibvirt.cma -o $@ $<
93 domain_events.opt: domain_events.cmx
94 $(OCAMLFIND) ocamlopt \
95 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
96 ../libvirt/mllibvirt.cmxa -o $@ $<
99 install-opt install-byte:
101 include ../Make.rules