1 # Makefile for various po files.
4 destdir
= $(DESTDIR
)$(PREFIX
)
6 #CATALOGS = $(addsuffix .po, LINGUAS)
8 MO_FILES
= $(addsuffix .mo
, $(LINGUAS
))
17 TD
= $(strip $(TEXTDOMAIN
))
21 all: $(TD
).pot update-po update-mo
24 @echo
"Available targets:"
25 @echo
" pot - remake master catalog"
26 @echo
" update-po - merge po files"
27 @echo
" update-mo - regenerate mo files"
28 @echo
" install - install mo files"
29 @echo
" all - all of the above"
31 POTFILES
= $(srcdir)/POTFILES.in \
32 $(shell cat
$(srcdir)/POTFILES.in
)
39 # FIXME: The parameter --from-code is only needed if your sources contain
40 # any 8 bit data (even in comments). UTF-8 is only a guess here, but it
41 # will at least accept any 8 bit data.
43 # The parameter "--language=perl" is not strictly needed because the
44 # source language of all our files will be auto-detected by xgettext
45 # by their filename extension. You should even avoid this parameter
46 # if you want to extract strings from multiple source languages.
47 $(TD
).pot
: $(POTFILES
)
48 $(XGETTEXT
) --output
=$(srcdir)/$(TD
).pox
--from-code
=utf-8 \
49 --add-comments
=TRANSLATORS
: --files-from
=$(srcdir)/POTFILES.in \
50 --copyright-holder
="$(COPYRIGHT_HOLDER)" \
51 --msgid-bugs-address
="$(MSGID_BUGS_ADDRESS)" \
53 rm -f
$@
&& mv
$(TD
).pox
$@
57 targetdir
='$(destdir)/share/locale'; \
58 languages
='$(LINGUAS)'; \
59 for lang in
$$languages; do \
60 mkdir
-p
"$$targetdir/$$lang/LC_MESSAGES" || exit
1; \
61 dest
="$$targetdir/$$lang/LC_MESSAGES/$(TD).mo"; \
63 echo
"installing $$cat as $$dest"; \
64 cp
-f
$$cat $$dest && chmod
644 $$dest || exit
1; \
67 update-mo
: $(MO_FILES
)
72 catalogs
='$(CATALOGS)'; \
73 for cat in
$$catalogs; do \
74 cat
=`basename $$cat`; \
75 lang
=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
76 mv
$$lang.po
$$lang.old.po
; \
78 if
$(MSGMERGE
) $$lang.old.po
$(TD
).pot
-o
$$lang.po
; then \
79 rm -f
$$lang.old.po
; \
81 echo
"msgmerge for $$cat failed!"; \
83 mv
$$lang.old.po
$$lang.po
; \
91 $(MSGFMT
) --check --statistics
--verbose
-o
$@
$<