1 # virt-ctrl (originally called mlvirtmanager)
2 # Copyright (C) 2007 Red Hat Inc., Richard W.M. Jones
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program 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
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 exec_prefix = @exec_prefix@
26 OCAMLFIND = @OCAMLFIND@
35 OCAMLCPACKAGES := -I ../libvirt -package unix,lablgtk2
36 ifeq ($(pkg_dbus),yes)
37 OCAMLCPACKAGES := $(OCAMLCPACKAGES),dbus
41 OCAMLCLIBS := -linkpkg
42 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
44 OCAMLOPTLIBS := $(OCAMLCLIBS)
46 OCAMLCINCS := -I ../libvirt -I @pkg_lablgtk2@
48 OCAMLCLIBS := unix.cma lablgtk.cma
49 OCAMLOPTINCS := $(OCAMLCINCS)
51 OCAMLOPTLIBS := unix.cmxa lablgtk.cmxa
54 export LIBRARY_PATH=../libvirt
55 export LD_LIBRARY_PATH=../libvirt
57 BYTE_TARGETS := virt-ctrl
58 OPT_TARGETS := virt-ctrl.opt
62 XOBJS := $(OBJS:.cmo=.cmx)
70 $(OCAMLFIND) ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
71 ../libvirt/mllibvirt.cma gtkInit.cmo -o $@ $^
73 virt-ctrl.opt: $(XOBJS)
74 $(OCAMLFIND) ocamlopt \
75 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
76 ../libvirt/mllibvirt.cmxa gtkInit.cmx -o $@ $^
79 $(OCAMLC) $(OCAMLCINCS) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
80 ../libvirt/mllibvirt.cma gtkInit.cmo -o $@ $^
84 ifneq ($(host_os),mingw32)
85 virt-ctrl.opt: $(XOBJS)
86 $(OCAMLOPT) $(OCAMLOPTINCS) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
87 $(patsubst %,-cclib %,$(LDFLAGS)) \
88 ../libvirt/mllibvirt.cmxa gtkInit.cmx -o $@ $^
90 # On MinGW, use a hacked 'gcc' wrapper which understands the @...
91 # syntax for extending the command line.
92 gcc.exe: mingw-gcc-wrapper.ml
93 $(OCAMLC) unix.cma $< -o $@
95 virt-ctrl.opt: $(XOBJS) gcc.exe
97 $(OCAMLOPT) $(OCAMLOPTINCS) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
98 $(patsubst %,-cclib %,$(LDFLAGS)) \
99 ../libvirt/mllibvirt.cmxa gtkInit.cmx -o $@ $(XOBJS)
104 if [ -x virt-ctrl.opt ]; then \
105 mkdir -p $(DESTDIR)$(bindir); \
106 $(INSTALL) -m 0755 virt-ctrl.opt $(DESTDIR)$(bindir)/virt-ctrl; \
109 include ../Make.rules