# Shamelessly stolen from Quod Libet.

top_srcdir = ../
NAME = xfce4-cpufreq
ALL_LINGUAS = fr
PO_DIR ?= /usr/share/locale

po: $(NAME).pot $(addsuffix .mo, $(ALL_LINGUAS))

$(NAME).pot: ../cpufreq.c
	intltool-update --pot --gettext-package=$(NAME)

%.po: $(NAME).pot
	intltool-update --gettext-package=$(NAME) `echo $@ | sed s/.po//`

%.mo: %.po $(NAME).pot
	msgfmt -o $@ $<

clean:
	rm -f *.mo

install-po: po
	$(foreach lang,$(ALL_LINGUAS), \
		mkdir -p $(DESTDIR)$(PO_DIR)/$(lang)/LC_MESSAGES && \
		install -m 644 $(lang).mo $(DESTDIR)$(PO_DIR)/$(lang)/LC_MESSAGES/$(NAME).mo)
