Rules-piglatin 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Special Makefile rules for Pig Latin message catalogs with quotation marks.
  2. DISTFILES.common.extra3 = piglatin.sed en@piglatin.header insert-header.sin Rules-piglatin
  3. .SUFFIXES: .insert-header .po-update-en-piglatin
  4. en@piglatin.po-create:
  5. $(MAKE) en@piglatin.po-update
  6. en@piglatin.po-update: en@piglatin.po-update-en
  7. .insert-header.po-update-en-piglatin:
  8. @lang=`echo $@ | sed -e 's/\.po-update-en-piglatin$$//'`; \
  9. if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
  10. tmpdir=`pwd`; \
  11. echo "$$lang:"; \
  12. ll=`echo $$lang | sed -e 's/@.*//'`; \
  13. LC_ALL=C; export LC_ALL; \
  14. cd $(srcdir); \
  15. if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \
  16. if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
  17. rm -f $$tmpdir/$$lang.new.po; \
  18. else \
  19. if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
  20. :; \
  21. else \
  22. echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
  23. exit 1; \
  24. fi; \
  25. fi; \
  26. else \
  27. echo "creation of $$lang.po failed!" 1>&2; \
  28. rm -f $$tmpdir/$$lang.new.po; \
  29. fi
  30. en@piglatin.insert-header: insert-header.sin
  31. sed -e '/^#/d' -e 's/HEADER/en@piglatin.header/g' $(srcdir)/insert-header.sin > en@piglatin.insert-header
  32. mostlyclean: mostlyclean-piglatin
  33. mostlyclean-piglatin:
  34. rm -f *.insert-header