# Makefile
INSTALL = install
MSGFMT = msgfmt

EXES = all

.PHONY : all install update update_pot 

all:

LANGS = ru fr bg

cl_kernel_%.mo: cl_kernel_%.po
	${MSGFMT} -o $@ $(subst .mo,.po,$@)

MOFILE = $(subst install_,,$@)
LOCALEMO = $(subst .mo,,$(subst install_cl_kernel_,,$@))

install_cl_kernel_%.mo: cl_kernel_%.mo
	${INSTALL} -D -m 0644 $(MOFILE) ${DESTDIR}/usr/share/locale/$(LOCALEMO)/LC_MESSAGES/cl_kernel.mo

update_pot: FORCE
	bash --dump-po-strings ../cl-kernel >cl_kernel.pot

POFILE = $(subst update_,,$@)

update_cl_kernel_%.po: cl_kernel.pot
	msgmerge --update $(POFILE) cl_kernel.pot

update: $(addsuffix .po,$(addprefix update_cl_kernel_,$(LANGS)))

install: all $(addsuffix .mo,$(addprefix install_cl_kernel_,$(LANGS)))

#install_cl_kernel_ru.mo install_cl_kernel_fr.mo

FORCE:
