1a32e9e42Smrg# This file, Rules-quot, can be copied and used freely without restrictions.
2a32e9e42Smrg# Special Makefile rules for English message catalogs with quotation marks.
3a32e9e42Smrg
4a32e9e42SmrgDISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot
5a32e9e42Smrg
6a32e9e42Smrg.SUFFIXES: .insert-header .po-update-en
7a32e9e42Smrg
8a32e9e42Smrgen@quot.po-create:
9a32e9e42Smrg	$(MAKE) en@quot.po-update
10a32e9e42Smrgen@boldquot.po-create:
11a32e9e42Smrg	$(MAKE) en@boldquot.po-update
12a32e9e42Smrg
13a32e9e42Smrgen@quot.po-update: en@quot.po-update-en
14a32e9e42Smrgen@boldquot.po-update: en@boldquot.po-update-en
15a32e9e42Smrg
16a32e9e42Smrg.insert-header.po-update-en:
17a32e9e42Smrg	@lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
18a32e9e42Smrg	if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
19a32e9e42Smrg	tmpdir=`pwd`; \
20a32e9e42Smrg	echo "$$lang:"; \
21a32e9e42Smrg	ll=`echo $$lang | sed -e 's/@.*//'`; \
22a32e9e42Smrg	LC_ALL=C; export LC_ALL; \
23a32e9e42Smrg	cd $(srcdir); \
24a32e9e42Smrg	if $(MSGINIT) $(MSGINIT_OPTIONS) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null \
25a32e9e42Smrg	   | $(SED) -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | \
26a32e9e42Smrg	   { case `$(MSGFILTER) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
27a32e9e42Smrg	     '' | 0.[0-9] | 0.[0-9].* | 0.1[0-8] | 0.1[0-8].*) \
28a32e9e42Smrg	       $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed \
29a32e9e42Smrg	       ;; \
30a32e9e42Smrg	     *) \
31a32e9e42Smrg	       $(MSGFILTER) `echo $$lang | sed -e 's/.*@//'` \
32a32e9e42Smrg	       ;; \
33a32e9e42Smrg	     esac } 2>/dev/null > $$tmpdir/$$lang.new.po \
34a32e9e42Smrg	     ; then \
35a32e9e42Smrg	  if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
36a32e9e42Smrg	    rm -f $$tmpdir/$$lang.new.po; \
37a32e9e42Smrg	  else \
38a32e9e42Smrg	    if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
39a32e9e42Smrg	      :; \
40a32e9e42Smrg	    else \
41a32e9e42Smrg	      echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
42a32e9e42Smrg	      exit 1; \
43a32e9e42Smrg	    fi; \
44a32e9e42Smrg	  fi; \
45a32e9e42Smrg	else \
46a32e9e42Smrg	  echo "creation of $$lang.po failed!" 1>&2; \
47a32e9e42Smrg	  rm -f $$tmpdir/$$lang.new.po; \
48a32e9e42Smrg	fi
49a32e9e42Smrg
50a32e9e42Smrgen@quot.insert-header: insert-header.sin
51a32e9e42Smrg	sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header
52a32e9e42Smrg
53a32e9e42Smrgen@boldquot.insert-header: insert-header.sin
54a32e9e42Smrg	sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header
55a32e9e42Smrg
56a32e9e42Smrgmostlyclean: mostlyclean-quot
57a32e9e42Smrgmostlyclean-quot:
58a32e9e42Smrg	rm -f *.insert-header
59