home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / id-utils-3.2-src.tgz / tar.out / fsf / id-utils / po / Makefile.in.in < prev    next >
Makefile  |  1996-09-28  |  7KB  |  255 lines

  1. # Makefile for program source directory in GNU NLS utilities package.
  2. # Copyright (C) 1995, 1996 Free Software Foundation, Inc.
  3. #
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17.  
  18. PACKAGE = @PACKAGE@
  19. VERSION = @VERSION@
  20.  
  21. SHELL = /bin/sh
  22. @SET_MAKE@
  23.  
  24. srcdir = @srcdir@
  25. top_srcdir = @top_srcdir@
  26. VPATH = @srcdir@
  27.  
  28. prefix = @prefix@
  29. exec_prefix = @exec_prefix@
  30. datadir = $(prefix)/@DATADIRNAME@
  31. localedir = $(datadir)/locale
  32. gnulocaledir = $(prefix)/share/locale
  33. gettextsrcdir = $(prefix)/share/gettext/po
  34. subdir = po
  35.  
  36. INSTALL = @INSTALL@
  37. INSTALL_DATA = @INSTALL_DATA@
  38. MKINSTALLDIRS = @MKINSTALLDIRS@
  39.  
  40. CC = @CC@
  41. GENCAT = @GENCAT@
  42. GMSGFMT = PATH=../src:$$PATH @GMSGFMT@
  43. MSGFMT = @MSGFMT@
  44. XGETTEXT = PATH=../src:$$PATH @XGETTEXT@
  45. MSGMERGE = PATH=../src:$$PATH msgmerge
  46.  
  47. DEFS = @DEFS@
  48. CFLAGS = @CFLAGS@
  49. CPPFLAGS = @CPPFLAGS@
  50.  
  51. INCLUDES = -I.. -I$(top_srcdir)/intl
  52.  
  53. COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
  54.  
  55. SOURCES = cat-id-tbl.c
  56. POFILES = @POFILES@
  57. GMOFILES = @GMOFILES@
  58. DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
  59. stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
  60.  
  61. POTFILES = \
  62.  
  63. CATALOGS = @CATALOGS@
  64. CATOBJEXT = @CATOBJEXT@
  65. INSTOBJEXT = @INSTOBJEXT@
  66.  
  67. .SUFFIXES:
  68. .SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
  69.  
  70. .c.o:
  71.     $(COMPILE) $<
  72.  
  73. .po.pox:
  74.     $(MAKE) $(PACKAGE).pot
  75.     $(MSGMERGE) $< $(PACKAGE).pot -o $*.pox
  76.  
  77. .po.mo:
  78.     $(MSGFMT) -o $@ $<
  79.  
  80. .po.gmo:
  81.     file=`echo $* | sed 's,.*/,,'`.gmo \
  82.       && rm -f $$file && $(GMSGFMT) -o $$file $<
  83.  
  84. .po.cat:
  85.     sed -f ../intl/po2msg.sed < $< > $*.msg \
  86.       && rm -f $@ && $(GENCAT) $@ $*.msg
  87.  
  88.  
  89. all: all-@USE_NLS@
  90.  
  91. all-yes: cat-id-tbl.c $(CATALOGS)
  92. all-no:
  93.  
  94. # Build the .pot file only in the build directory.
  95. $(PACKAGE).pot: $(POTFILES)
  96.     $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
  97.       --add-comments --keyword=_ --keyword=N_ \
  98.       --files-from=$(srcdir)/POTFILES.in
  99.     if [ ! -s $(PACKAGE).po ] \
  100.       || cmp -s $(PACKAGE).po $(PACKAGE).pot; then \
  101.       rm -f $(PACKAGE).po; \
  102.     else \
  103.       rm -f $(PACKAGE).pot \
  104.         && mv $(PACKAGE).po $(PACKAGE).pot; \
  105.     fi
  106.  
  107. cat-id-tbl.c: stamp-cat-id
  108. stamp-cat-id: $(PACKAGE).pot
  109.     rm -f cat-id-tbl.tmp
  110.     sed -f ../intl/po2tbl.sed $(PACKAGE).pot \
  111.         | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
  112.     if cmp -s cat-id-tbl.tmp cat-id-tbl.c; then \
  113.       rm cat-id-tbl.tmp; \
  114.     else \
  115.       echo cat-id-tbl.c changed; \
  116.       rm -f cat-id-tbl.c; \
  117.       mv cat-id-tbl.tmp cat-id-tbl.c; \
  118.     fi
  119.     rm -f stamp-cat-id && echo timestamp > stamp-cat-id
  120.  
  121.  
  122. install: install-exec install-data
  123. install-exec:
  124. install-data: install-data-@USE_NLS@
  125. install-data-no: all
  126. install-data-yes: all
  127.     if test -r $(MKINSTALLDIRS); then \
  128.       $(MKINSTALLDIRS) $(datadir); \
  129.     else \
  130.       $(top_srcdir)/mkinstalldirs $(datadir); \
  131.     fi
  132.     @catalogs='$(CATALOGS)'; \
  133.     for cat in $$catalogs; do \
  134.       case "$$cat" in \
  135.         *.gmo) destdir=$(gnulocaledir);; \
  136.         *)     destdir=$(localedir);; \
  137.       esac; \
  138.       lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \
  139.       dir=$$destdir/$$lang/LC_MESSAGES; \
  140.       if test -r $(MKINSTALLDIRS); then \
  141.         $(MKINSTALLDIRS) $$dir; \
  142.       else \
  143.         $(top_srcdir)/mkinstalldirs $$dir; \
  144.       fi; \
  145.       if test -r $$cat; then \
  146.         $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
  147.         echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
  148.       else \
  149.         $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
  150.         echo "installing $(srcdir)/$$cat as" \
  151.          "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
  152.       fi; \
  153.       if test -r $$cat.m; then \
  154.         $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
  155.         echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
  156.       else \
  157.         if test -r $(srcdir)/$$cat.m ; then \
  158.           $(INSTALL_DATA) $(srcdir)/$$cat.m \
  159.         $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
  160.           echo "installing $(srcdir)/$$cat as" \
  161.            "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
  162.         else \
  163.           true; \
  164.         fi; \
  165.       fi; \
  166.     done
  167.     if test "$(PACKAGE)" = "gettext"; then \
  168.       if test -r $(MKINSTALLDIRS); then \
  169.         $(MKINSTALLDIRS) $(gettextsrcdir); \
  170.       else \
  171.         $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
  172.       fi; \
  173.       cd $(srcdir) && \
  174.         $(INSTALL_DATA) Makefile.in.in $(gettextsrcdir)/Makefile.in.in; \
  175.     else \
  176.       : ; \
  177.     fi
  178.  
  179. # Define this as empty until I found a useful application.
  180. installcheck:
  181.  
  182. uninstall:
  183.     catalogs='$(CATALOGS)'; \
  184.     for cat in $$catalogs; do \
  185.       lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \
  186.       rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
  187.       rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
  188.       rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
  189.       rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
  190.     done
  191.     rm -f $(gettextsrcdir)/po-Makefile.in.in
  192.  
  193. check: all
  194.  
  195. cat-id-tbl.o: ../intl/libgettext.h
  196.  
  197. dvi info tags TAGS ID:
  198.  
  199. mostlyclean:
  200.     rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp
  201.     rm -fr *.o
  202.  
  203. clean: mostlyclean
  204.  
  205. distclean: clean
  206.     rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
  207.  
  208. maintainer-clean: distclean
  209.     @echo "This command is intended for maintainers to use;"
  210.     @echo "it deletes files that may require special tools to rebuild."
  211.  
  212. distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
  213. dist distdir: update-po $(DISTFILES)
  214.     for file in $(DISTFILES); do \
  215.       ln $(srcdir)/$$file $(distdir) 2> /dev/null \
  216.         || cp -p $(srcdir)/$$file $(distdir); \
  217.     done
  218.  
  219. update-po: Makefile
  220.     $(MAKE) $(PACKAGE).pot
  221.     PATH=`pwd`/../src:$$PATH; \
  222.     cd $(srcdir); \
  223.     catalogs='$(CATALOGS)'; \
  224.     for cat in $$catalogs; do \
  225.       lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \
  226.       mv $$lang.po $$lang.old.po; \
  227.       echo "$$lang:"; \
  228.       if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
  229.         rm -f $$lang.old.po; \
  230.       else \
  231.         echo "msgmerge for $$cat failed!"; \
  232.         rm -f $$lang.po; \
  233.         mv $$lang.old.po $$lang.po; \
  234.       fi; \
  235.     done
  236.  
  237. POTFILES: POTFILES.in
  238.     ( if test 'x$(srcdir)' != 'x.'; then \
  239.         posrcprefix='$(top_srcdir)/'; \
  240.       else \
  241.         posrcprefix="../"; \
  242.       fi; \
  243.       sed -e '/^#/d' -e '/^[     ]*$$/d' \
  244.           -e "s@.*@    $$posrcprefix& \\\\@" \
  245.           -e '$$s/\(.*\) \\/\1/' < $(srcdir)/POTFILES.in > POTFILES )
  246.  
  247. Makefile: Makefile.in.in ../config.status POTFILES
  248.     cd .. \
  249.       && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
  250.            $(SHELL) ./config.status
  251.  
  252. # Tell versions [3.59,3.63) of GNU make not to export all variables.
  253. # Otherwise a system limit (for SysV at least) may be exceeded.
  254. .NOEXPORT:
  255.