]> git.lyx.org Git - lyx.git/blobdiff - po/Makefile.in.in
changes... read the changelog...
[lyx.git] / po / Makefile.in.in
index 3b778981937a085bd9cde3cc9bb70f703f429077..6974cbd0e9c480555a8199ad6106885e1fb87383 100644 (file)
@@ -1,19 +1,10 @@
 # Makefile for program source directory in GNU NLS utilities package.
-# Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
 #
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# This file file be copied and used freely without restrictions.  It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
 
 PACKAGE = @PACKAGE@
 VERSION = @VERSION@
@@ -48,7 +39,7 @@ DEFS = @DEFS@
 CFLAGS = @CFLAGS@
 CPPFLAGS = @CPPFLAGS@
 
-INCLUDES = -I../src -I$(top_srcdir)/intl
+INCLUDES = -I.. -I$(top_srcdir)/intl
 
 COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
 
@@ -58,6 +49,8 @@ GMOFILES = @GMOFILES@
 DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
 stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
 
+POTFILE_IN_DEPS = $(shell find $(top_srcdir)/src -name Makefile.am)
+
 POTFILES = \
 
 CATALOGS = @CATALOGS@
@@ -91,18 +84,19 @@ INSTOBJEXT = @INSTOBJEXT@
 
 all: all-@USE_NLS@
 
-all-yes: $(srcdir)/cat-id-tbl.c $(CATALOGS)
+all-yes: cat-id-tbl.c $(CATALOGS)
 all-no:
 
 $(srcdir)/$(PACKAGE).pot: $(POTFILES)
        $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
          --add-comments --keyword=_ --keyword=N_ \
-         --files-from=$(srcdir)/POTFILES.in
-       rm -f $(srcdir)/$(PACKAGE).pot
-       mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
+         --files-from=$(srcdir)/POTFILES.in \
+       && test ! -f $(PACKAGE).po \
+          || ( rm -f $(srcdir)/$(PACKAGE).pot \
+               && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
 
-$(srcdir)/cat-id-tbl.c: $(srcdir)/stamp-cat-id; @:
-$(srcdir)/stamp-cat-id: $(srcdir)/$(PACKAGE).pot
+$(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
+$(srcdir)/stamp-cat-id: $(PACKAGE).pot
        rm -f cat-id-tbl.tmp
        sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
                | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
@@ -115,16 +109,15 @@ $(srcdir)/stamp-cat-id: $(srcdir)/$(PACKAGE).pot
        fi
        cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
 
-
 install: install-exec install-data
 install-exec:
 install-data: install-data-@USE_NLS@
 install-data-no: all
 install-data-yes: all
-       if test -r $(MKINSTALLDIRS); then \
+       if test -r "$(MKINSTALLDIRS)"; then \
          $(MKINSTALLDIRS) $(datadir); \
        else \
-         $(top_srcdir)/mkinstalldirs $(datadir); \
+         $(SHELL) $(top_srcdir)/mkinstalldirs $(datadir); \
        fi
        @catalogs='$(CATALOGS)'; \
        for cat in $$catalogs; do \
@@ -135,10 +128,10 @@ install-data-yes: all
          esac; \
          lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
          dir=$$destdir/$$lang/LC_MESSAGES; \
-         if test -r $(MKINSTALLDIRS); then \
+         if test -r "$(MKINSTALLDIRS)"; then \
            $(MKINSTALLDIRS) $$dir; \
          else \
-           $(top_srcdir)/mkinstalldirs $$dir; \
+           $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
          fi; \
          if test -r $$cat; then \
            $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
@@ -163,10 +156,10 @@ install-data-yes: all
          fi; \
        done
        if test "$(PACKAGE)" = "gettext"; then \
-         if test -r $(MKINSTALLDIRS); then \
+         if test -r "$(MKINSTALLDIRS)"; then \
            $(MKINSTALLDIRS) $(gettextsrcdir); \
          else \
-           $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
+           $(SHELL) $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
          fi; \
          $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
                          $(gettextsrcdir)/Makefile.in.in; \
@@ -202,7 +195,7 @@ mostlyclean:
 clean: mostlyclean
 
 distclean: clean
-       rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
+       rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m *~ *.old *.bak
 
 maintainer-clean: distclean
        @echo "This command is intended for maintainers to use;"
@@ -236,15 +229,25 @@ update-po: Makefile
          fi; \
        done
 
+${srcdir}/POTFILES.in: $(POTFILE_IN_DEPS)
+       rm -f $@-t \
+       && ( cd $(top_srcdir); \
+            grep -l "_(\".*\")" `find src -name \*.[hHC]` | \
+            sed -e '/xforms.forms/d' | \
+            sort -f -d | uniq ) > $@-t \
+       && echo "src/ext_l10n.h" >> $@-t \
+       && mv $@-t $@
+
 POTFILES: POTFILES.in
        ( if test 'x$(srcdir)' != 'x.'; then \
-           posrcprefix='$(top_srcdir)/'; \
+             posrcprefix='$(top_srcdir)/'; \
          else \
-           posrcprefix="../"; \
+             posrcprefix="../"; \
          fi; \
          rm -f $@-t $@ \
-           && (sed -e '/^#/d' -e '/^[  ]*$$/d' \
-                   -e "s@.*@   $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
+           && (sed  < $(srcdir)/$@.in \
+                   -e '/^#/d' -e '/^[  ]*$$/d' \
+                   -e "s@.*@   $$posrcprefix& \\\\@" \
                | sed -e '$$s/\\$$//') > $@-t \
            && chmod a-w $@-t \
            && mv $@-t $@ )
@@ -254,6 +257,16 @@ Makefile: Makefile.in.in ../config.status POTFILES
          && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
               $(SHELL) ./config.status
 
+$(top_srcdir)/src/ext_l10n.h: $(top_srcdir)/lib/layouts/*.layout $(top_srcdir)/lib/layouts/*.inc $(top_srcdir)/lib/ui/default.ui $(top_srcdir)/lib/languages
+       sed < $(top_srcdir)/lib/ui/default.ui -n \
+               -e 's/.*[sS]ub[mM]enu[^"]*\("[^"]*"\).*/_(\1);/p' \
+               -e 's/.*[iI]tem[^"]*\("[^"]*"\).*/_(\1);/p' \
+               > $@
+       cat $(top_srcdir)/lib/layouts/*.layout $(top_srcdir)/lib/layouts/*.inc | \
+               sed -n -e 's/^[sS]tyle[ ]*\([^ ]*\)$$/_("\1");/p' | \
+               sort | uniq >> $@
+       sed < $(top_srcdir)/lib/languages -e '/^#/d' -e 's/[^"]*\("[A-Za-z0-9][^"]*"\).*/_(\1);/' >> $@
+
 # Tell versions [3.59,3.63) of GNU make not to export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT: