install-man1 doesn't need to depend on EXTRAMANPAGES
[gnash.git] / po / Makefile.am
blobf12146c8dabfb9dc7e1bf3f7b16d984a156ce88a
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
22 translations = cs da de en_GB es fi fr it ja el km ne ru zh_TW
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         libmedia \
37         libcore \
38         libdevice \
39         libsound \
40         utilities \
41         plugin \
42         desktop \
43         cygnal \
44         gui \
45         extensions
46         
47 EXTRA_DIST = $(pofiles) gnash.pot 
49 all: $(gmofiles)
51 if HAS_GETTEXT
53 gnash.pot: 
54         cd $(top_srcdir); \
55         pwd; \
56         rm -f po/POTFILES; \
57         for i in `find $(dirs) -name '*.cpp'`; do \
58           echo "$$i" >> po/POTFILES;\
59         done; \
60         $(XGETTEXT) --language=C++ --files-from=po/POTFILES \
61           -o po/gnash.pot \
62           --default-domain=gnash --force \
63           --flag=_:1:pass-c-format --keyword=_ --keyword=_q \
64           --copyright-holder='Free Software Foundation, Inc.';  \
65         rm -f po/POTFILES
67 update-po: 
68         rm -f $(srcdir)/gnash.pot # force rebuild of this
69         $(MAKE) gnash.pot
70         for i in $(pofiles); do \
71           echo "Merging $$i..." ; \
72           $(MSGMERGE) --update $(srcdir)/$$i $(srcdir)/gnash.pot; \
73         done
75 SUFFIXES = .po .gmo
76 .po.gmo:
77         $(GMSGFMT) --statistics --directory=$(srcdir) -o $*.gmo $(@:%.gmo=%.po) 
79 else # not HAS_GETTEXT
81 $(gmofiles): force
82         @echo "WARNING: can't compile $@ translations w/out gettext"
84 update-po: force
85         @echo "WARNING: can't update translation files (.po) w/out gettext"
87 endif # not HAS_GETTEXT
89 force:
91 # install-hook: rename the .gmo files to gnash.mo at installation time
92 install-data-hook: $(gmofiles)
93         @for i in $(translations); do \
94           $(mkinstalldirs) "$(DESTDIR)$(datadir)/locale/$$i/LC_MESSAGES/"; \
95           if test -f $$i.gmo; then \
96             $(INSTALL_DATA) $$i.gmo $(DESTDIR)$(datadir)/locale/$$i/LC_MESSAGES/gnash.mo; \
97           fi; \
98         done
100 uninstall-hook:
101         for i in $(translations); do \
102           rm -f "$(DESTDIR)$(datadir)/locale/$$i/LC_MESSAGES/gnash.mo"; \
103         done