multiple sizes support
[booh] / po / Makefile
1 # the domain name for rgettext
2 PGOAL = booh
3
4 # ruby files to search translatable strings in
5 RB_FILES = ../booh ../html_merges.rb
6
7 POFILES = $(wildcard *.po)
8 MOFILES = $(POFILES:%.po=%.mo)
9 LANGS = $(POFILES:%.po=%)
10
11 PREFIX = /usr/local
12 DATADIR = $(PREFIX)/share
13 LOCALEDIR=$(DATADIR)/locale
14
15 all: $(MOFILES)
16
17 %.mo: %.po
18         rmsgfmt -o $@ "$<"
19
20 merge: $(PGOAL).pot
21         @for n in $(POFILES); do \
22                 echo "Merging $$n"; \
23                 msgmerge "$$n" $< > "$$n"t; \
24                 mv -f "$$n"t "$$n"; \
25         done
26
27 $(PGOAL).pot: $(RB_FILES)
28         rm -f $@
29         rgettext --keyword=__ -o $@ $(RB_FILES)
30
31 install:
32         for l in $(LANGS); do \
33                 install -d $(LOCALEDIR)/$$l/LC_MESSAGES; \
34                 install -m 644 $$l.mo $(LOCALEDIR)/$$l/LC_MESSAGES/$(PGOAL).mo; \
35         done
36
37 clean:
38         @rm -rf *.mo $(PGOAL).pot