Added PO file. For some reason the Japanese PO file has a parse error, so omitted...
[virt-ctrl.git] / virt-ctrl / Makefile.in
1 # virt-ctrl (originally called mlvirtmanager)
2 # Copyright (C) 2007 Red Hat Inc., Richard W.M. Jones
3 #
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.
8 #
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.
13 #
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.
17
18 INSTALL         := @INSTALL@
19
20 prefix          = @prefix@
21 exec_prefix     = @exec_prefix@
22 bindir          = @bindir@
23
24 with_icons      = @with_icons@
25 icons           = @icons@
26
27 HAVE_GDK_PIXBUF_MLSOURCE = @HAVE_GDK_PIXBUF_MLSOURCE@
28
29 pkg_dbus        = @pkg_dbus@
30 pkg_gettext     = @pkg_gettext@
31
32 OCAMLFIND       = @OCAMLFIND@
33
34 OBJS            := \
35         virt_ctrl_gettext.cmo \
36         vc_helpers.cmo \
37         vc_connections.cmo \
38         vc_domain_ops.cmo \
39         vc_connection_dlg.cmo \
40         vc_install_dlg.cmo \
41         vc_mainwindow.cmo
42
43 OCAMLCPACKAGES  := -package unix,lablgtk2,libvirt,extlib,xml-light
44 ifeq ($(pkg_dbus),yes)
45 OCAMLCPACKAGES  += -package dbus
46 OBJS            += vc_dbus.cmo
47 endif
48 ifeq ($(pkg_gettext),yes)
49 OCAMLCPACKAGES  += -package gettext-stub
50 endif
51 OCAMLCFLAGS     := -g
52 OCAMLCLIBS      := -linkpkg
53 OCAMLOPTPACKAGES := $(OCAMLCPACKAGES)
54 OCAMLOPTFLAGS   :=
55 OCAMLOPTLIBS    := $(OCAMLCLIBS)
56
57 ifneq ($(with_icons),no)
58 OBJS            += vc_icons.cmo
59 endif
60
61 BYTE_TARGETS    := virt-ctrl
62 OPT_TARGETS     := virt-ctrl.opt
63
64 OBJS += virt_ctrl.cmo
65
66 XOBJS := $(OBJS:.cmo=.cmx)
67
68 all: $(BYTE_TARGETS)
69
70 opt: $(OPT_TARGETS)
71
72 ifneq ($(OCAMLFIND),)
73 virt-ctrl: $(OBJS)
74         $(OCAMLFIND) ocamlc $(OCAMLCPACKAGES) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
75           gtkInit.cmo -o $@ $^
76
77 virt-ctrl.opt: $(XOBJS)
78         $(OCAMLFIND) ocamlopt \
79           $(OCAMLOPTPACKAGES) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
80           gtkInit.cmx -o $@ $^
81 else
82 virt-ctrl: $(OBJS)
83         $(OCAMLC) $(OCAMLCINCS) $(OCAMLCFLAGS) $(OCAMLCLIBS) \
84           gtkInit.cmo -o $@ $^
85
86 host_os         = @host_os@
87
88 ifneq ($(host_os),mingw32)
89 virt-ctrl.opt: $(XOBJS)
90         $(OCAMLOPT) $(OCAMLOPTINCS) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
91           $(patsubst %,-cclib %,$(LDFLAGS)) \
92           gtkInit.cmx -o $@ $^
93 else
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 $@
98
99 virt-ctrl.opt: $(XOBJS) gcc.exe
100         PATH=.:$$PATH \
101         $(OCAMLOPT) $(OCAMLOPTINCS) $(OCAMLOPTFLAGS) $(OCAMLOPTLIBS) \
102           $(patsubst %,-cclib %,$(LDFLAGS)) \
103           gtkInit.cmx -o $@ $(XOBJS)
104 endif
105 endif
106
107 # Rebuild the icons if newer ones available.
108 ifneq ($(with_icons),no)
109 ifneq ($(icons),)
110 ifeq ($(HAVE_GDK_PIXBUF_MLSOURCE),gdk-pixbuf-mlsource)
111 vc_icons.ml: rebuild-icons.sh
112         ./rebuild-icons.sh $(icons) > $@
113 endif
114 endif
115 endif
116
117 install:
118         if [ -x virt-ctrl.opt ]; then \
119           mkdir -p $(DESTDIR)$(bindir); \
120           $(INSTALL) -m 0755 virt-ctrl.opt $(DESTDIR)$(bindir)/virt-ctrl; \
121         fi
122
123 include ../Make.rules