summaryrefslogtreecommitdiffstats
path: root/po/Makefile
blob: 935a617fc2c9af66ea175a270d8e99017f26014e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
QUILT_IN :=   add applied delete diff files import new next patches \
              pop previous push refresh remove series setup top unapplied \
	      fold fork snapshot edit
SCRIPTS_IN := apatch rpatch patchfns spec2series patchfns
# scripts/parse-patch is perl based

# LINGUAS = ...
# localedir = ...

all: $(LINGUAS:%=%.mo)

%.mo : %.po
	msgfmt --statistics -o $@ $<

%.po : quilt.pot
	msgmerge -o $@ $@ $^
	msgfmt --statistics -o /dev/null $@
	
quilt.pot: $(QUILT_IN:%=../quilt/%.in) $(SCRIPTS_IN:%=../scripts/%.in) ../bin/quilt.in
	rm -f quilt.pot; touch quilt.pot
	for file in $+ ; do \
	  bash --dump-po-strings $$file \
	    |msguniq \
	    |msgcat --force-po -F - quilt.pot -o quilt.pot; \
	done

clean:
	rm -f *.mo *~

install: all
	for lang in $(LINGUAS) ; do \
		install -d $(BUILD_ROOT)$(localedir)/$$lang/LC_MESSAGES ; \
		install -m 644 $$lang.mo \
		    $(BUILD_ROOT)$(localedir)/$$lang/LC_MESSAGES/quilt.mo ; \
	done

.PHONY: install clean all