Updated MANIFEST.
[virt-p2v.git] / po / Makefile.in
1 # Makefile for po subdirectory.
2 # @configure_input@
3 #
4 # Copyright (C) 2007-2008 Red Hat Inc.
5 # Written by Richard W.M. Jones <rjones@redhat.com>
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
21 OCAML_GETTEXT_PACKAGE = virt-p2v
22 LINGUAS         = $(shell cat LINGUAS)
23 SOURCES         = POTFILES
24
25 OCAML_GETTEXT   = @OCAML_GETTEXT@
26 OCAML_GETTEXT_EXTRACT_OPTIONS =
27 OCAML_GETTEXT_COMPILE_OPTIONS =
28 OCAML_GETTEXT_INSTALL_OPTIONS =
29 OCAML_GETTEXT_MERGE_OPTIONS   =
30
31 PODIR           = @prefix@/share/locale
32
33 POFILES         = $(addsuffix .po,$(LINGUAS))
34 MOFILES         = $(addsuffix .mo,$(LINGUAS))
35 POTFILE         = $(OCAML_GETTEXT_PACKAGE).pot
36
37 all: ../.tmp.virt-p2v.ml $(MOFILES) $(POTFILE)
38
39 # This is just a hack because ocaml-gettext doesn't know what to
40 # do with a file that doesn't end in a *.ml extension, and even
41 # if renamed it doesn't work because of the toplevel directives.
42 ../.tmp.virt-p2v.ml: ../virt-p2v
43         grep -v '^#' < $< > $@
44
45 install: install-po
46
47 uninstall: uninstall-po
48
49 clean:: clean-po
50
51 %.mo: %.po
52         $(OCAML_GETTEXT) --action compile $(OCAML_GETTEXT_COMPILE_OPTIONS) \
53         --compile-output $@ $^
54
55 %.pot: $(SOURCES) $(shell cat $(SOURCES))
56         $(OCAML_GETTEXT) --action extract $(OCAML_GETTEXT_EXTRACT_OPTIONS) \
57         --extract-pot $@ $<
58
59 %.po: $(POTFILE)
60         $(OCAML_GETTEXT) --action merge   $(OCAML_GETTEXT_MERGE_OPTIONS) \
61         --merge-pot $(POTFILE) $@
62
63 $(BUILDPO):
64         mkdir -p $(BUILDPO)
65
66 .PRECIOUS: $(POTFILE) 
67
68 install-po: $(MOFILES) 
69         $(OCAML_GETTEXT) --action install $(OCAML_GETTEXT_INSTALL_OPTIONS) \
70         --install-textdomain $(OCAML_GETTEXT_PACKAGE) \
71         --install-destdir $(PODIR) $(MOFILES)
72
73 uninstall-po:
74         $(OCAML_GETTEXT) --action uninstall $(OCAML_GETTEXT_INSTALL_OPTIONS) \
75         --uninstall-textdomain $(OCAML_GETTEXT_PACKAGE) \
76         --uninstall-orgdir $(PODIR) $(MOFILES)
77
78 clean-po:
79         -$(OCAML_GETTEXT) --action uninstall $(OCAML_GETTEXT_INSTALL_OPTIONS) \
80         --uninstall-textdomain $(OCAML_GETTEXT_PACKAGE) \
81         --uninstall-orgdir $(BUILDPO) $(MOFILES)
82         -$(RM) $(MOFILES)