Rules-quot 2.2 KB

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