ARTIFACT=clazzes-gtk LANGUAGES=de fr prefix=/usr srcdir=../src/clazzes/gtk POTFILE=$(ARTIFACT).pot POFILES=$(addprefix $(ARTIFACT)_, $(addsuffix .po, $(LANGUAGES))) SOURCES=login.py install-mo:: for lang in $(LANGUAGES); do mkdir -p $(DESTDIR)$(prefix)/share/locale/$$lang/LC_MESSAGES; msgfmt -o $(DESTDIR)$(prefix)/share/locale/$$lang/LC_MESSAGES/$(ARTIFACT).mo $(ARTIFACT)_$$lang.po; done update-po: $(POFILES) update-pot: $(POTFILE) clean:: rm -rf *.mo *~ $(POTFILE): $(addprefix $(srcdir)/, $(SOURCES)) xgettext --from-code=UTF-8 --keyword=i18n --keyword=i18n_n:1,2 -D $(srcdir) -o $(POTFILE) $(SOURCES) $(ARTIFACT)_%.po: $(POTFILE) if test -f $@; then msgmerge -U $@ $<; else msginit -l $*.UTF-8 -i $< -o $@; fi