Plug more leaks (in the test, not the core)
[gnash.git] / po / Makefile.am
blob7272084a2b9d4d0676c44db51f785da837507a23
1 ## Process this file with automake to generate Makefile.in
2
3 #   Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18 AUTOMAKE_OPTIONS = -Wno-portability
20 POFILES = AUTO
23 translations = cs de es fi fr it ja 
25 # This is GNU make specific, so if you are building Gnash on a BSD
26 # machine, you probably want to install GNU make in additional to
27 # BSD make.
28 pofiles := $(patsubst %,%.po,$(translations))
29 gmofiles := $(patsubst %,%.gmo,$(translations))
31 CLEANFILES = \
32         $(gmofiles) 
34 dirs =  libbase \
35         librender \
36         libamf \
37         libmedia \
38         libmedia/ffmpeg \
39         libmedia/gst \
40         libcore \
41         libcore/vm \
42         libcore/swf \
43         libcore/parser \
44         libcore/asobj \
45         utilities \
46         plugin \
47         gui \
48         extensions \
49         extensions/dbus \
50         extensions/dejagnu \
51         extensions/fileio \
52         extensions/lirc \
53         extensions/gtk2 \
54         extensions/metome \
55         extensions/mysql
56         
57 EXTRA_DIST = $(pofiles) gnash.pot 
59 all: $(gmofiles)
61 if HAS_GETTEXT
63 gnash.pot: 
64         cd $(top_srcdir); \
65         pwd; \
66         rm -f po/POTFILES; \
67         for i in `find $(dirs) -name '*.cpp'`; do \
68           echo "$$i" >> po/POTFILES;\
69         done; \
70         $(XGETTEXT) --language=C++ --files-from=po/POTFILES \
71           -o $(srcdir)/gnash.pot \
72           --default-domain=gnash --force \
73           --flag=_:1:pass-c-format --keyword=_ --keyword=_q \
74           --copyright-holder='Free Software Foundation, Inc.';  \
75         rm -f po/POTFILES
77 update-po: 
78         rm -f $(srcdir)/gnash.pot # force rebuild of this
79         $(MAKE) gnash.pot
80         for i in $(pofiles); do \
81           echo "Merging $$i..." ; \
82           $(MSGMERGE) --update $(srcdir)/$$i $(srcdir)/gnash.pot; \
83         done
85 SUFFIXES = .po .gmo
86 .po.gmo:
87         $(GMSGFMT) --statistics --directory=$(srcdir) -o $*.gmo $(@:%.gmo=%.po) 
89 else # not HAS_GETTEXT
91 $(gmofiles): force
92         @echo "WARNING: can't compile $@ translations w/out gettext"
94 update-po: force
95         @echo "WARNING: can't update translation files (.po) w/out gettext"
97 endif # not HAS_GETTEXT
99 force:
101 # install-hook: rename the .gmo files to gnash.mo at installation time
102 install-data-hook: $(gmofiles)
103         @for i in $(translations); do \
104           $(mkinstalldirs) "$(DESTDIR)$(datadir)/locale/$$i/LC_MESSAGES/"; \
105           if test -f $$i.gmo; then \
106             $(INSTALL_DATA) $$i.gmo $(DESTDIR)$(datadir)/locale/$$i/LC_MESSAGES/gnash.mo; \
107           fi; \
108         done
110 uninstall-hook:
111         for i in $(translations); do \
112           rm -f "$(DESTDIR)$(datadir)/locale/$$i/LC_MESSAGES/gnash.mo"; \
113         done