INSTALL		=	/usr/bin/install
MSGFMT		=	/usr/bin/msgfmt
RM		=	/bin/rm
POT_FILES	=	fr.mo es.mo wa.mo ja.mo

.PHONY: potfiles install clean

all: potfiles

potfiles: $(POT_FILES)

clean:
	$(RM) -f *.mo *~ *.bak core

install:
	potfiles='$(POT_FILES)'; \
	for file in $$potfiles; do \
	  lang=`basename $$file .mo`; \
	  $(INSTALL) -m 755 -d $(DESTDIR)/usr/share/locale/$$lang/LC_MESSAGES; \
	  $(INSTALL) -m 644 $$file $(DESTDIR)/usr/share/locale/$$lang/LC_MESSAGES/control-panel.mo; \
	done

# Rules

%.mo : %.po
	$(MSGFMT) $< -o $@
