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@
21 OCAMLCPACKAGES := -package unix -I ../libvirt
23 OCAMLCLIBS := -linkpkg
24 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
26 OCAMLOPTLIBS := $(OCAMLCLIBS)
28 OCAMLCINCS := -I ../libvirt
30 OCAMLCLIBS := unix.cma
31 OCAMLOPTINCS := $(OCAMLCINCS)
33 OCAMLOPTLIBS := unix.cmxa
36 export LIBRARY_PATH=../libvirt
37 export LD_LIBRARY_PATH=../libvirt
39 BYTE_TARGETS := list_domains node_info
40 OPT_TARGETS := list_domains.opt node_info.opt
47 list_domains: list_domains.cmo
49 $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
50 ../libvirt/mllibvirt.cma -o $@ $<
52 list_domains.opt: list_domains.cmx
53 $(OCAMLFIND) ocamlopt \
54 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
55 ../libvirt/mllibvirt.cmxa -o $@ $<
57 node_info: node_info.cmo
59 $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
60 ../libvirt/mllibvirt.cma -o $@ $<
62 node_info.opt: node_info.cmx
63 $(OCAMLFIND) ocamlopt \
64 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
65 ../libvirt/mllibvirt.cmxa -o $@ $<
67 list_domains: list_domains.cmo
69 $(OCAMLCINCS) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
70 ../libvirt/mllibvirt.cma -o $@ $<
72 list_domains.opt: list_domains.cmx
74 $(OCAMLOPTINCS) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
75 ../libvirt/mllibvirt.cmxa -o $@ $<
77 node_info: node_info.cmo
79 $(OCAMLCINCS) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
80 ../libvirt/mllibvirt.cma -o $@ $<
82 node_info.opt: node_info.cmx
84 $(OCAMLOPTINCS) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
85 ../libvirt/mllibvirt.cmxa -o $@ $<