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