Cosmetic fixes and comments.
[virt-top.git] / virt-ctrl / Makefile.in
index 26d6fe5..7e7c5c4 100644 (file)
@@ -21,17 +21,42 @@ prefix              = @prefix@
 exec_prefix    = @exec_prefix@
 bindir         = @bindir@
 
+with_icons     = @with_icons@
+icons          = @icons@
+
+HAVE_GDK_PIXBUF_MLSOURCE = @HAVE_GDK_PIXBUF_MLSOURCE@
+
+pkg_dbus        = @pkg_dbus@
+pkg_gettext     = @pkg_gettext@
+
 OCAMLFIND      = @OCAMLFIND@
 
+OBJS           := \
+       virt_ctrl_gettext.cmo \
+       vc_helpers.cmo \
+       vc_connections.cmo \
+       vc_domain_ops.cmo \
+       vc_connection_dlg.cmo \
+       vc_mainwindow.cmo
+
 ifneq ($(OCAMLFIND),)
-OCAMLCPACKAGES := -package unix,lablgtk2 -I ../libvirt
+# Good, we have ocamlfind.
+OCAMLCPACKAGES := -I ../libvirt -package unix,lablgtk2
+ifeq ($(pkg_dbus),yes)
+OCAMLCPACKAGES  += -package dbus
+OBJS            += vc_dbus.cmo
+endif
+ifeq ($(pkg_gettext),yes)
+OCAMLCPACKAGES  += -package gettext-stub
+endif
 OCAMLCFLAGS    := -g
 OCAMLCLIBS     := -linkpkg
 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
 OCAMLOPTFLAGS  :=
 OCAMLOPTLIBS   := $(OCAMLCLIBS)
 else
-OCAMLCINCS     := -I @pkg_lablgtk2@ -I ../libvirt
+# Bad boy, please install ocamlfind.
+OCAMLCINCS     := -I ../libvirt -I @pkg_lablgtk2@
 OCAMLCFLAGS    := -g
 OCAMLCLIBS     := unix.cma lablgtk.cma
 OCAMLOPTINCS   := $(OCAMLCINCS)
@@ -39,18 +64,17 @@ OCAMLOPTFLAGS       :=
 OCAMLOPTLIBS   := unix.cmxa lablgtk.cmxa
 endif
 
+ifneq ($(with_icons),no)
+OBJS           += vc_icons.cmo
+endif
+
 export LIBRARY_PATH=../libvirt
 export LD_LIBRARY_PATH=../libvirt
 
 BYTE_TARGETS   := virt-ctrl
 OPT_TARGETS    := virt-ctrl.opt
 
-OBJS := \
-       vc_helpers.cmo \
-       vc_connections.cmo \
-       vc_domain_ops.cmo \
-       vc_mainwindow.cmo \
-       virt_ctrl.cmo
+OBJS += virt_ctrl.cmo
 
 XOBJS := $(OBJS:.cmo=.cmx)
 
@@ -93,6 +117,16 @@ virt-ctrl.opt: $(XOBJS) gcc.exe
 endif
 endif
 
+# Rebuild the icons if newer ones available.
+ifneq ($(with_icons),no)
+ifneq ($(icons),)
+ifeq ($(HAVE_GDK_PIXBUF_MLSOURCE),gdk-pixbuf-mlsource)
+vc_icons.ml: rebuild-icons.sh
+       ./rebuild-icons.sh $(icons) > $@
+endif
+endif
+endif
+
 install:
        if [ -x virt-ctrl.opt ]; then \
          mkdir -p $(DESTDIR)$(bindir); \