1#
2# This makefile was created with the sole purpose of emulating the
3# makefiles of the rest of domains (and thus make updates easily
4# scriptable).
5#
6
7DOMAIN= wesnoth-manpages
8MSGMERGE = msgmerge
9MSGFMT = msgfmt
10
11.SUFFIXES: .gmo .po .po-update
12
13.po.po-update:
14	@lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
15	tmpdir=`pwd`; \
16	echo "$$lang:"; \
17	echo "$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
18	if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
19	  mv -f $$tmpdir/$$lang.new.po $$lang.po; \
20	else \
21	  echo "msgmerge for $$lang.po failed!" 1>&2; \
22	  rm -f $$tmpdir/$$lang.new.po; \
23	fi
24
25# this dummy rule only displays the statistics, there is no need to
26# generate .gmo files for po4a manpages
27.po.gmo:
28	@lang=`echo $* | sed -e 's,.*/,,'`; \
29	echo "$(MSGFMT) --check-domain --statistics -o /dev/null $${lang}.po"; \
30	$(MSGFMT) --check-domain --statistics -o /dev/null $${lang}.po
31