summaryrefslogtreecommitdiffstats
path: root/po/Makefile
blob: 556a9cc92b17c7b177b7d92104e2a0a1afdbcff8 (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
38
39
40
41
42
43
44
45
46
47
# scripts/parse-patch is perl based

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

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

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

%.po : quilt.pot
	msgmerge -o $@ $@ $^

quilt.pot: $(filter-out ../debian/control.in ../doc/quilt.1.in ../doc/README.in, \
			$(wildcard ../*/*.in))
	rm -f quilt.pot; touch quilt.pot
	( cd .. ; \
	for file in $+ ; do \
	  file=$${file#../} ; \
	  if head $$file | grep -q '@BASH@'; then \
	    bash --dump-po-strings $$file ; \
	  elif head $$file | grep -q '@PERL@'; then \
	    xgettext --from-code=UTF-8 --omit-header --language=Perl \
	    	     --keyword=_ -o - $$file; \
	  else \
	    echo "Don't know how to handle $$file" >&2 ; \
	  fi \
	done ) \
	|msguniq \
	|msgcat --force-po -F - quilt.pot -o quilt.pot

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

uninstall:
	for lang in $(LINGUAS) ; do \
		rm -f $(BUILD_ROOT)$(localedir)/$$lang/LC_MESSAGES/quilt.mo ; \
	done

.PHONY: install clean all