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@
32 vc_connection_dlg.cmo \
36 OCAMLCPACKAGES := -I ../libvirt -package unix,lablgtk2
37 ifeq ($(pkg_dbus),yes)
38 OCAMLCPACKAGES := $(OCAMLCPACKAGES),dbus
42 OCAMLCLIBS := -linkpkg
43 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
45 OCAMLOPTLIBS := $(OCAMLCLIBS)
47 OCAMLCINCS := -I ../libvirt -I @pkg_lablgtk2@
49 OCAMLCLIBS := unix.cma lablgtk.cma
50 OCAMLOPTINCS := $(OCAMLCINCS)
52 OCAMLOPTLIBS := unix.cmxa lablgtk.cmxa
55 export LIBRARY_PATH=../libvirt
56 export LD_LIBRARY_PATH=../libvirt
58 BYTE_TARGETS := virt-ctrl
59 OPT_TARGETS := virt-ctrl.opt
63 XOBJS := $(OBJS:.cmo=.cmx)
71 $(OCAMLFIND) ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
72 ../libvirt/mllibvirt.cma gtkInit.cmo -o $@ $^
74 virt-ctrl.opt: $(XOBJS)
75 $(OCAMLFIND) ocamlopt \
76 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
77 ../libvirt/mllibvirt.cmxa gtkInit.cmx -o $@ $^
80 $(OCAMLC) $(OCAMLCINCS) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
81 ../libvirt/mllibvirt.cma gtkInit.cmo -o $@ $^
85 ifneq ($(host_os),mingw32)
86 virt-ctrl.opt: $(XOBJS)
87 $(OCAMLOPT) $(OCAMLOPTINCS) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
88 $(patsubst %,-cclib %,$(LDFLAGS)) \
89 ../libvirt/mllibvirt.cmxa gtkInit.cmx -o $@ $^
91 # On MinGW, use a hacked 'gcc' wrapper which understands the @...
92 # syntax for extending the command line.
93 gcc.exe: mingw-gcc-wrapper.ml
94 $(OCAMLC) unix.cma $< -o $@
96 virt-ctrl.opt: $(XOBJS) gcc.exe
98 $(OCAMLOPT) $(OCAMLOPTINCS) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
99 $(patsubst %,-cclib %,$(LDFLAGS)) \
100 ../libvirt/mllibvirt.cmxa gtkInit.cmx -o $@ $(XOBJS)
105 if [ -x virt-ctrl.opt ]; then \
106 mkdir -p $(DESTDIR)$(bindir); \
107 $(INSTALL) -m 0755 virt-ctrl.opt $(DESTDIR)$(bindir)/virt-ctrl; \
110 include ../Make.rules