mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-27 03:36:39 +00:00
ab49553ba3
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8185 a592a061-630c-0410-9148-cb99ea01b6c8
320 lines
9.1 KiB
Makefile
320 lines
9.1 KiB
Makefile
# Makefile for program source directory in GNU NLS utilities package.
|
|
# Copyright (C) 1995-1997, 2000, 2001 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
|
|
#
|
|
# 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@
|
|
|
|
# These two variables depend on the location of this directory.
|
|
subdir = po
|
|
top_builddir = ..
|
|
|
|
SHELL = /bin/sh
|
|
@SET_MAKE@
|
|
|
|
srcdir = @srcdir@
|
|
top_srcdir = @top_srcdir@
|
|
VPATH = @srcdir@
|
|
|
|
prefix = @prefix@
|
|
exec_prefix = @exec_prefix@
|
|
datadir = @datadir@
|
|
localedir = $(datadir)/locale
|
|
gettextsrcdir = $(datadir)/gettext/po
|
|
|
|
INSTALL = @INSTALL@
|
|
INSTALL_DATA = @INSTALL_DATA@
|
|
MKINSTALLDIRS = @MKINSTALLDIRS@
|
|
mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
|
|
|
|
CC = @CC@
|
|
GMSGFMT = @GMSGFMT@
|
|
MSGFMT = @MSGFMT@
|
|
XGETTEXT = @XGETTEXT@
|
|
MSGMERGE = msgmerge
|
|
|
|
DEFS = @DEFS@
|
|
CFLAGS = @CFLAGS@
|
|
CPPFLAGS = @CPPFLAGS@
|
|
|
|
INCLUDES = -I.. -I$(top_srcdir)/intl
|
|
|
|
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
|
|
|
|
POFILES = @POFILES@
|
|
GMOFILES = @GMOFILES@
|
|
DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
|
|
$(POFILES) $(GMOFILES) xforms_l10n.pot qt_l10n.pot layouts_l10n.pot \
|
|
languages_l10n.pot ui_l10n.pot
|
|
|
|
POTFILE_IN_DEPS = $(shell find $(top_srcdir)/src -name Makefile.am)
|
|
|
|
POTFILES = \
|
|
|
|
CATALOGS = @CATALOGS@
|
|
|
|
.SUFFIXES:
|
|
.SUFFIXES: .c .o .po .pox .gmo .mo
|
|
|
|
.c.o:
|
|
$(COMPILE) $<
|
|
|
|
.po.pox:
|
|
$(MAKE) $(srcdir)/$(PACKAGE).pot
|
|
$(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
|
|
|
|
.po.mo:
|
|
$(MSGFMT) -o $@ $<
|
|
|
|
.po.gmo:
|
|
file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
|
|
&& case "$(GMSGFMT)" in \
|
|
*/msgfmt) rm -f $$file && $(GMSGFMT) --statistics -o $$file $<;; \
|
|
*) touch $$file ;; \
|
|
esac
|
|
|
|
|
|
all: all-@USE_NLS@
|
|
|
|
all-yes: $(CATALOGS)
|
|
all-no:
|
|
|
|
# Note: Target 'all' must not depend on target '$(srcdir)/$(PACKAGE).pot',
|
|
# otherwise packages like GCC can not be built if only parts of the source
|
|
# have been downloaded.
|
|
|
|
$(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in l10n_pots
|
|
$(XGETTEXT) --join-existing --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
|
|
--escape --add-comments --keyword=_ --keyword=N_ \
|
|
--keyword=qt_ --files-from=$(srcdir)/POTFILES.in \
|
|
&& test ! -f $(PACKAGE).po \
|
|
|| ( rm -f $(srcdir)/$(PACKAGE).pot \
|
|
&& mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot || true)
|
|
|
|
install: install-exec install-data
|
|
install-exec:
|
|
install-data: install-data-@USE_NLS@
|
|
if test "$(PACKAGE)" = "gettext"; then \
|
|
$(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
|
|
$(INSTALL_DATA) $(srcdir)/Makefile.in.in \
|
|
$(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
|
|
else \
|
|
: ; \
|
|
fi
|
|
install-data-no: all
|
|
install-data-yes: all
|
|
$(mkinstalldirs) $(DESTDIR)$(datadir)
|
|
@catalogs='$(CATALOGS)'; \
|
|
for cat in $$catalogs; do \
|
|
cat=`basename $$cat`; \
|
|
lang=`echo $$cat | sed 's/\.gmo$$//'`; \
|
|
dir=$(localedir)/$$lang/LC_MESSAGES; \
|
|
$(mkinstalldirs) $(DESTDIR)$$dir; \
|
|
if test -r $$cat; then \
|
|
$(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
|
|
echo "installing $$cat as $(DESTDIR)$$dir/$(PACKAGE).mo"; \
|
|
else \
|
|
$(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
|
|
echo "installing $(srcdir)/$$cat as" \
|
|
"$(DESTDIR)$$dir/$(PACKAGE).mo"; \
|
|
fi; \
|
|
done
|
|
|
|
# Define this as empty until I found a useful application.
|
|
installcheck:
|
|
|
|
uninstall:
|
|
catalogs='$(CATALOGS)'; \
|
|
for cat in $$catalogs; do \
|
|
cat=`basename $$cat`; \
|
|
lang=`echo $$cat | sed 's/\.gmo$$//'`; \
|
|
rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
|
|
done
|
|
if test "$(PACKAGE)" = "gettext"; then \
|
|
rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
|
|
else \
|
|
: ; \
|
|
fi
|
|
|
|
check: all
|
|
|
|
dvi info tags TAGS ID:
|
|
|
|
mostlyclean:
|
|
rm -f core core.* *.pox $(PACKAGE).po *.new.po
|
|
rm -fr *.o
|
|
|
|
clean: mostlyclean
|
|
|
|
distclean: clean
|
|
rm -f Makefile Makefile.in POTFILES *.mo
|
|
|
|
maintainer-clean: distclean
|
|
@echo "This command is intended for maintainers to use;"
|
|
@echo "it deletes files that may require special tools to rebuild."
|
|
rm -f $(GMOFILES)
|
|
|
|
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
|
dist distdir:
|
|
$(MAKE) update-po
|
|
@$(MAKE) dist2
|
|
# This is a separate target because 'update-po' must be executed before.
|
|
dist2: $(DISTFILES)
|
|
dists="$(DISTFILES)"; \
|
|
for file in $$dists; do \
|
|
if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
|
|
cp -p $$dir/$$file $(distdir); \
|
|
done
|
|
|
|
update-po: Makefile
|
|
$(MAKE) $(PACKAGE).pot
|
|
if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
|
|
cd $(srcdir); \
|
|
catalogs='$(GMOFILES)'; \
|
|
for cat in $$catalogs; do \
|
|
cat=`basename $$cat`; \
|
|
lang=`echo $$cat | sed 's/\.gmo$$//'`; \
|
|
echo "$$lang:"; \
|
|
if $(MSGMERGE) $$lang.po $(PACKAGE).pot -o $$lang.new.po; then \
|
|
mv -f $$lang.new.po $$lang.po; \
|
|
else \
|
|
echo "msgmerge for $$cat failed!"; \
|
|
rm -f $$lang.new.po; \
|
|
fi; \
|
|
done
|
|
$(MAKE) update-gmo
|
|
|
|
update-gmo: Makefile $(GMOFILES)
|
|
@:
|
|
|
|
Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in
|
|
cd $(top_builddir) \
|
|
&& CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
|
|
$(SHELL) ./config.status
|
|
|
|
${srcdir}/POTFILES.in: $(POTFILE_IN_DEPS)
|
|
LC_ALL=C ; export LC_ALL ; \
|
|
rm -f $@-t \
|
|
&& ( cd $(top_srcdir); \
|
|
grep -l "_(\".*\")" `find src -name \*.[hHC] -print` |\
|
|
sed -e '/xforms.forms/d' | \
|
|
sort | uniq ) > $@-t \
|
|
&& mv $@-t $@
|
|
|
|
|
|
l10n_pots: $(srcdir)/xforms_l10n.pot $(srcdir)/qt_l10n.pot $(srcdir)/layouts_l10n.pot $(srcdir)/languages_l10n.pot $(srcdir)/ui_l10n.pot
|
|
cat $(srcdir)/xforms_l10n.pot $(srcdir)/qt_l10n.pot $(srcdir)/layouts_l10n.pot $(srcdir)/languages_l10n.pot $(srcdir)/ui_l10n.pot | \
|
|
msguniq -o $(PACKAGE).po
|
|
|
|
$(srcdir)/xforms_l10n.pot: $(top_srcdir)/src/frontends/xforms/forms/*.fd
|
|
cd ${srcdir} ; \
|
|
LC_ALL=C ; export LC_ALL ; \
|
|
awk ' \
|
|
BEGIN { \
|
|
print "#, fuzzy"; \
|
|
print "msgid \"\""; \
|
|
print "msgstr \"\""; \
|
|
print "\"Content-Type: text/plain; charset=ISO-8859-1\\n\""; \
|
|
print "\"Content-Transfer-Encoding: 8bit\\n\""; \
|
|
print "\n"; \
|
|
skip=0; \
|
|
} \
|
|
/style: 15/ { \
|
|
skip=1; \
|
|
} \
|
|
/label: / { \
|
|
if (NF > 1 && skip == 0) { \
|
|
line=$$0;\
|
|
sub(/label: /,"",line);\
|
|
printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", FILENAME, FNR, line);\
|
|
}\
|
|
skip=0; \
|
|
}' \
|
|
../src/frontends/xforms/forms/*.fd > xforms_l10n.pot
|
|
|
|
$(srcdir)/qt_l10n.pot: $(top_srcdir)/src/frontends/qt2/ui/*.ui
|
|
cd ${srcdir} ; \
|
|
LC_ALL=C ; export LC_ALL ; \
|
|
awk ' \
|
|
/<string>/ { \
|
|
line=$$0; \
|
|
sub(/.*<string>/, "", line); \
|
|
sub(/<\/string>.*/, "", line); \
|
|
gsub(/&/, "\\&", line); \
|
|
gsub(/</, "<", line); \
|
|
gsub(/>/, ">", line); \
|
|
gsub(/\"/, "\\\"", line); \
|
|
if (length(line) > 0) \
|
|
printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n",\
|
|
FILENAME, FNR, line); \
|
|
}' \
|
|
../src/frontends/qt2/ui/*.ui > qt_l10n.pot
|
|
|
|
$(srcdir)/layouts_l10n.pot: $(top_srcdir)/lib/layouts/*.layout $(top_srcdir)/lib/layouts/*.inc
|
|
cd ${srcdir} ; \
|
|
LC_ALL=C ; export LC_ALL ; \
|
|
awk ' \
|
|
/^Style / { \
|
|
line=$$0; \
|
|
sub(/Style /, "", line); \
|
|
printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
|
|
FILENAME, FNR, line); \
|
|
} \
|
|
/GuiName/ { \
|
|
line=$$0; \
|
|
sub(/[[:space:]]*GuiName[[:space:]]*/, "", line); \
|
|
printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
|
|
FILENAME, FNR, line); \
|
|
} \
|
|
' ../lib/layouts/*.layout ../lib/layouts/*.inc > layouts_l10n.pot
|
|
|
|
$(srcdir)/languages_l10n.pot: $(top_srcdir)/lib/languages
|
|
cd ${srcdir} ; \
|
|
awk ' \
|
|
/^#/ { \
|
|
next; \
|
|
} \
|
|
{ \
|
|
match($$0,"\"[^\"]*\""); \
|
|
lang=substr($$0,RSTART,RLENGTH); \
|
|
gsub(/\"/, "", lang); \
|
|
printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
|
|
FILENAME, FNR, lang); \
|
|
} \
|
|
' ../lib/languages > languages_l10n.pot
|
|
|
|
$(srcdir)/ui_l10n.pot: $(top_srcdir)/lib/ui/*.ui
|
|
cd ${srcdir} ; \
|
|
LC_ALL=C ; export LC_ALL ; \
|
|
awk ' \
|
|
/^[^#]*Submenu/ { \
|
|
line=$$0; \
|
|
sub(/[^"]*"/, "", line); \
|
|
sub(/".*/, "", line); \
|
|
printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
|
|
FILENAME, FNR, line); \
|
|
} \
|
|
/^[^#]*Toolbar/ { \
|
|
line=$$0; \
|
|
sub(/[^"]*"/, "", line); \
|
|
sub(/".*/, "", line); \
|
|
printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
|
|
FILENAME, FNR, line); \
|
|
} \
|
|
/^[^#]*Item/ { \
|
|
line=$$0; \
|
|
sub(/[^"]*"/, "", line); \
|
|
sub(/".*/, "", line); \
|
|
printf("#: %s:%d\nmsgid \"%s\"\nmsgstr \"\"\n\n", \
|
|
FILENAME, FNR, line); \
|
|
} \
|
|
' ../lib/ui/*.ui > ui_l10n.pot
|
|
|
|
# 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:
|