Debian Codegraph @

po/Makefile

raw
1 ##
2 ## Notion po Makefile
3 ##
4
5 # System-specific configuration is in system.mk
6 TOPDIR=..
7 include $(TOPDIR)/build/system-inc.mk
8
9 XGETTEXT = xgettext
10 #MSGFMT = msgfmt -c
11 MSGFMT = msgfmt
12 MSGMERGE = msgmerge
13 MSGCAT = msgcat
14 LXGETTEXT = lua-xgettext
15
16 TRANSLATIONS := fi cs
17 MO_FILES := $(patsubst %,%.mo, $(TRANSLATIONS))
18 PO_FILES := $(patsubst %,%.po, $(TRANSLATIONS))
19
20 POTDIRS=../ioncore \
21 ../mod_tiling \
22 ../mod_query \
23 ../mod_menu \
24 ../mod_sm \
25 ../mod_sp \
26 ../mod_statusbar \
27 ../de \
28 ../notion \
29 ../etc \
30 $(LIBEXTL_DIR)
31
32 EXTRA_POTFILES_LUA=../build/mkman.lua
33
34 POTFILE=notion.pot
35
36 TARGETS = $(MO_FILES)
37
38 ifndef LOCALEDIR
39 LOCALEDIR := $(PREFIX)/share/locale
40 endif
41
42 ######################################
43
44 include $(TOPDIR)/build/rules.mk
45
46 ######################################
47
48 potfiles: potdirs_potfiles
49 (for i in $(POTDIRS); do cat $$i/potfiles_c|sed "s:\w\+:$$i/&:"; done) > potfiles_c
50 (for i in $(POTDIRS); do cat $$i/potfiles_lua|sed "s:\w\+:$$i/&:"; done; \
51 for i in $(EXTRA_POTFILES_LUA); do echo $$i; done) > potfiles_lua
52
53 potdirs_potfiles:
54 for i in $(POTDIRS); do make -C $$i _potfiles; done
55
56 pot: $(POTFILE)
57
58 $(POTFILE)_c: potfiles
59 $(XGETTEXT) -kTR -kDUMMY_TR -o $@ -f potfiles_c
60
61 $(POTFILE)_lua: potfiles
62 $(LXGETTEXT) -k TR -k bdoc -k submenu -k menuentry -o $@ \
63 `cat potfiles_lua`
64
65 $(POTFILE): $(POTFILE)_c $(POTFILE)_lua
66 #
67 # GNU gettext sucks bigtime, and refuses to work on POT
68 # files without encoding set. Therefore we'll just have to
69 # use plain old cat and hope that there aren't dupes.
70 #
71 #msgcat -o $@ $+
72 #
73 cat $+ > $@
74
75 %.mo: %.po
76 $(MSGFMT) -o $@ $<
77
78 _install:
79 for i in $(TRANSLATIONS); do \
80 $(INSTALLDIR) $(DESTDIR)$(LOCALEDIR)/$$i/LC_MESSAGES ; \
81 $(INSTALL) -m $(DATA_MODE) $$i.mo $(DESTDIR)$(LOCALEDIR)/$$i/LC_MESSAGES/notion.mo ; \
82 done
83
84 update_fi: pot
85 $(MSGMERGE) -U fi.po $(POTFILE)
86
87 update_cs: pot
88 $(MSGMERGE) -U cs.po $(POTFILE)
89