# the domain name for rgettext PGOAL = booh # ruby files to search translatable strings in RB_FILES = ../booh ../html_merges.rb POFILES = $(wildcard *.po) MOFILES = $(POFILES:%.po=%.mo) LANGS = $(POFILES:%.po=%) PREFIX = /usr/local DATADIR = $(PREFIX)/share LOCALEDIR=$(DATADIR)/locale all: $(MOFILES) %.mo: %.po rmsgfmt -o $@ "$<" merge: $(PGOAL).pot @for n in $(POFILES); do \ echo "Merging $$n"; \ msgmerge "$$n" $< > "$$n"t; \ mv -f "$$n"t "$$n"; \ done $(PGOAL).pot: $(RB_FILES) rm -f $@ rgettext --keyword=__ -o $@ $(RB_FILES) install: for l in $(LANGS); do \ install -d $(LOCALEDIR)/$$l/LC_MESSAGES; \ install -m 644 $$l.mo $(LOCALEDIR)/$$l/LC_MESSAGES/$(PGOAL).mo; \ done clean: @rm -rf *.mo $(PGOAL).pot