]> git.lyx.org Git - lyx.git/blobdiff - po/Makefile.in.in
changes... read the changelog...
[lyx.git] / po / Makefile.in.in
index cb33dc4999e2fbc2b0643072ee7ef12ff1e4ddf1..6974cbd0e9c480555a8199ad6106885e1fb87383 100644 (file)
@@ -49,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@
@@ -107,7 +109,6 @@ $(srcdir)/stamp-cat-id: $(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@
@@ -194,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;"
@@ -228,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 $@ )
@@ -246,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: