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 \
43 OCAMLCPACKAGES := -package unix,lablgtk2,libvirt,extlib,xml-light
44 ifeq ($(pkg_dbus),yes)
45 OCAMLCPACKAGES += -package dbus
48 ifeq ($(pkg_gettext),yes)
49 OCAMLCPACKAGES += -package gettext-stub
52 OCAMLCLIBS := -linkpkg
53 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
55 OCAMLOPTLIBS := $(OCAMLCLIBS)
57 ifneq ($(with_icons),no)
61 BYTE_TARGETS := virt-ctrl
62 OPT_TARGETS := virt-ctrl.opt
66 XOBJS := $(OBJS:.cmo=.cmx)
74 $(OCAMLFIND) ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
77 virt-ctrl.opt: $(XOBJS)
78 $(OCAMLFIND) ocamlopt \
79 $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
83 $(OCAMLC) $(OCAMLCINCS) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
88 ifneq ($(host_os),mingw32)
89 virt-ctrl.opt: $(XOBJS)
90 $(OCAMLOPT) $(OCAMLOPTINCS) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
91 $(patsubst %,-cclib %,$(LDFLAGS)) \
94 # On MinGW, use a hacked 'gcc' wrapper which understands the @...
95 # syntax for extending the command line.
96 gcc.exe: mingw-gcc-wrapper.ml
97 $(OCAMLC) unix.cma $< -o $@
99 virt-ctrl.opt: $(XOBJS) gcc.exe
101 $(OCAMLOPT) $(OCAMLOPTINCS) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
102 $(patsubst %,-cclib %,$(LDFLAGS)) \
103 gtkInit.cmx -o $@ $(XOBJS)
107 # Rebuild the icons if newer ones available.
108 ifneq ($(with_icons),no)
110 ifeq ($(HAVE_GDK_PIXBUF_MLSOURCE),gdk-pixbuf-mlsource)
111 vc_icons.ml: rebuild-icons.sh
112 ./rebuild-icons.sh $(icons) > $@
118 if [ -x virt-ctrl.opt ]; then \
119 mkdir -p $(DESTDIR)$(bindir); \
120 $(INSTALL) -m 0755 virt-ctrl.opt $(DESTDIR)$(bindir)/virt-ctrl; \
123 include ../Make.rules