1 # List here all source files with translatable strings.
2 POTFILES=$(sort $(shell find ../Debconf -type f -name \*.pm)) \
3 ../dpkg-* ../debconf-* ../debconf
5 POFILES=$(wildcard *.po)
6 MOFILES=$(POFILES:.po=.mo)
8 all: debconf.pot $(MOFILES)
11 for file in $(MOFILES); do \
12 lang=`echo $$file | sed 's/\.mo//'`; \
13 install -d $(prefix)/usr/share/locale/$$lang/LC_MESSAGES/; \
14 install -m 0644 $$file $(prefix)/usr/share/locale/$$lang/LC_MESSAGES/debconf.mo; \
17 debconf.pot: $(POTFILES)
18 @echo "Rebuilding the pot file"
19 TZ=UTC xgettext $(POTFILES) -o debconf.pot.new -Lperl
20 if [ -f debconf.pot ]; then \
21 ./remove-potcdate.pl < debconf.pot > debconf.1po && \
22 ./remove-potcdate.pl < debconf.pot.new > debconf.2po && \
23 if cmp debconf.1po debconf.2po >/dev/null 2>&1; then \
24 rm -f debconf.1po debconf.2po debconf.pot.new; \
26 rm -f debconf.1po debconf.2po && \
27 mv debconf.pot.new debconf.pot; \
30 mv debconf.pot.new debconf.pot; \
34 rm -f $(MOFILES) debconf.pot.new messages messages.mo
40 @echo -n "Merging debconf.pot and $@"
41 @msgmerge --previous $@ debconf.pot -o $@.new
43 @msgfmt --statistics $@
46 @for file in $(POFILES); do \
47 lang=`echo $$file | sed 's/\.po//'`; \
49 msgfmt -o /dev/null -c -v --statistics $$lang.po;\