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@
24 with_icons = @with_icons@
27 HAVE_GDK_PIXBUF_MLSOURCE = @HAVE_GDK_PIXBUF_MLSOURCE@
30 pkg_gettext = @pkg_gettext@
32 OCAMLFIND = @OCAMLFIND@
35 virt_ctrl_gettext.cmo \
39 vc_connection_dlg.cmo \
42 OCAMLCPACKAGES := -package unix,lablgtk2,libvirt
43 ifeq ($(pkg_dbus),yes)
44 OCAMLCPACKAGES += -package dbus
47 ifeq ($(pkg_gettext),yes)
48 OCAMLCPACKAGES += -package gettext-stub
51 OCAMLCLIBS := -linkpkg
52 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
54 OCAMLOPTLIBS := $(OCAMLCLIBS)
56 ifneq ($(with_icons),no)
60 BYTE_TARGETS := virt-ctrl
61 OPT_TARGETS := virt-ctrl.opt
65 XOBJS := $(OBJS:.cmo=.cmx)
73 $(OCAMLFIND) ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
76 virt-ctrl.opt: $(XOBJS)
77 $(OCAMLFIND) ocamlopt \
78 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
82 $(OCAMLC) $(OCAMLCINCS) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
87 ifneq ($(host_os),mingw32)
88 virt-ctrl.opt: $(XOBJS)
89 $(OCAMLOPT) $(OCAMLOPTINCS) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
90 $(patsubst %,-cclib %,$(LDFLAGS)) \
93 # On MinGW, use a hacked 'gcc' wrapper which understands the @...
94 # syntax for extending the command line.
95 gcc.exe: mingw-gcc-wrapper.ml
96 $(OCAMLC) unix.cma $< -o $@
98 virt-ctrl.opt: $(XOBJS) gcc.exe
100 $(OCAMLOPT) $(OCAMLOPTINCS) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
101 $(patsubst %,-cclib %,$(LDFLAGS)) \
102 gtkInit.cmx -o $@ $(XOBJS)
106 # Rebuild the icons if newer ones available.
107 ifneq ($(with_icons),no)
109 ifeq ($(HAVE_GDK_PIXBUF_MLSOURCE),gdk-pixbuf-mlsource)
110 vc_icons.ml: rebuild-icons.sh
111 ./rebuild-icons.sh $(icons) > $@
117 if [ -x virt-ctrl.opt ]; then \
118 mkdir -p $(DESTDIR)$(bindir); \
119 $(INSTALL) -m 0755 virt-ctrl.opt $(DESTDIR)$(bindir)/virt-ctrl; \
122 include ../Make.rules