5d23d1e9d25b08cba90717251a325bd1dc50f9d5
[hermes] / package / po / Makefile
1
2
3 GETTEXT_PACKAGE = hermes
4 PACKAGE = hermes
5
6 SHELL = /bin/sh
7
8 prefix = /opt/$(PACKAGE)
9 DATADIRNAME = share
10 itlocaledir = $(prefix)/$(DATADIRNAME)/locale
11
12 INSTALL = /scratchbox/tools/bin/install -c
13 INSTALL_DATA = ${INSTALL} -m 644
14
15 GMSGFMT = /scratchbox/tools/bin/msgfmt
16 MSGFMT = /scratchbox/tools/bin/msgfmt
17 XGETTEXT = /scratchbox/tools/bin/xgettext
18 MSGMERGE = /scratchbox/tools/bin/msgmerge 
19
20 PO_LINGUAS= fi_FI fr_FR pl_PL sv_SE
21
22 USE_LINGUAS= fi_FI fr_FR pl_PL sv_SE
23
24 POFILES=$(shell LINGUAS="$(PO_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
25
26 DISTFILES = Makefile POTFILES.in $(POFILES)
27 EXTRA_DISTFILES = ChangeLog POTFILES.skip Makevars LINGUAS
28
29 POTFILES = \
30         ../src/org/maemo/hermes/engine/twitter/provider.py \
31         ../src/org/maemo/hermes/engine/linkedin/provider.py \
32         ../src/org/maemo/hermes/engine/facebook/provider.py \
33         ../src/org/maemo/hermes/gui/gtkui.py \
34         ../src/org/maemo/hermes/gui/accountsdialogue.py \
35         ../src/org/bleb/wimpworks.py \
36 # This comment gets stripped out
37
38 CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
39
40 .SUFFIXES:
41 .SUFFIXES: .po .gmo .mo 
42
43 .po.mo:
44         $(MSGFMT) -o $@ $<
45
46 .po.gmo:
47         file=`echo $* | sed 's,.*/,,'`.gmo \
48           && rm -f $$file && $(GMSGFMT) -o $$file $<
49
50 all: compile
51
52 compile: $(CATALOGS)
53
54 $(GETTEXT_PACKAGE).pot: $(POTFILES)
55         $(XGETTEXT) --package-name=$(PACKAGE) -o $(GETTEXT_PACKAGE).pot $(POTFILES) 
56
57 install: all
58         linguas="$(USE_LINGUAS)"; \
59         for lang in $$linguas; do \
60           dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
61           mkdir -p $$dir; \
62           if test -r $$lang.gmo; then \
63             $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
64             echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
65           fi; \
66         done
67
68 clean:  
69         rm -f *.mo *.gmo
70
71 update-po: 
72         $(MAKE) $(GETTEXT_PACKAGE).pot
73         linguas="$(USE_LINGUAS)"; \
74         for lang in $$linguas; do \
75           echo "$$lang:"; \
76           if test -r $$lang.po; then \
77             $(MSGMERGE) -U $$lang.po $(GETTEXT_PACKAGE).pot; \
78           else \
79             cp $(GETTEXT_PACKAGE).pot $$lang.po; \
80           fi; \
81         done
82